Class GeometryItemDistance
- Namespace
- NetTopologySuite.Index.Strtree
- Assembly
- NetTopologySuite.dll
An IItemDistance<T, TItem> function for items which are Geometry using the Distance(Geometry) method.
To make this distance function suitable for using to query a single index tree, the distance metric is anti-reflexive. That is, if the two arguments are the same Geometry object, the distance returned is MaxValue.public class GeometryItemDistance : IItemDistance<Envelope, Geometry>
- Inheritance
-
GeometryItemDistance
- Implements
- Inherited Members
Constructors
GeometryItemDistance()
public GeometryItemDistance()
Methods
Distance(IBoundable<Envelope, Geometry>, IBoundable<Envelope, Geometry>)
Computes the distance between two Geometry items, using the Distance(Geometry) method.
public double Distance(IBoundable<Envelope, Geometry> item1, IBoundable<Envelope, Geometry> item2)
Parameters
item1
IBoundable<Envelope, Geometry>An item which is a geometry.
item2
IBoundable<Envelope, Geometry>An item which is a geometry.
Returns
- double
The distance between the two items.
Exceptions
- InvalidCastException
if either item is not a Geometry