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:
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1|