Class GeometryItemDistance
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.
Implements
Inherited Members
Namespace: NetTopologySuite.Index.Strtree
Assembly: NetTopologySuite.dll
Syntax
public class GeometryItemDistance : IItemDistance<Envelope, Geometry>
Methods
| Improve this Doc View SourceDistance(IBoundable<Envelope, Geometry>, IBoundable<Envelope, Geometry>)
Computes the distance between two Geometry items, using the Distance(Geometry) method.
Declaration
public double Distance(IBoundable<Envelope, Geometry> item1, IBoundable<Envelope, Geometry> item2)
Parameters
Type | Name | Description |
---|---|---|
IBoundable<Envelope, Geometry> | item1 | An item which is a geometry. |
IBoundable<Envelope, Geometry> | item2 | An item which is a geometry. |
Returns
Type | Description |
---|---|
Double | The distance between the two items. |
Exceptions
Type | Condition |
---|---|
InvalidCastException | if either item is not a Geometry |