The following are the built-in functions for coordinates conversions between the Mireo World-Point coordinate system and the WGS 84 coordinate system.
They are divided into two sections:
TO_METERS
, TO_WORLD
.TO_LAT
, TO_LON
, TO_WPX
, TO_WPY
.TO_METERS(world_dist: f64, lat: f64) -> f64
Converts a distance in Mireo World-Point coordinate units to meters.
Null handling
If any of the arguments is NULL
, the function will also return NULL
.
Notes
The lat
argument (approximate geographic latitude at which the conversion is done) is required because the conversion factor varies with the geographic latitute (a property of Mercator's projection).
Examples
SELECT TO_METERS(100, 45);
--> 10.539695
See also
TO_WORLD(meter_dist: f64, lat: f64) -> f64
Converts a distance in meters to Mireo World-Point coordinate units.
Null handling
If any of the arguments is NULL
, the function will also return NULL
.
Notes
The lat
argument (approximate geographic latitude at which the conversion is done) is required because the conversion factor varies with the geographic latitute (a property of Mercator's projection).
Examples
SELECT TO_WORLD(100, 45);
--> 948.794058
See also
TO_LAT(wpy: float64) -> float64
Converts a Mireo World-Point y-coordinate value to WGS 84 latitude.
Null handling
If the argument is NULL
, the function will also return NULL
.
Examples
SELECT TO_LAT(38205632);
--> 45.52
See also
TO_LON(wpx: float64) -> float64
Converts a Mireo World-Point x-coordinate value to WGS 84 longitude.
Null handling
If the argument is NULL
, the function will also return NULL
.
Examples
SELECT TO_LON(11915552);
--> 15.98
See also
TO_WPX(lon: float64) -> float64
Converts a WGS 84 longitude value to Mireo World-Point x-coordinate.
Null handling
If the argument is NULL
, the function will also return NULL
.
Examples
SELECT TO_WPX(15.98);
--> 11915551.63
See also
TO_WPY(lat: float64) -> float64
Converts a WGS 84 latitude value to Mireo World-Point y-coordinate.
Null handling
If the argument is NULL
, the function will also return NULL
.
Examples
SELECT TO_WPY(45.52);
--> 38205632.09
See also