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

#initializeGeom::LatLong #initialize(latlong) ⇒ Geom::LatLong #initialize(latlong_array) ⇒ Geom::LatLong #initialize(lat, long) ⇒ Geom::LatLong

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

Overloads:

Version:

  • SketchUp 6.0

Instance Method Details

#latitudeFloat

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:

  • (Float)

    a latitude coordinate value

Version:

  • SketchUp 6.0

#longitudeFloat

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:

  • (Float)

    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_utmGeom::UTM

The to_utm method converts a LatLong object to a UTM object.

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:

Version:

  • SketchUp 6.0