class UTM |
Parent: Object |
|
Methods:new, to_a, to_latlong, to_s, x, y, zone_letter, zone_number |
|
Sample Code: |
|
Class Methods |
new |
The new method is used to create a new UTM coordinate. |
Syntax: |
utm = Geom::UTM.new zone_number, zone_letter, x, y utm = Geom::UTM.new utm2 |
Arguments: |
|
Return Value: |
utm - a utm coordinate if successful |
Comments: |
You will often create UTM objects by calling the method point_to_utm. The second variation makes a new UTM object that is a copy of the first. |
Example: |
utm = Geom::UTM.new 13, "T",
475849.37521, 4429682.73749 |
Instance Methods |
to_a |
The to_a method is used to convert a UTM coordinate into a 4 element array. |
Syntax: |
array = utm.to_a |
Arguments: |
|
Return Value: |
array - a Array object with 4 elements if successful |
Comments: |
|
Example: |
utm = Geom::UTM.new 13, "T",
475849.37521, 4429682.73749 |
to_latlong |
The to_latlong method is used to convert UTM coordinates to latitude and longitude. See also LatLong. |
Syntax: |
latlong = utm.to_latlong |
Arguments: |
|
Return Value: |
latlong - a latitude and longitude if successful |
Comments: |
|
Example: |
utm = Geom::UTM.new 13, "T",
475849.37521, 4429682.73749 |
to_s |
The to_s method is used to retrieve a string representation of a UTM. |
Syntax: |
string = utm.to_s |
Arguments: |
|
Return Value: |
string - a string representation of the UTM |
Comments: |
|
Example: |
utm = Geom::UTM.new 13, "T",
475849.37521, 4429682.73749 |
x |
The x method is used to retrieve the X coordinate. |
Syntax: |
x = utm.x |
Arguments: |
|
Return Value: |
x - the X coordinate if successful |
Comments: |
|
Example: |
utm = Geom::UTM.new 13, "T",
475849.37521, 4429682.73749 |
y |
The y method is used to retrieve the Y coordinate. |
Syntax: |
y = utm.y |
Arguments: |
|
Return Value: |
y - the Y coordinate if successful |
Comments: |
|
Example: |
utm = Geom::UTM.new 13, "T",
475849.37521, 4429682.73749 |
zone_letter |
The zone_letter method is used to retrieve the UTM zone letter. |
Syntax: |
zoneletter = utm.zone_letter |
Arguments: |
|
Return Value: |
zoneletter - the UTM zone letter if successful |
Comments: |
|
Example: |
utm = Geom::UTM.new 13, "T",
475849.37521, 4429682.73749 |
zone_number |
The zone_number is used to retrieve the UTM zone number. |
Syntax: |
zonenumber = utm.zone_number |
Arguments: |
|
Return Value: |
zonenumber - the UTM zone number if successful |
Comments: |
|
Example: |
utm = Geom::UTM.new 13, "T",
475849.37521, 4429682.73749 |