Functions on GeoJson Data

The GeoJson specification defines the structure and content of JSON objects that represent geographical shapes on earth (called geometries).

The following functions interpret the JSON objects as geometries and allow the search for rows containing geometries that satisfy certain conditions like intersection, proximity, containment etc.

Table 12-4 Functions on GeoJson Data

Function Name Description
geo_intersect (any*, any*) Returns TRUE if the two geometries share any points in common.
geo_inside (any*. any*) Returns TRUE if the first geometry is entirely contained within the second geometry.
geo_within_distance (any*, any*, double distance) Returns TRUE if the distance between the two geometries is less than or equal to the specified distance in meters.
geo_near (any*, any*, double distance) Filters rows where the distance between the two geometries is less than or equal to the provided distance. It also implicitly orders the resultant rows by distance.
geo_distance (any*, any*) Returns the minimum distance in meters between the two geometries as a numeric value.
geo_is_geometry(any*) Returns TRUE if the expression evaluates to a valid GeoJson geometry object.
For more information on the functions and examples, see Functions on GeoJson Data and Managing GeoJSON data.