Class PointLocator
- Namespace
- NetTopologySuite.Algorithm
- Assembly
- NetTopologySuite.dll
Computes the topological relationship (Location) of a single point to a Geometry.
public class PointLocator
- Inheritance
-
PointLocator
- Inherited Members
Remarks
A IBoundaryNodeRule may be specified to control the evaluation of whether the point lies on the boundary or not The default rule is to use the SFS Boundary Determination Rule
Notes:
Instances of this class are not reentrant.
Constructors
PointLocator()
Initializes a new instance of the PointLocator class.
The default boundary rule is EndpointBoundaryRule.public PointLocator()
PointLocator(IBoundaryNodeRule)
Initializes a new instance of the PointLocator class using the provided
boundaryRule
.
public PointLocator(IBoundaryNodeRule boundaryRule)
Parameters
boundaryRule
IBoundaryNodeRuleThe boundary rule to use.
Methods
Intersects(Coordinate, Geometry)
Convenience method to test a point for intersection with a Geometry
public bool Intersects(Coordinate p, Geometry geom)
Parameters
p
CoordinateThe coordinate to test.
geom
GeometryThe Geometry to test.
Returns
- bool
true
if the point is in the interior or boundary of the Geometry.
Locate(Coordinate, Geometry)
Computes the topological relationship ({Location}) of a single point to a Geometry. It handles both single-element and multi-element Geometries. The algorithm for multi-part Geometries takes into account the boundaryDetermination rule.
public Location Locate(Coordinate p, Geometry geom)
Parameters
p
Coordinategeom
Geometry
Returns
- Location
The Location of the point relative to the input Geometry.