Table of Contents

Class SpatialWithin

Namespace
YndigoBlue.Velocity.Functions
Assembly
YndigoBlue.Velocity.dll

Represents the ST_Within spatial predicate function that tests if one geometry is completely inside another.

public class SpatialWithin : Function, IElement, ICheckItem, IDefaultItem, IFilterItem
Inheritance
SpatialWithin
Implements

Remarks

Warning

Spatial functions are not available in the Community Edition of Velocity. They require the Full Edition.

The ST_Within function returns true if the first spatial object is completely inside the second object, with no points outside and no boundary points in common. This is the inverse of ST_Contains. According to the DE-9IM model, geometry A is within geometry B if all points of A are in the interior or boundary of B, and the interior of A has no points outside B. Useful for finding features contained within boundaries, like points within polygons or parcels within districts. OGC-compliant.

SpatialWithin diagram showing containment tests

Return Type: Boolean (true/false).

Within Rules:

RelationshipST_Within Result
A completely inside BTRUE
A touches B's boundaryFALSE
A partially overlaps BFALSE
A completely outside BFALSE

Example Results: ST_Within(X, PY0)

Shape XResult
PY1 (inside PY0)TRUE - completely within
PY2 (outside PY0)FALSE - no overlap
PY3 (touches PY0)FALSE - extends outside
PY4 (intersects PY0)FALSE - partially outside
PT1 (inside PY0)TRUE - point within polygon
PT2 (outside PY0)FALSE - point outside
LN1 (inside PY0)TRUE - line completely within

Note: ST_Within(A, B) is equivalent to ST_Contains(B, A).

Constructors

SpatialWithin(Geometry, Column)

Initializes a new instance of ST_Within with a geometry literal and column.

SpatialWithin(Geometry, Function)

Initializes a new instance of ST_Within with a Geometry literal and function result for function chaining.

SpatialWithin(Column, Geometry)

Initializes a new instance of ST_Within with a column and geometry literal.

SpatialWithin(Column, Column)

Initializes a new instance of ST_Within with two columns for spatial joins.

SpatialWithin(Column, Function)

Initializes a new instance of ST_Within with a column and function result for function chaining.

SpatialWithin(Column, Geography)

Initializes a new instance of ST_Within with a column and geography literal.

SpatialWithin(Function, Geometry)

Initializes a new instance of ST_Within with a function result and Geometry literal for function chaining.

SpatialWithin(Function, Column)

Initializes a new instance of ST_Within with a function result and column for function chaining.

SpatialWithin(Function, Function)

Initializes a new instance of ST_Within with two function results for function chaining.

SpatialWithin(Function, Geography)

Initializes a new instance of ST_Within with a function result and Geography literal for function chaining.

SpatialWithin(Geography, Column)

Initializes a new instance of ST_Within with a geography literal and column.

SpatialWithin(Geography, Function)

Initializes a new instance of ST_Within with a Geography literal and function result for function chaining.