Class SpatialEnvelope
- Namespace
- YndigoBlue.Velocity.Functions
- Assembly
- YndigoBlue.Velocity.dll
Represents the ST_Envelope spatial analysis function that returns the bounding rectangle of a geometry.
public class SpatialEnvelope : Function, IElement, ICheckItem, IDefaultItem, IFilterItem
- Inheritance
-
SpatialEnvelope
- Implements
Remarks
Warning
Spatial functions are not available in the Community Edition of Velocity. They require the Full Edition.
The ST_Envelope function returns a geometry representing the minimum bounding rectangle (MBR) of the input spatial object. The envelope is always axis-aligned (parallel to coordinate system axes) and is returned as a polygon (or point/line for degenerate cases). This is the same as the bounding box. Useful for quick spatial indexing, extent calculations, or initial filtering in spatial queries. OGC-compliant.
Return Types by Input:
| Input Type | Envelope Result |
|---|---|
| POINT | POINT (same as input) |
| Vertical/horizontal LINE | LINESTRING (degenerate) |
| Diagonal LINESTRING | POLYGON (bounding rectangle) |
| Axis-aligned POLYGON | POLYGON (same as input) |
| Rotated/irregular POLYGON | POLYGON (larger bounding rectangle) |
| MULTIPOINT | POLYGON enclosing all points |
Example Results (using test geometries):
| Shape | Envelope |
|---|---|
| PY0 (rectangle) | Same rectangle (already axis-aligned) |
| PY3 (triangle) | Bounding rectangle larger than triangle |
| LN1 (vertical line) | Degenerate line (width = 0) |
| PT1 (point) | Same point (degenerate case) |
| L-shape (concave) | Rectangle enclosing the L |
| MPT1 (multipoint) | Rectangle enclosing all points |
Constructors
- SpatialEnvelope(Geometry)
Initializes a new instance of ST_Envelope with a geometry literal.
- SpatialEnvelope(Column)
Initializes a new instance of ST_Envelope with a spatial column.
- SpatialEnvelope(Function)
Initializes a new instance of ST_Envelope for a function result (e.g., from another spatial operation).
- SpatialEnvelope(Geography)
Initializes a new instance of ST_Envelope with a geography literal.