Geospatial Single-Table Predicate Syntax | Teradata Vantage - 17.10 - Geospatial Single-Table Predicate Syntax - Advanced SQL Engine - Teradata Database

Teradata Vantageā„¢ - Geospatial Data Types

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1181-171K
Language
English (United States)

Single-Table Predicate

For single-table predicates except distance methods ST_Distance and ST_3DDistance:

SELECT a, b FROM TableName WHERE {
  TableName.GeoCol.SupportedGeoMethod (GeospatialLiteralExpression) = 1 |
  GeospatialLiteralExpression.SupportedGeoMethod (TableName.GeoCol) = 1 |
  TableName.GeoCol IS NULL
}
The expression must be set to evaluate to 1 (true) for the first two forms to qualify as single-table predicates.

Single-Table Distance Predicate

For distance methods ST_Distance and ST_3DDistance:

SELECT a, b FROM TableName WHERE {
  TableName.GeoCol.SupportedGeoDistanceMethod (GeospatialLiteralExpression)
    { < | <= } DistanceLiteral |

  GeospatialLiteralExpression.SupportedGeoDistanceMethod(TableName.GeoCol)
    { < | <= } DistanceLiteral
}

Syntax Elements

TableName
Table containing a geospatial data column.
GeoCol
Geospatial data column defined as one of the ST_GEOMETRY types.
SupportedGeoMethod
One of the geospatial methods listed above, excluding ST_Distance and ST_3DDistance.
SupportedGeoDistanceMethod
Either ST_Distance or ST_3DDistance.
GeospatialLiteralExpression
An arbitrary geospatial literal expression that can be folded (simplified) in to a geospatial literal value.
DistanceLiteral
A floating point value representing a distance.