ST Class
Overview
The ST static class provide a common set of spatial operations that can be used consistently in both SQLite and C#. Rather than maintaining separate implementations for application code and database queries, developers can work with a familiar set of spatial concepts across both environments.
This unified model makes it easier to move spatial logic between application code and the database. Operations such as creating geometries, calculating distances, testing spatial relationships, and performing geometric transformations can be expressed using the same conceptual API, whether they are executed in-memory through C# or within SQLite queries.
C# Namespace
Constructors
| Name | Description |
|---|---|
| ST_Point | Creates a point geometry |
| ST_GeomFromText | Creates a geometry using WKT definition |
Methods
| Name | Description |
|---|---|
| ST_Area | Calculates the area of a polygon geometry. |
| ST_AsText | Returns the WKT representation of the geometry. |
| ST_X | Extracts the X-coordinate of the centroid of a geometry. |
| ST_XMax | Returns the Y maximum of a bounding box or a geometry. |
| ST_XMin | Returns the X minimum of a bounding box or a geometry. |
| ST_Y | Extracts the Y-coordinate of the centroid of a geometry. |
| ST_YMax | Returns the Y maximum of a bounding box or a geometry. |
| ST_YMin | Returns the Y minimum of a bounding box or a geometry. |
ST_Area
Calculates the area of a polygon geometry provided in EWKB format. If the input is null or invalid, the method returns null. The area is computed assuming planar geometry and is expressed in the same units as the coordinate system of the input.
ST_AsText
Returns the OGC Well-Known Text (WKT) representation of the geometry.
ST_GeomFromText
Constructs a geometry object from the OGC Well-Known text representation.
ST_Point
Returns a Point with the given X and Y coordinate values.
ST_X
Extracts the X-coordinate of the centroid (geometric center) of a geometry provided in EWKB format. The centroid represents the average position of all points in the geometry and is useful for labeling, spatial indexing, and geometric analysis.
ST_XMax
Returns the X maximum of a bounding box or a geometry.
ST_XMin
Returns the X minimum of a bounding box or a geometry.
ST_Y
Extracts the Y-coordinate of the centroid (geometric center) of a geometry provided in EWKB format. The centroid represents the average position of all points in the geometry and is useful for labeling, spatial indexing, and geometric analysis.
ST_YMax
Returns the Y maximum of a bounding box or a geometry.
real ST_YMax(blob ewkb)
ST_YMin
Returns the Y minimum of a bounding box or a geometry.