Class: Geom::UTM

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

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

Instance Method Summary collapse

Constructor Details

#initialize(zone_number, zone_letter, x, y) ⇒ Geom::UTM #initialize(utm) ⇒ Geom::UTM #initialize(array) ⇒ Geom::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:

  • #initialize(zone_number, zone_letter, x, y) ⇒ Geom::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.

  • #initialize(utm) ⇒ Geom::UTM

    Parameters:

  • #initialize(array) ⇒ Geom::UTM

    Parameters:

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

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

Version:

  • SketchUp 6.0



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

def initialize(*args)
end

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

Returns:

Version:

  • SketchUp 6.0



59
60
# File 'lib/sketchup-api-stubs/stubs/Geom/UTM.rb', line 59

def to_a
end

#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

Returns:

Version:

  • SketchUp 6.0



73
74
# File 'lib/sketchup-api-stubs/stubs/Geom/UTM.rb', line 73

def to_latlong
end

#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

Returns:

Version:

  • SketchUp 6.0



86
87
# File 'lib/sketchup-api-stubs/stubs/Geom/UTM.rb', line 86

def to_s
end

#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

Returns:

  • (Float)

Version:

  • SketchUp 6.0



99
100
# File 'lib/sketchup-api-stubs/stubs/Geom/UTM.rb', line 99

def x
end

#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

Returns:

  • (Float)

Version:

  • SketchUp 6.0



112
113
# File 'lib/sketchup-api-stubs/stubs/Geom/UTM.rb', line 112

def y
end

#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

Returns:

Version:

  • SketchUp 6.0



125
126
# File 'lib/sketchup-api-stubs/stubs/Geom/UTM.rb', line 125

def zone_letter
end

#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

Returns:

  • (Integer)

Version:

  • SketchUp 6.0



138
139
# File 'lib/sketchup-api-stubs/stubs/Geom/UTM.rb', line 138

def zone_number
end