Class: Geom::LatLong

Inherits:
Object
  • Object
show all
Defined in:
lib/sketchup-api-stubs/stubs/Geom/LatLong.rb

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



44
45
# File 'lib/sketchup-api-stubs/stubs/Geom/LatLong.rb', line 44

def initialize(*args)
end

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



62
63
# File 'lib/sketchup-api-stubs/stubs/Geom/LatLong.rb', line 62

def latitude
end

#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



81
82
# File 'lib/sketchup-api-stubs/stubs/Geom/LatLong.rb', line 81

def longitude
end

#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



93
94
# File 'lib/sketchup-api-stubs/stubs/Geom/LatLong.rb', line 93

def to_a
end

#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



105
106
# File 'lib/sketchup-api-stubs/stubs/Geom/LatLong.rb', line 105

def to_s
end

#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



123
124
# File 'lib/sketchup-api-stubs/stubs/Geom/LatLong.rb', line 123

def to_utm
end