class LatLong |
Parent: Object |
|
| |
Sample Code: latlongtests.rb |
|
Class Methods |
new |
The new method creates a LatLong object |
Syntax: |
latlong = Geom::LatLong.new(latlong) |
Arguments: |
latlong - a latitude and longitude coordinate set |
Return Value: |
latlong - a LatLong object |
Comments: |
|
Example: |
ll = [40.01700, 105.28300] |
Instance Methods |
latitude |
The Latitude method retrieves the latitude coordinate from a LatLong object. |
Syntax: |
latitude = latlong.latitude |
Arguments: |
|
Return Value: |
latitude - a latitude coordinate value |
Comments: |
|
Example: |
coordinates = [10, 10, 10] |
longitude |
The Latitude method retrieves the longitude coordinate from a LatLong object. |
Syntax: |
latitude = latlong.longitude |
Arguments: |
|
Return Value: |
longitude - a latitude coordinate value |
Comments: |
|
Example: |
coordinates = [10, 10, 10] |
to_a |
The to_a method converts a LatLong object to an array of two values. |
Syntax: |
array = latlong.to_a |
Arguments: |
|
Return Value: |
array - an array of two values: latitude and longitude |
Comments: |
|
Example: |
coordinates = [10, 10, 10] |
to_s |
The to_a method converts a LatLong object to a string. |
Syntax: |
string = latlong.to_s |
Arguments: |
|
Return Value: |
string - a string representation of a LatLong object |
Comments: |
|
Example: |
coordinates = [10, 10, 10] end |
to_utm |
The to_a method converts a LatLong object to a UTM object. |
Syntax: |
utm = latlong.to_utm |
Arguments: |
|
Return Value: |
utm - a UTM object |
Comments: |
|
Example: |
coordinates = [10, 10, 10] |