Search Results for

    Show / Hide Table of Contents

    Class NpgsqlNetTopologySuiteDbFunctionsExtensions

    Provides Npgsql-specific spatial extension methods on .

    Inheritance
    object
    NpgsqlNetTopologySuiteDbFunctionsExtensions
    Namespace: Microsoft.EntityFrameworkCore
    Assembly: Npgsql.EntityFrameworkCore.PostgreSQL.NetTopologySuite.dll
    Syntax
    public static class NpgsqlNetTopologySuiteDbFunctionsExtensions

    Methods

    | Improve this Doc View Source

    Distance(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 instance.

    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

    See https://postgis.net/docs/ST_Distance.html.

    | Improve this Doc View Source

    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 <->.

    Declaration
    public static double DistanceKnn(this DbFunctions _, Geometry geometry, Geometry anotherGeometry)
    Parameters
    Type Name Description
    DbFunctions _

    The instance.

    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

    See https://postgis.net/docs/ST_Distance.html.

    | Improve this Doc View Source

    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)

    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

    See https://postgis.net/docs/ST_Force2D.html.

    | Improve this Doc View Source

    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.

    Declaration
    public static bool IsWithinDistance(this DbFunctions _, Geometry geometry, Geometry anotherGeometry, double distance, bool useSpheroid)
    Parameters
    Type Name Description
    DbFunctions _

    The instance.

    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

    See https://postgis.net/docs/ST_DWithin.html.

    | Improve this Doc View Source

    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).

    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
    Remarks

    See https://postgis.net/docs/ST_Transform.html.

    • Improve this Doc
    • View Source
    In This Article
    Back to top © Copyright 2023 The Npgsql Development Team