123456789_123456789_123456789_123456789_123456789_

Class: Geom::LatLong

Relationships
Inherits: Object

Overview

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

Version:

  • SketchUp 6.0

Class Method Summary

Instance Method Summary

Constructor Details

.newLatLong .new(latlong) ⇒ LatLong .new(latlong_array) ⇒ LatLong .new(lat, long) ⇒ 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:

  • .newLatLong
  • .new(latlong) ⇒ LatLong

    Parameters:

    • latlong (LatLong)
  • .new(latlong_array) ⇒ LatLong

    Parameters:

  • .new(lat, long) ⇒ LatLong

    Parameters:

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

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

Version:

  • SketchUp 6.0