Class: Geom::LatLong

Inherits:
Object
  • Object
show all

Overview

The LatLong class contains various methods for creating and manipulating latitude and longitude coordinates.

Version:

  • SketchUp 6.0

Instance Method Summary # collapse

Constructor Details

#initialize(latlong) ⇒ Object

The new method creates a LatLong object.

Examples:

ll = [40.01700, 105.28300]
latlong = Geom::LatLong.new(ll)
if (latlong)
  UI.messagebox latlong
else
  UI.messagebox "Failure"
end

Returns latlong - a LatLong object

Parameters:

  • latlong

    A latitude and longitude coordinate set as an Array.

Version:

  • SketchUp 6.0

Instance Method Details

#latitudeObject

The Latitude method retrieves the latitude coordinate from a LatLong object.

Examples:

ll = [40.01700, 105.28300]
latlong = Geom::LatLong.new(ll)
latitude = latlong.latitude
if (latitude)
  UI.messagebox latitude
else
  UI.messagebox "Failure"
end

Returns:

  • latitude - a latitude coordinate value

Version:

  • SketchUp 6.0

#longitudeObject

The Latitude method retrieves the longitude coordinate from a LatLong object.

Examples:

ll = [40.01700, 105.28300]
latlong = Geom::LatLong.new(ll)
longitude = latlong.longitude
if (longitude)
  UI.messagebox longitude
else
  UI.messagebox "Failure"
end

Returns:

  • longitude - a latitude coordinate value

Version:

  • SketchUp 6.0

#to_aArray(Float, Float)

The #to_a method converts a LatLong object to an array of two values.

Examples:

latlong = Geom::LatLong.new([40.01700, 105.28300])
array = latlong.to_a

Returns:

  • (Array(Float, Float))

    an array of latitude and longitude

Version:

  • SketchUp 6.0

#to_sString

The #to_s method converts a LatLong object to a String.

Examples:

latlong = Geom::LatLong.new([40.01700, 105.28300])
string = latlong.to_s

Returns:

Version:

  • SketchUp 6.0

#to_utmObject

The to_utm method converts a LatLong object to an array of two values.

Examples:

ll = [40.01700, 105.28300]
latlong = Geom::LatLong.new(ll)
utm = latlong.to_utm
if (utm)
  UI.messagebox utm
else
  UI.messagebox "Failure"
end

Returns:

  • array - an array of two values: latitude and longitude

Version:

  • SketchUp 6.0