123456789_123456789_123456789_123456789_123456789_

Class: Geom::UTM

Relationships
Inherits: Object

Overview

Note:

Valid ranges for #zone_number and #zone_letter are 1-60 and C-X (omitting I and O). Valid ranges for #x and #y are 100000-899999.

The UTM class lets you work with UTM map coordinates.

Version:

  • SketchUp 6.0

Class Method Summary

Instance Method Summary

Constructor Details

.new(zone_number, zone_letter, x, y) ⇒ UTM .new(utm) ⇒ UTM .new(array) ⇒ UTM

The #initialize method is used to create a new UTM coordinate. You will often create UTM objects by calling the method Sketchup::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)

Overloads:

  • .new(zone_number, zone_letter, x, y) ⇒ UTM

    Parameters:

    • zone_number (Integer)

      A zone number or a UTM object.

    • zone_letter (String)

      A zone letter.

    • x (Float)

      The x position.

    • y (Float)

      The y position.

  • .new(utm) ⇒ UTM

    Parameters:

    • utm (UTM)

      A UTM object.

  • .new(array) ⇒ UTM

    Parameters:

    • An (Array(Integer, String, Float, Float))

      array containing the zone number, zone letter, x and y positions.

Version:

  • SketchUp 6.0

Instance Method Details

#to_aArray(Integer, String, Float, Float)

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

Version:

  • SketchUp 6.0

#to_latlongGeom::LatLong

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

Version:

  • SketchUp 6.0

#to_sString

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

Version:

  • SketchUp 6.0

#xFloat

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

Version:

  • SketchUp 6.0

#yFloat

The #y 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

Version:

  • SketchUp 6.0

#zone_letterString

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

Version:

  • SketchUp 6.0

#zone_numberInteger

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

Version:

  • SketchUp 6.0