Class: Geom::UTM

Inherits:
Object
  • Object
show all

Overview

The UTM class lets you work with UTM map coordinates.

Version:

  • SketchUp 6.0

Instance Method Summary # collapse

Constructor Details

#initialize(zone_number, zone_letter, x, y) ⇒ Object

The new method is used to create a new UTM coordinate. You will often create UTM objects by calling the method Model.point_to_utm instead of calling this method.

Examples:

# Create a copy of an existing UTM object.
utm = Geom::UTM.new utm2

# Create a new UTM object from scratch.
utm = Geom::UTM.new 13, "T", 475849.37521, 4429682.73749

Returns utm - a utm coordinate if successful

Parameters:

  • zone_number

    A zone number or a UTM object. If this first parameter is a UTM object, then the other parameters are ignored.

  • zone_letter

    A zone letter.

  • x

    The x position.

  • y

    The y position.

Version:

  • SketchUp 6.0

Instance Method Details

#to_aObject

The to_a method returns a UTM coordinate as a 4 element array. The Array elements are the zone number, the zone letter, the x coordinate and the y coordinate.

Examples:

# Create a new UTM object from scratch.
utm = Geom::UTM.new 13, "T", 475849.37521, 4429682.73749
a = utm.to_a

Returns:

  • utm_as_array - a utm array if successful

Version:

  • SketchUp 6.0

#to_latlongObject

The to_latlong method is used to convert UTM coordinates to latitude and longitude. See the LatLong class for more information.

Examples:

# Create a new UTM object from scratch.
utm = Geom::UTM.new 13, "T", 475849.37521, 4429682.73749
ll = utm.to_latlong

Returns:

  • utm_as_latlong - a LatLong object if successful

Version:

  • SketchUp 6.0

#to_sObject

The to_s method is used to retrieve a string representation of a UTM.

Examples:

# Create a new UTM object from scratch.
utm = Geom::UTM.new 13, "T", 475849.37521, 4429682.73749
string = utm.to_s

Returns:

  • utm_as_string - a utm string if successful

Version:

  • SketchUp 6.0

#xObject

The x method returns the UTM x coordinate.

Examples:

# Create a new UTM object from scratch.
utm = Geom::UTM.new 13, "T", 475849.37521, 4429682.73749
x = utm.x

Returns:

  • x - the UTM x coordinate

Version:

  • SketchUp 6.0

#yObject

The x method returns the UTM y coordinate.

Examples:

# Create a new UTM object from scratch.
utm = Geom::UTM.new 13, "T", 475849.37521, 4429682.73749
y = utm.y

Returns:

  • y - the UTM y coordinate

Version:

  • SketchUp 6.0

#zone_letterObject

The zone_letter method returns the UTM zone letter.

Examples:

# Create a new UTM object from scratch.
utm = Geom::UTM.new 13, "T", 475849.37521, 4429682.73749
zl = utm.zone_letter

Returns:

  • zone_letter - the UTM zone letter

Version:

  • SketchUp 6.0

#zone_numberObject

The zone_number method returns the UTM zone number.

Examples:

# Create a new UTM object from scratch.
utm = Geom::UTM.new 13, "T", 475849.37521, 4429682.73749
zn = utm.zone_number

Returns:

  • zone_number - the UTM zone number

Version:

  • SketchUp 6.0