Skip to content
Morton Fox edited this page Jun 24, 2013 · 1 revision

API reference

Geodetic Datums

YouTim supports the following geodetic datums:

wgs84         : WGS 84
nad83         : NAD 83
grs80         : GRS 80
wgs72         : WGS 72
aust1965      : Australian 1965
krasovsky1940 : Krasovsky 1940
na1927        : North American 1927
intl1924      : International 1924
hayford1909   : Hayford 1909
clarke1880    : Clarke 1880
clarke1866    : Clarke 1866
airy1830      : Airy 1830
bessel1841    : Bessel 1841
everest1830   : Everest 1830

If unspecified, conversion functions default to "wgs84".

UTMConv.UTMCoords

This class represents UTM coordinates.

Attributes

utmz : UTM zone for these coordinates
easting : Easting portion of coordinates
northing : Northing portion of coordinates

Methods

new UTMConv.UTMCoords(utmz, easting, northing)

Constructor.

UTMCoords.toString()

Convert to string.

UTMCoords.to_degmin(datum)

Convert UTM coordinates to degree-minute coordinates using datum. Returns a DegMinCoords object.

If datum is unspecified, default to "wgs84".

UTMCoords.to_deg(datum)

Convert UTM coordinates to decimal degree coordinates using datum. Returns a DegCoords object.

If datum is unspecified, default to "wgs84".

UTMConv.DegCoords

This class represents coordinates in decimal degree format, i.e. one floating-point number each for latitude degrees and longitude degrees.

Attributes

latd : Latitude in degrees. (positive = north, negative = south)
lngd : Longitude in degrees. (positive = east, negative = west)
datum : Geodetic datum

Methods

new UTMConv.DegCoords(latd, lngd, datum)

Constructor. If datum is unspecified, default to "wgs84".

DegCoords.toString()

Convert to string.

DegCoords.calc_utmz()

Calculate UTM Zone for these coordinates.

DegCoords.to_utm(utmz)

Convert coordinates to UTM. Returns a UTMCoords object.

If utmz is specified, use that UTM zone. Otherwise, calculate the UTM zone while doing the conversion.

DegCoords.to_degmin()

Convert coordinates to degree-minute format. Returns a DegMinCoords object.

UTMConv.DegMinCoords

This class represents coordinates in degree-minute format, i.e. the latitude and longitude numbers are split into an integer for degrees and a floating-point number for minutes. Also, the hemisphere is recorded for both latitude (N or S) and longitude (E or W).

Attributes

latdir : Longitude hemisphere. ("N" or "S")
latdeg : Longitude degrees.
latmin : Longitude minutes.
lngdir : Longitude hemisphere. ("E" or "W")
lngdeg : Longitude degrees.
lngmin : Longitude minutes.

Methods

new UTMConv.DegMinCoords(latdir, latdeg, latmin, lngdir, lngdeg, lngmin, datum)

Constructor. If datum is unspecified, default to "wgs84".

DegMinCoords.to_utm(utmz)

Convert coordinates to UTM. Returns a UTMCoords object.

If utmz is specified, use that UTM zone. Otherwise, calculate the UTM zone while doing the conversion.

DegMinCoords.to_deg()

Convert to decimal degree format. Returns a DegCoords object.

DegMinCoords.toString()

Convert to string.