Class SpatialContains
- Namespace
- YndigoBlue.Velocity.Functions
- Assembly
- YndigoBlue.Velocity.dll
Represents the ST_Contains spatial predicate that tests if one geometry completely contains another.
public class SpatialContains : Function, IElement, ICheckItem, IDefaultItem, IFilterItem
- Inheritance
-
SpatialContains
- Implements
Remarks
Warning
Spatial functions are not available in the Community Edition of Velocity. They require the Full Edition.
The ST_Contains function returns true if geometry A completely contains geometry B (B is completely inside A with no points on the boundary or exterior of A). This is the inverse of ST_Within. Useful for point-in-polygon tests, containment queries, and spatial indexing. For Geography types, operates on spherical earth model. OGC-compliant.
Return Type: Boolean (true/false).
Containment Rules:
| Relationship | ST_Contains Result |
|---|---|
| B completely inside A | TRUE |
| B touches A's boundary | FALSE |
| B partially overlaps A | FALSE |
| B completely outside A | FALSE |
Example Results: ST_Contains(PY0, X)
| Shape X | Result |
|---|---|
| PY1 (inside PY0) | TRUE - completely contained |
| PY2 (outside PY0) | FALSE - no overlap |
| PY3 (touches PY0) | FALSE - shares boundary |
| PY4 (intersects PY0) | FALSE - partial overlap |
| PT1 (inside PY0) | TRUE - point within polygon |
| PT2 (outside PY0) | FALSE - point outside |
| LN1 (inside PY0) | TRUE - line completely inside |
Constructors
- SpatialContains(Geometry, Column)
Initializes a new instance of ST_Contains with a Geometry literal and column.
- SpatialContains(Geometry, Function)
Initializes a new instance of ST_Contains with a Geometry literal and function result for function chaining.
- SpatialContains(Column, Geometry)
Initializes a new instance of ST_Contains with a column and Geometry literal.
- SpatialContains(Column, Column)
Initializes a new instance of ST_Contains with two columns for spatial joins.
- SpatialContains(Column, Function)
Initializes a new instance of ST_Contains with a column and function result for function chaining.
- SpatialContains(Column, Geography)
Initializes a new instance of ST_Contains with a column and Geography literal.
- SpatialContains(Function, Geometry)
Initializes a new instance of ST_Contains with a function result and Geometry literal for function chaining.
- SpatialContains(Function, Column)
Initializes a new instance of ST_Contains with a function result and column for function chaining.
- SpatialContains(Function, Function)
Initializes a new instance of ST_Contains with two function results for function chaining.
- SpatialContains(Function, Geography)
Initializes a new instance of ST_Contains with a function result and Geography literal for function chaining.
- SpatialContains(Geography, Column)
Initializes a new instance of ST_Contains with a Geography literal and column.
- SpatialContains(Geography, Function)
Initializes a new instance of ST_Contains with a Geography literal and function result for function chaining.