From 11522abc47ca918a613b2ed07b0153a737d05748 Mon Sep 17 00:00:00 2001 From: Tal Levy Date: Mon, 10 Feb 2020 11:47:45 -0800 Subject: [PATCH] remove usage of Lucene's GeoRelationUtils Lucene removed GeoRelationUtils, and so this commit inlines ES's usage of this utiity class. --- .../org/elasticsearch/index/fielddata/MultiGeoValues.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/index/fielddata/MultiGeoValues.java b/server/src/main/java/org/elasticsearch/index/fielddata/MultiGeoValues.java index 4b15960c1ee5a..5344c0eed031b 100644 --- a/server/src/main/java/org/elasticsearch/index/fielddata/MultiGeoValues.java +++ b/server/src/main/java/org/elasticsearch/index/fielddata/MultiGeoValues.java @@ -20,7 +20,6 @@ import org.apache.lucene.document.ShapeField; import org.apache.lucene.index.IndexableField; -import org.apache.lucene.spatial.util.GeoRelationUtils; import org.apache.lucene.store.ByteBuffersDataOutput; import org.apache.lucene.util.BytesRef; import org.elasticsearch.common.geo.CentroidCalculator; @@ -111,8 +110,8 @@ public BoundingBox boundingBox() { @Override public GeoRelation relate(Rectangle rectangle) { - if (GeoRelationUtils.pointInRectPrecise(geoPoint.lat(), geoPoint.lon(), - rectangle.getMinLat(), rectangle.getMaxLat(), rectangle.getMinLon(), rectangle.getMaxLon())) { + if (geoPoint.lat() >= rectangle.getMinLat() && geoPoint.lat() <= rectangle.getMaxLat() + && geoPoint.lon() >= rectangle.getMinLon() && geoPoint.lon() <= rectangle.getMaxLon()) { return GeoRelation.QUERY_CROSSES; } return GeoRelation.QUERY_DISJOINT;