Class SpatialPointOnSurface
- Namespace
- YndigoBlue.Velocity.Functions
- Assembly
- YndigoBlue.Velocity.dll
Represents the ST_PointOnSurface spatial analysis function that returns a point guaranteed to be on the geometry's surface.
public class SpatialPointOnSurface : Function, IElement, ICheckItem, IDefaultItem, IFilterItem
- Inheritance
-
SpatialPointOnSurface
- Implements
Remarks
Warning
Spatial functions are not available in the Community Edition of Velocity. They require the Full Edition.
The ST_PointOnSurface function returns a point that is guaranteed to lie on the surface (interior or boundary) of the input geometry. Unlike ST_Centroid, which may fall outside the geometry, this function always returns a point within or on the geometry itself. For polygons, returns a point inside the polygon. For lines, returns a point on the line. For points, returns the point itself. Useful for label placement, guaranteed interior point sampling, or ensuring points lie within boundaries. OGC-compliant.
Return Type: Point geometry on the surface of the input.
Key Difference from ST_Centroid: ST_Centroid returns the geometric center which may fall outside concave shapes or polygons with holes. ST_PointOnSurface is always guaranteed to be on or inside the geometry.
| Input Geometry Type | ST_PointOnSurface Result |
|---|---|
| Point | Returns the point itself |
| LineString | A point on the line (often midpoint) |
| Polygon | A point inside the polygon interior |
| Polygon with hole | A point in the solid area (not the hole) |
| C-shaped polygon | A point in the solid area (not the concave gap) |
Constructors
- SpatialPointOnSurface(Geometry)
Initializes a new instance of ST_PointOnSurface with a geometry literal.
- SpatialPointOnSurface(Column)
Initializes a new instance of ST_PointOnSurface with a spatial column.
- SpatialPointOnSurface(Function)
Initializes a new instance of ST_PointOnSurface for a function result.
- SpatialPointOnSurface(Geography)
Initializes a new instance of ST_PointOnSurface with a geography literal.