LUCENE-9641: Fix LatLonShape#testPointIndexAndQuery test bug.

This commit is contained in:
iverase 2021-01-08 13:43:29 +01:00
parent 14009f4424
commit a7391fb73e
1 changed files with 2 additions and 8 deletions

View File

@ -456,14 +456,8 @@ public class TestLatLonShape extends LuceneTestCase {
RandomIndexWriter writer = new RandomIndexWriter(random(), dir);
Document document = new Document();
Point p = GeoTestUtil.nextPoint();
double qLat =
p.getLat() == GeoUtils.MAX_LAT_INCL
? p.getLat()
: GeoEncodingUtils.decodeLatitude(GeoEncodingUtils.encodeLatitudeCeil(p.getLat()));
double qLon =
p.getLon() == GeoUtils.MAX_LON_INCL
? p.getLon()
: GeoEncodingUtils.decodeLongitude(GeoEncodingUtils.encodeLongitudeCeil(p.getLon()));
double qLat = GeoEncodingUtils.decodeLatitude(GeoEncodingUtils.encodeLatitude(p.getLat()));
double qLon = GeoEncodingUtils.decodeLongitude(GeoEncodingUtils.encodeLongitude(p.getLon()));
p = new Point(qLat, qLon);
Field[] fields = LatLonShape.createIndexableFields(FIELDNAME, p.getLat(), p.getLon());
for (Field f : fields) {