Class NpgsqlNetTopologySuiteDbFunctionsExtensions
Provides Npgsql-specific spatial extension methods on
Inheritance
Namespace: Microsoft.EntityFrameworkCore
Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite.dll
Syntax
public static class NpgsqlNetTopologySuiteDbFunctionsExtensions
Methods
| Improve this Doc View SourceDistance(DbFunctions, Geometry, Geometry, bool)
Returns the minimum distance between the origin geometry and another geometry g.
Translates to ST_Distance
.
Declaration
public static double Distance(this DbFunctions _, Geometry geometry, Geometry anotherGeometry, bool useSpheroid)
Parameters
Type | Name | Description |
---|---|---|
DbFunctions | _ | The |
Geometry | geometry | The origin geometry. |
Geometry | anotherGeometry | The geometry from which to compute the distance. |
bool | useSpheroid | Whether to use sphere or spheroid distance measurement. |
Returns
Type | Description |
---|---|
double | The distance between the geometries. |
Remarks
| Improve this Doc View SourceDistanceKnn(DbFunctions, Geometry, Geometry)
Returns the 2D distance between two geometries. Used in the "ORDER BY" clause, provides index-assisted nearest-neighbor result
sets. Translates to <->
.
Declaration
public static double DistanceKnn(this DbFunctions _, Geometry geometry, Geometry anotherGeometry)
Parameters
Type | Name | Description |
---|---|---|
DbFunctions | _ | The |
Geometry | geometry | The origin geometry. |
Geometry | anotherGeometry | The geometry from which to compute the distance. |
Returns
Type | Description |
---|---|
double | The 2D distance between the geometries. |
Remarks
| Improve this Doc View SourceForce2D<TGeometry>(DbFunctions, TGeometry)
Forces the geometries into a "2-dimensional mode" so that all output representations will only have the X and Y coordinates.
Translates to ST_Force2D(geometry)
Declaration
public static TGeometry Force2D<TGeometry>(this DbFunctions _, TGeometry geometry) where TGeometry : Geometry
Parameters
Type | Name | Description |
---|---|---|
DbFunctions | _ | |
TGeometry | geometry |
Returns
Type | Description |
---|---|
TGeometry |
Type Parameters
Name | Description |
---|---|
TGeometry |
Remarks
| Improve this Doc View SourceIsWithinDistance(DbFunctions, Geometry, Geometry, double, bool)
Tests whether the distance from the origin geometry to another is less than or equal to a specified value.
Translates to ST_DWithin
.
Declaration
public static bool IsWithinDistance(this DbFunctions _, Geometry geometry, Geometry anotherGeometry, double distance, bool useSpheroid)
Parameters
Type | Name | Description |
---|---|---|
DbFunctions | _ | The |
Geometry | geometry | The origin geometry. |
Geometry | anotherGeometry | The geometry to check the distance to. |
double | distance | The distance value to compare. |
bool | useSpheroid | Whether to use sphere or spheroid distance measurement. |
Returns
Type | Description |
---|---|
bool | true if the geometries are less than distance apart. |
Remarks
| Improve this Doc View SourceTransform<TGeometry>(DbFunctions, TGeometry, int)
Returns a new geometry with its coordinates transformed to a different spatial reference system.
Translates to ST_Transform(geometry, srid)
.
Declaration
public static TGeometry Transform<TGeometry>(this DbFunctions _, TGeometry geometry, int srid) where TGeometry : Geometry
Parameters
Type | Name | Description |
---|---|---|
DbFunctions | _ | |
TGeometry | geometry | |
int | srid |
Returns
Type | Description |
---|---|
TGeometry |
Type Parameters
Name | Description |
---|---|
TGeometry |