Class NpgsqlNetTopologySuiteDbFunctionsExtensions
- Namespace
- Microsoft.EntityFrameworkCore
- Assembly
- Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite.dll
Provides Npgsql-specific spatial extension methods on DbFunctions.
public static class NpgsqlNetTopologySuiteDbFunctionsExtensions
- Inheritance
-
NpgsqlNetTopologySuiteDbFunctionsExtensions
- Inherited Members
Methods
Distance(DbFunctions, Geometry, Geometry, bool)
Returns the minimum distance between the origin geometry and another geometry g.
Translates to ST_Distance.
public static double Distance(this DbFunctions _, Geometry geometry, Geometry anotherGeometry, bool useSpheroid)
Parameters
_DbFunctionsThe DbFunctions instance.
geometryGeometryThe origin geometry.
anotherGeometryGeometryThe geometry from which to compute the distance.
useSpheroidboolWhether to use sphere or spheroid distance measurement.
Returns
- double
The distance between the geometries.
Remarks
DistanceKnn(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 <->.
public static double DistanceKnn(this DbFunctions _, Geometry geometry, Geometry anotherGeometry)
Parameters
_DbFunctionsThe DbFunctions instance.
geometryGeometryThe origin geometry.
anotherGeometryGeometryThe geometry from which to compute the distance.
Returns
- double
The 2D distance between the geometries.
Remarks
Force2D<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)
public static TGeometry Force2D<TGeometry>(this DbFunctions _, TGeometry geometry) where TGeometry : Geometry
Parameters
_DbFunctionsgeometryTGeometry
Returns
- TGeometry
Type Parameters
TGeometry
Remarks
IsWithinDistance(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.
public static bool IsWithinDistance(this DbFunctions _, Geometry geometry, Geometry anotherGeometry, double distance, bool useSpheroid)
Parameters
_DbFunctionsThe DbFunctions instance.
geometryGeometryThe origin geometry.
anotherGeometryGeometryThe geometry to check the distance to.
distancedoubleThe distance value to compare.
useSpheroidboolWhether to use sphere or spheroid distance measurement.
Returns
Remarks
Transform<TGeometry>(DbFunctions, TGeometry, int)
Returns a new geometry with its coordinates transformed to a different spatial reference system.
Translates to ST_Transform(geometry, srid).
public static TGeometry Transform<TGeometry>(this DbFunctions _, TGeometry geometry, int srid) where TGeometry : Geometry
Parameters
_DbFunctionsgeometryTGeometrysridint
Returns
- TGeometry
Type Parameters
TGeometry