Search Results for

    Show / Hide Table of Contents

    Class SimplePointInAreaLocator

    Computes the location of points relative to an areal Geometry, using a simple O(n) algorithm.

    The algorithm used reports if a point lies in the interior, exterior, or exactly on the boundary of the Geometry.

    Instance methods are provided to implement the interface IPointOnGeometryLocator. However, they provide no performance advantage over the class methods.

    This algorithm is suitable for use in cases where only a few points will be tested. If many points will be tested, IndexedPointInAreaLocator may provide better performance.

    Inheritance
    object
    SimplePointInAreaLocator
    Implements
    IPointOnGeometryLocator
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: NetTopologySuite.Algorithm.Locate
    Assembly: NetTopologySuite.dll
    Syntax
    public class SimplePointInAreaLocator : IPointOnGeometryLocator
    Remarks

    The algorithm used is only guaranteed to return correct results for points which are not on the boundary of the Geometry.

    Constructors

    | Edit this page View Source

    SimplePointInAreaLocator(Geometry)

    Initializes a new instance of the SimplePointInAreaLocator class, using the provided areal geometry.

    Declaration
    public SimplePointInAreaLocator(Geometry geom)
    Parameters
    Type Name Description
    Geometry geom

    The areal geometry to locate in.

    Methods

    | Edit this page View Source

    ContainsPointInPolygon(Coordinate, Polygon)

    Determines whether a point lies in a Polygon. If the point lies on the polygon boundary it is considered to be inside.

    Declaration
    public static bool ContainsPointInPolygon(Coordinate p, Polygon poly)
    Parameters
    Type Name Description
    Coordinate p

    The point to test

    Polygon poly

    The areal geometry to test

    Returns
    Type Description
    bool

    true if the point lies in the polygon

    | Edit this page View Source

    IsContained(Coordinate, Geometry)

    Determines whether a point is contained in a Geometry, or lies on its boundary. This is a convenience method for

    Location.Exterior != Locate(p, geom)
    Declaration
    public static bool IsContained(Coordinate p, Geometry geom)
    Parameters
    Type Name Description
    Coordinate p

    The point to test.

    Geometry geom

    The geometry to test.

    Returns
    Type Description
    bool

    true if the point lies in or on the geometry.

    | Edit this page View Source

    Locate(Coordinate)

    Determines the Location of a point in an areal Geometry. The return value is one of:

    • Interiorif the point is in the geometry interior
    • Boundaryif the point lies exactly on the boundary
    • Exteriorif the point is outside the geometry
    Declaration
    public Location Locate(Coordinate p)
    Parameters
    Type Name Description
    Coordinate p

    The point to test

    Returns
    Type Description
    Location

    The Location of the point in the geometry.

    | Edit this page View Source

    Locate(Coordinate, Geometry)

    Determines the Location of a point in an areal Geometry. The return value is one of:

    • Interiorif the point is in the geometry interior
    • Boundaryif the point lies exactly on the boundary
    • Exteriorif the point is outside the geometry
    Declaration
    public static Location Locate(Coordinate p, Geometry geom)
    Parameters
    Type Name Description
    Coordinate p

    The point to test

    Geometry geom

    The areal geometry to test

    Returns
    Type Description
    Location

    The Location of the point in the geometry

    Implements

    IPointOnGeometryLocator
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX