Previous section To contents Next section

14.22 Geographical.Position

CLASS
Geographical.Position

DESCRIPTION
This class contains a geographical position, ie a point on the earths surface.

variable float lat variable float long Longitude (W--E) and latitude (N--S) of the position, float value in degrees. Positive number is north and east, respectively. Negative number is south and west, respectively.

METHOD
Geographical.Position.cast

SYNTAX
array cast("array")

DESCRIPTION
It is possible to cast the position to an array, ({float lat,float long}).

METHOD
Geographical.Position.create

SYNTAX
void create(float lat, float long)
void create(string lat, string long)
void create(string both)

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

METHOD
Geographical.Position.latitude,
Geographical.Position.longitude

SYNTAX
string latitude(void|int n)
string longitude(void|int n)

DESCRIPTION
Returns the nicely formatted latitude or longitude.
n    format
-    17°42.19'N       42°22.2'W
1    17.703°N         42.37°W
2    17°42.18'N       42°22.2'W
3    17°42'10.4"N     42°22'12"W
-1   17.703           -42.37

METHOD
Geographical.Position.`==,
Geographical.Position.`>,
Geographical.Position.`>`<,
Geographical.Position.`>__hash

SYNTAX
int __hash()
int `==(Position pos)
int `<>(Position pos)
int `>(Position pos)

DESCRIPTION
These exist solely for purpose of detecting equal positions, for instance when used as keys in mappings.

Previous section To contents Next section