public class GeometryItemDistance extends Object implements ItemDistance
ItemDistance
function for
items which are Geometry
s,
using the Geometry.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 Double.MAX_VALUE
.
Constructor and Description |
---|
GeometryItemDistance() |
Modifier and Type | Method and Description |
---|---|
double |
distance(ItemBoundable item1,
ItemBoundable item2)
Computes the distance between two
Geometry items,
using the Geometry.distance(Geometry) method. |
public double distance(ItemBoundable item1, ItemBoundable item2)
Geometry
items,
using the Geometry.distance(Geometry)
method.distance
in interface ItemDistance
item1
- an item which is a Geometryitem2
- an item which is a GeometryClassCastException
- if either item is not a GeometryCopyright © 2020. All rights reserved.