spatialhadoop2
spatialhadoop2 copied to clipboard
RTree knn ArrayIndexOutOfBoundsException
if (distances.elementAt(k - 1) > query_radius) { result_correct = false;
//query_radius = distances.elementAt(k);//when shapes.size() == k throw ArrayIndexOutOfBoundsException
==> if (shapes.size() == k) { query_radius = distances.elementAt(k - 1) + 0.000001d; } else { query_radius = distances.elementAt(k); }
} else {
result_correct = true;
}