Class GeometryItemDistance

Hierarchy: Object , GeometryItemDistance
All Implemented Interfaces: ItemDistance
public class GeometryItemDistance
implements ItemDistance
An ItemDistance function for items which are Geometrys, 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.

Authors:
Martin Davis
public double distance(ItemBoundable item1, ItemBoundable item2)
Computes the distance between two Geometry items, using the Geometry.distance(Geometry) method.
Parameters:
item1 - item1 an item which is a Geometry
item2 - item2 an item which is a Geometry
Returns:
the distance between the geometries
Throws:
ClassCastException - ClassCastException if either item is not a Geometry