Class Distance3DOp
Find two points on two 3D Geometrys which lie within a given distance, or else are the nearest points on the geometries (in which case this also provides the distance between the geometries).
3D geometries have vertex Z ordinates defined. 3D Polygons are assumed to lie in a single plane (which is enforced if not actually the case). 3D LineStrings and Points may have any configuration.
The distance computation also finds a pair of points in the input geometries which have the minimum distance between them. If a point lies in the interior of a line segment, the coordinate computed is a close approximation to the exact point.
The algorithms used are straightforward O(n^2) comparisons. This worst-case performance could be improved on by using Voronoi techniques or spatial indexes.
Inherited Members
Namespace: NetTopologySuite.Operation.Distance3D
Assembly: NetTopologySuite.dll
Syntax
public class Distance3DOp
Constructors
| Improve this Doc View SourceDistance3DOp(Geometry, Geometry)
Constructs a DistanceOp that computes the distance and nearest points between the two specified geometries.
Declaration
public Distance3DOp(Geometry g0, Geometry g1)
Parameters
Type | Name | Description |
---|---|---|
Geometry | g0 | A geometry |
Geometry | g1 | A geometry |
Distance3DOp(Geometry, Geometry, Double)
Constructs a DistanceOp that computes the distance and nearest points between the two specified geometries.
Declaration
public Distance3DOp(Geometry g0, Geometry g1, double terminateDistance)
Parameters
Type | Name | Description |
---|---|---|
Geometry | g0 | A geometry |
Geometry | g1 | A geometry |
Double | terminateDistance | The distance on which to terminate the search |
Methods
| Improve this Doc View SourceDistance()
Report the distance between the nearest points on the input geometries.
Declaration
public double Distance()
Returns
Type | Description |
---|---|
Double | The distance between the geometries |
Exceptions
Type | Condition |
---|---|
ArgumentException | Thrown if either input geometry is null. |
Distance(Geometry, Geometry)
Compute the distance between the nearest points of two geometries.
Declaration
public static double Distance(Geometry g0, Geometry g1)
Parameters
Type | Name | Description |
---|---|---|
Geometry | g0 | A geometry |
Geometry | g1 | A geometry |
Returns
Type | Description |
---|---|
Double | The distance between the geometries |
IsWithinDistance(Geometry, Geometry, Double)
Test whether two geometries lie within a given distance of each other.
Declaration
public static bool IsWithinDistance(Geometry g0, Geometry g1, double distance)
Parameters
Type | Name | Description |
---|---|---|
Geometry | g0 | A geometry |
Geometry | g1 | A geometry |
Double | distance | The distance to test |
Returns
Type | Description |
---|---|
Boolean |
|
NearestLocations()
Gets the locations of the nearest points in the input geometries. The locations are presented in the same order as the input Geometries.
Declaration
public GeometryLocation[] NearestLocations()
Returns
Type | Description |
---|---|
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.
Declaration
public Coordinate[] NearestPoints()
Returns
Type | Description |
---|---|
Coordinate[] | A pair of Coordinates of the nearest points |
NearestPoints(Geometry, Geometry)
Compute the the nearest points of two geometries. The points are presented in the same order as the input Geometries.
Declaration
public static Coordinate[] NearestPoints(Geometry g0, Geometry g1)
Parameters
Type | Name | Description |
---|---|---|
Geometry | g0 | A geometry |
Geometry | g1 | A geometry |
Returns
Type | Description |
---|---|
Coordinate[] | The nearest points in the geometries |