GEOPOINT

Pair of float numbers representing geographical longitude and latitude coordinates.

LITERAL NOTATION: A string with two comma-separated float numerics in decimal notation.

'59.398401, 24.656800'

Geographical coordinates can be converted to GEOPOINT data object using GEO() function and then used further by other geospatial functions.

Converting to GEOPOINT

1
2
3
GEOPOINT(ip_expr)
GEOPOINT(longitude, latitude)
GEOPOINT(string_expr)
  1. converts IP-address/socket/net to geopoint by looking up its geolocation in the Maxmind database
  2. converts numerical geographical coordinates to geopoint
  3. converts string geographical coordinates (comma-separated numbers) to GEOPOINT

GEOPOINT functions

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
a=GEOPOINT(3.3d, 3.3d)
b=GEOPOINT(5.3d, 5.3d)
area=[[GEO(3.3, 3.2), GEO(3.4, 3.5), GEO(3.2, 3.4)]]

a > b                   // => FALSE
a = b                   // => FALSE
a < b                   // => TRUE
DISTANCE(a, b)          // => 314.0563187947706
BEARING(a, b)           // => 44.84861220936057
GEO_POINT_IN(a, area)   // => TRUE
GEO_ROUND(a, 100)       // => GEOPOINT(3.0797882,3.276657)
LATITUDE(a)             // => 3.3
LONGITUDE(a)            // => 3.3