Class Geography.Position

Inheritance graph
Geography.Position Geography.PositionRT38
Description

This class contains a geographical position, ie a point on the earths surface. The resulting position object implements comparision methods (__hash, `==, `< and `>) so that you can compare and sort positions as well as using them as index in mappings. Comparision is made primary on latidue and secondly on longitude. It does not currently take the ellipsoid into account.

It is possible to cast a position into an array, which will yield ({ float latitude, float longitude }), as well as into a string.


Constant ellipsoids

constant Geography.Position.ellipsoids

Description

A mapping with reference ellipsoids, which can be fed to the UTM converter. The mapping maps the name of the ellipsoid to an array where the first element is a float describing the equatorial radius and the second element is a float describing the polar radius.


Variable alt

float Geography.Position.alt

Description

Altitud of the position, in meters. Positive numbers is up. Zero is the shell of the current ellipsoid.


Variable equatorial_radius

float Geography.Position.equatorial_radius

Description

The equatorial radius is how many meters the earth radius is at the equator (east-west direction).


Variable lat

float Geography.Position.lat

Description

Latitude (N--S) of the position, in degrees. Positive number is north, negative number is south.


Variable long

float Geography.Position.long

Description

Longitude (W--E) of the position, in degrees. Positive number is east, negative number is west.


Variable polar_radius

float Geography.Position.polar_radius

Description

The polar radius is how many meters the earth radius is at the poles (north-south direction).


Method create

Geography.Position Geography.Position(int|float lat, int|float long, void|int|float alt)
Geography.Position Geography.Position(string lat, string long)
Geography.Position Geography.Position(string position)
Geography.Position Geography.Position()

Description

Constructor for this class. If fed with strings, it will perform a dwim scan on the strings. If they fails to be understood, there will be an exception.