Spatial Functions

Page edited by Steven Hawkins


Changes (8)

Spatial functions provide functionality for working with [geospatial|http://www.opengeospatial.org/] data. Teiid relies on the [JTS Topology Suite|http://www.vividsolutions.com/jts/JTSHome.htm] to provide partial support for the OpenGIS Simple Features Specification For SQL Revision 1.1. Please refer to the [specification|https://portal.opengeospatial.org/files/?artifact_id=829] for more details about particular functions.

h1. Conversion Functions
...
h2. ST_CONTAINS

Returns true if geom1 contains geom2 contains another.

{code:SQL}ST_CONTAINS(geom1, geom2){code}

geom1, geom2 are geometries. Return value is a boolean.

h2. ST_CROSSES

Returns true if the geometries cross.

{code:SQL}ST_CROSSES(geom1, geom2){code}

geom1, geom2 are geometries. Return value is a boolean.

h2. ST_DISJOINT

Returns true if the geometries are disjoint.

{code:SQL}ST_DISJOINT(geom1, geom2){code}

geom1, geom2 are geometries. Return value is a boolean.

h2. ST_DISTANCE

Returns the distance between two geometries.

{code:SQL}ST_DISTANCE(geom1, geom2){code}

geom1, geom2 are geometries. Return value is a double.

h2. ST_INTERSECTS

Returns true if the geometries intersect.

{code:SQL}ST_INTERSECT(geom1, geom2){code}

geom1, geom2 are geometries. Return value is a boolean.

h2. ST_OVERLAPS

Returns true if the geometries overlap.

{code:SQL}ST_OVERLAPS(geom1, geom2){code}

geom1, geom2 are geometries. Return value is a boolean.

h2. ST_TOUCHES

Returns true if the geometries touch.

{code:SQL}ST_TOUCHES(geom1, geom2){code}

geom1, geom2 are geometries. Return value is a boolean.

h1. Misc. Functions

...

Full Content

Spatial functions provide functionality for working with geospatial data. Teiid relies on the JTS Topology Suite to provide partial support for the OpenGIS Simple Features Specification For SQL Revision 1.1. Please refer to the specification for more details about particular functions.

Conversion Functions

ST_GeomFromText

Returns a geometry from a Clob in WKT format.

ST_GeomFromText(text)

text is a clob. Return value is a geometry.

ST_GeomFromWKB/ST_GeomFromBinary

Returns a geometry from a blob in WKB format.

ST_GeomFromWKB(bin)

bin is a blob. Return value is a geometry.

ST_AsText

ST_GeomAsText(geom)

geom is a geometry. Return value is clob.

ST_AsBinary

ST_GeomAsBinary(geom)

geom is a geometry. Return value is a blob.

Relationship Functions

ST_CONTAINS

Returns true if geom1 contains geom2 contains another.

ST_CONTAINS(geom1, geom2)

geom1, geom2 are geometries. Return value is a boolean.

ST_CROSSES

Returns true if the geometries cross.

ST_CROSSES(geom1, geom2)

geom1, geom2 are geometries. Return value is a boolean.

ST_DISJOINT

Returns true if the geometries are disjoint.

ST_DISJOINT(geom1, geom2)

geom1, geom2 are geometries. Return value is a boolean.

ST_DISTANCE

Returns the distance between two geometries.

ST_DISTANCE(geom1, geom2)

geom1, geom2 are geometries. Return value is a double.

ST_INTERSECTS

Returns true if the geometries intersect.

ST_INTERSECT(geom1, geom2)

geom1, geom2 are geometries. Return value is a boolean.

ST_OVERLAPS

Returns true if the geometries overlap.

ST_OVERLAPS(geom1, geom2)

geom1, geom2 are geometries. Return value is a boolean.

ST_TOUCHES

Returns true if the geometries touch.

ST_TOUCHES(geom1, geom2)

geom1, geom2 are geometries. Return value is a boolean.

Misc. Functions

ST_SRID

Returns the SRID for the geometry.

ST_SRID(geom)

geom is a geometry. Return value is an integer. A 0 value rather than null will be returned for an unknown SRID on a non-null geometry.

ST_SetSRID

Set the SRID for the given geometry.

ST_SetSRID(geom, srid)

geom is a geometry. srid is an integer. Return value is a geometry. Only the SRID metadata of the geometry is modified.

Stop watching space | Change email notification preferences
View Online | View Changes | Add Comment