LUCENE-10201: Upgrade Spatial4j to 0.8 (#409)

Upgrading Spatial4j to 0.8 improving a varitety of minor things.
See release notes:
https://github.com/locationtech/spatial4j/releases/tag/spatial4j-0.8

Test-only dependency on JTS is upgraded to 1.17 as well
This commit is contained in:
David Smiley 2021-10-29 22:01:52 -04:00 committed by GitHub
parent 23256a30fa
commit c2c215d3a8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 21 additions and 14 deletions

View File

@ -322,6 +322,10 @@ Improvements
* LUCENE-10103: Make QueryCache respect Accountable queries. (Haoyu Zhai)
* LUCENE-10201: Spatial-Extras: Upgrading Spatial4j to 0.8 improving a varitety of minor things.
See release notes. https://github.com/locationtech/spatial4j/releases/tag/spatial4j-0.8
(David Smiley)
Bug fixes
---------------------

View File

@ -1 +0,0 @@
705981b7e25d05a76a3654e597dab6ba423eb79e

View File

@ -0,0 +1 @@
7e1973b5babdd98734b1ab903fc1155714402eec

View File

@ -1 +0,0 @@
1cf04898a92917fd038ac5a92490a8c415f671b9

View File

@ -1 +0,0 @@
faa8ba85d503da4ab872d17ba8c00da0098ab2f2

View File

@ -0,0 +1 @@
134b5215f13b90e4de68e5792d507a282848ef68

View File

@ -0,0 +1 @@
f3ff59c2c540102ae157a1786cb80e82ce9c9f19

View File

@ -16,6 +16,7 @@
*/
package org.apache.lucene.spatial.query;
import java.io.IOException;
import java.text.ParseException;
import java.util.HashMap;
import java.util.Locale;
@ -28,10 +29,10 @@ import org.locationtech.spatial4j.shape.Shape;
/**
* Parses a string that usually looks like "OPERATION(SHAPE)" into a {@link SpatialArgs} object. The
* set of operations supported are defined in {@link SpatialOperation}, such as "Intersects" being a
* common one. The shape portion is defined by WKT {@link
* org.locationtech.spatial4j.io.WktShapeParser}, but it can be overridden/customized via {@link
* #parseShape(String, org.locationtech.spatial4j.context.SpatialContext)}. There are some optional
* name-value pair parameters that follow the closing parenthesis. Example:
* common one. The shape portion is defined by WKT {@link org.locationtech.spatial4j.io.WKTReader},
* but it can be overridden/customized via {@link #parseShape(String,
* org.locationtech.spatial4j.context.SpatialContext)}. There are some optional name-value pair
* parameters that follow the closing parenthesis. Example:
*
* <pre>
* Intersects(ENVELOPE(-10,-8,22,20)) distErrPct=0.025
@ -116,10 +117,12 @@ public class SpatialArgsParser {
args.setDistErr(readDouble(nameValPairs.remove(DIST_ERR)));
}
@SuppressWarnings("deprecation")
protected Shape parseShape(String str, SpatialContext ctx) throws ParseException {
// return ctx.readShape(str);//still in Spatial4j 0.4 but will be deleted
return ctx.readShapeFromWkt(str);
try {
return ctx.getFormats().getWktReader().read(str);
} catch (IOException e) {
throw new ParseException(e.toString(), 0); // impossible but whatever;
}
}
protected static Double readDouble(String v) {

View File

@ -19,7 +19,7 @@ org.carrot2:morfologik-fsa:2.1.5 (1 constraints: d70d9836)
org.carrot2:morfologik-polish:2.1.5 (1 constraints: 0a05fd35)
org.carrot2:morfologik-stemming:2.1.5 (2 constraints: 0b12640c)
org.hamcrest:hamcrest:2.2 (1 constraints: a8041f2c)
org.locationtech.spatial4j:spatial4j:0.7 (1 constraints: ab041e2c)
org.locationtech.spatial4j:spatial4j:0.8 (1 constraints: ac041f2c)
org.ow2.asm:asm:7.2 (2 constraints: 900e3e5e)
org.ow2.asm:asm-commons:7.2 (1 constraints: ad042e2c)
ua.net.nlp:morfologik-ukrainian-search:4.9.1 (1 constraints: 10051b36)
@ -33,4 +33,4 @@ org.eclipse.jetty:jetty-server:9.4.41.v20210516 (1 constraints: 7907fe7c)
org.eclipse.jetty:jetty-servlet:9.4.41.v20210516 (1 constraints: 7907fe7c)
org.eclipse.jetty:jetty-util:9.4.41.v20210516 (3 constraints: 422efaf1)
org.eclipse.jetty:jetty-util-ajax:9.4.41.v20210516 (1 constraints: 64101be2)
org.locationtech.jts:jts-core:1.15.0 (1 constraints: 3905383b)
org.locationtech.jts:jts-core:1.17.0 (1 constraints: 3b053e3b)

View File

@ -23,8 +23,8 @@ org.apache.opennlp:opennlp-tools=1.9.1
org.carrot2:morfologik-*=2.1.5
org.eclipse.jetty:*=9.4.41.v20210516
org.hamcrest:*=2.2
org.locationtech.jts:jts-core=1.15.0
org.locationtech.spatial4j:*=0.7
org.locationtech.jts:jts-core=1.17.0
org.locationtech.spatial4j:*=0.8
org.ow2.asm:*=7.2
ua.net.nlp:morfologik-ukrainian-search=4.9.1
xerces:xercesImpl=2.12.0