Class DistanceOp
- Namespace
- NetTopologySuite.Operation.Distance
- Assembly
- NetTopologySuite.dll
Computes the distance and
closest points between two Geometry
s.
The distance computation finds a pair of points in the input geometries
which have minimum distance between them. These points may
not be vertices of the geometries, but may lie in the interior of
a line segment. In this case the coordinate computed is a close
approximation to the exact point.
public class DistanceOp
- Inheritance
-
DistanceOp
- Inherited Members
Constructors
DistanceOp(Geometry, Geometry)
Constructs a DistanceOp that computes the distance and closest points between the two specified geometries.
public DistanceOp(Geometry g0, Geometry g1)
Parameters
DistanceOp(Geometry, Geometry, double)
Constructs a DistanceOp that computes the distance and closest points between the two specified geometries.
public DistanceOp(Geometry g0, Geometry g1, double terminateDistance)
Parameters
g0
GeometryA geometry
g1
GeometryA geometry
terminateDistance
doubleThe distance on which to terminate the search.
Methods
Distance()
Report the distance between the closest points on the input geometries.
public double Distance()
Returns
- double
The distance between the geometries
or0
if either input geometry is empty.
Exceptions
- ApplicationException
if either input geometry is null
Distance(Geometry, Geometry)
Compute the distance between the closest points of two geometries.
public static double Distance(Geometry g0, Geometry g1)
Parameters
Returns
- double
The distance between the geometries.
IsWithinDistance(Geometry, Geometry, double)
Test whether two geometries lie within a given distance of each other.
public static bool IsWithinDistance(Geometry g0, Geometry g1, double distance)
Parameters
Returns
NearestLocations()
Report the locations of the nearest points in the input geometries. The locations are presented in the same order as the input Geometries.
public GeometryLocation[] NearestLocations()
Returns
- GeometryLocation[]
A pair of GeometryLocations for the nearest points.
NearestPoints()
Report the coordinates of the nearest points in the input geometries. The points are presented in the same order as the input Geometries.
public Coordinate[] NearestPoints()
Returns
- Coordinate[]
A pair of
Coordinate
s of the nearest points.
NearestPoints(Geometry, Geometry)
Compute the the closest points of two geometries. The points are presented in the same order as the input Geometries.
public static Coordinate[] NearestPoints(Geometry g0, Geometry g1)
Parameters
Returns
- Coordinate[]
The closest points in the geometries.