Functions on GeoJson Data

The GeoJson specification defines the structure and content of JSON objects that are supposed to 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.

For more information on the functions and examples, see Managing GeoJSON data in the Developers Guide.

geo_intersect function

Syntax

boolean geo_intersect(any*, any*)

Semantics

Raises an error if it can be detected at compile time that an operand will not return a single valid geometry object. Otherwise, the runtime behavior is as follows:

geo_inside function

Syntax

boolean geo_inside(any*, any*)

Semantics

Raises an error if it can be detected at compile time that an operand will not return a single valid geometry object. Otherwise, the runtime behavior is as follows:

geo_within_distance function

Syntax

boolean geo_within_distance(any*, any*, double)

Semantics

Raises an error if it can be detected at compile time that any of the first two operands will not return a single valid geometry object. Otherwise, the runtime behavior is as follows:

geo_near function

Syntax

boolean geo_near(any*, any*, double)

Semantics

geo_near is converted internally to geo_within_distance plus an (implicit) order-by the distance between the two geometries. However, if the query has an (explicit) order-by already, no ordering by distance is performed. The geo_near function can appear in the WHERE clause only, where it must be a top-level predicate, i.e, not nested under an OR or NOT operator.

geo_distance function

Syntax

double geo_distance(any*, any*)

Semantics

Raises an error if it can be detected at compile time that an operand will not return a single valid geometry object. Otherwise, the runtime behavior is as follows:

geo_is_geometry function

Syntax

boolean geo_is_geometry(any*)

Semantics