// Distance query using a RegionQuery and a buffer around the query- object
Cursor distanceQuery1 = new RegionQuery(index, queryObject.buffer( distance ), loadGeometry);
// Distance query using a WhileTaker and a NearestNeighbourQuery
Cursor distanceQuery2 =
new WhileTaker(
new NearestNeighbourQuery( index, queryObject,
distDescToGeo, distGeoToGeo,
loadGeometry),
new DistanceWithin( distance, 2)
);