Contact us

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:

  • Unit Conversions - Functions for conversion between meters and Mireo World-Point coordinate units: TO_METERS, TO_WORLD.
  • Coordinate Conversions - Functions for conversion between Mireo WPT and WGS 84 coordinates: TO_LAT, TO_LON, TO_WPX, TO_WPY.

Unit Conversions


fn TO_METERS
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

fn TO_WORLD
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

Coordinate Conversions


fn TO_LAT
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

fn TO_LON
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

fn TO_WPX
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

fn TO_WPY
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