Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.1 » SQL Anywhere Server - Spatial Data Support » Using spatial data » Introduction to spatial data » SQL Anywhere support for spatial data » Supported spatial data types and their hierarchy


Supported spatial predicates

A predicate is a conditional expression that, combined with the logical operators AND and OR, makes up the set of conditions in a WHERE, HAVING, or ON clause, or in an IF or CASE expression, or in a CHECK constraint. In SQL, a predicate may evaluate to TRUE, FALSE. In many contexts, a predicate that evaluates to UNKNOWN is interpreted as FALSE.

Spatial predicates are implemented as member functions that return 0 or 1. In order to test a spatial predicate, your query should compare the result of the function to 1 or 0 using the = or <> operator. For example:

SELECT * FROM SpatialShapes WHERE geometry.ST_IsEmpty() = 0;

You use predicates when querying spatial data to answer such questions as: how close together are two or more geometries? Do they intersect or overlap? Is one geometry contained within another? If you are a delivery company, for example, you may use predicates to determine if a customer is within a specific delivery area.

SQL Anywhere supports the following spatial predicates to help answer questions about the spatial relationship between geometries:

Intuitiveness of spatial predicates