From f62a7b2cd31f5f0ea5dda71a1183cdfae081d56a Mon Sep 17 00:00:00 2001 From: sjudeng Date: Tue, 22 Oct 2019 19:46:11 -0500 Subject: [PATCH] Update to GeoServer/GeoTools 2.16.0/22.0 and Elasticsearch 7.4.0 --- .travis.yml | 21 ++++++++++--------- gs-web-elasticsearch/doc/index.rst | 2 +- gs-web-elasticsearch/pom.xml | 4 ++-- gt-elasticsearch-process/pom.xml | 4 ++-- gt-elasticsearch/pom.xml | 14 +++++++++---- .../elasticsearch/FilterToElasticHelper.java | 3 ++- .../data/elasticsearch/ElasticFilterTest.java | 15 +++++++++++-- .../ElasticGeometryFilterIT.java | 5 +++-- joda-shaded/pom.xml | 4 ++-- pom.xml | 10 ++++----- 10 files changed, 51 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0e721d6..b3417b9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,22 +3,23 @@ services: - docker language: java jdk: -- oraclejdk8 +- openjdk8 env: matrix: - - GEOTOOLS_VERSION='21.1' GEOSERVER_VERSION='2.15.1' ES_VERSION='7.0.1' - - GEOTOOLS_VERSION='21.1' GEOSERVER_VERSION='2.15.1' ES_VERSION='6.7.2' - - GEOTOOLS_VERSION='21.1' GEOSERVER_VERSION='2.15.1' ES_VERSION='5.6.15' - - GEOTOOLS_VERSION='21.1' GEOSERVER_VERSION='2.15.1' ES_VERSION='2.4.4' ARGS='-Ddocker.image=elasticsearch' - - GEOTOOLS_VERSION='21.0' GEOSERVER_VERSION='2.15.0' ES_VERSION='7.0.1' - - GEOTOOLS_VERSION='21.0' GEOSERVER_VERSION='2.15.0' ES_VERSION='6.7.2' - - GEOTOOLS_VERSION='21.0' GEOSERVER_VERSION='2.15.0' ES_VERSION='5.6.15' - - GEOTOOLS_VERSION='21.0' GEOSERVER_VERSION='2.15.0' ES_VERSION='2.4.4' ARGS='-Ddocker.image=elasticsearch' + - GEOTOOLS_VERSION='22.0' GEOSERVER_VERSION='2.16.0' ES_VERSION='7.4.0' + - GEOTOOLS_VERSION='22.0' GEOSERVER_VERSION='2.16.0' ES_VERSION='6.8.3' + - GEOTOOLS_VERSION='22.0' GEOSERVER_VERSION='2.16.0' ES_VERSION='5.6.16' + - GEOTOOLS_VERSION='22.0' GEOSERVER_VERSION='2.16.0' ES_VERSION='2.4.5' ARGS='-Ddocker.image=elasticsearch' + - GEOTOOLS_VERSION='21.3' GEOSERVER_VERSION='2.15.3' ES_VERSION='7.4.0' + - GEOTOOLS_VERSION='21.3' GEOSERVER_VERSION='2.15.3' ES_VERSION='6.8.3' + - GEOTOOLS_VERSION='21.3' GEOSERVER_VERSION='2.15.3' ES_VERSION='5.6.16' + - GEOTOOLS_VERSION='21.3' GEOSERVER_VERSION='2.15.3' ES_VERSION='2.4.5' ARGS='-Ddocker.image=elasticsearch' cache: directories: - "$HOME/.m2" install: -- travis_retry mvn install -DskipTests=true -Dskip.integration.tests=true -Dgeotools.version=${GEOTOOLS_VERSION} -Dgeoserver.version=${GEOSERVER_VERSION} -Des.test.version=${ES_VERSION} ${ARGS} +- mvn --version +- travis_retry mvn install -DskipTests=true -Dskip.integration.tests=true -B -Dgeotools.version=${GEOTOOLS_VERSION} -Dgeoserver.version=${GEOSERVER_VERSION} -Des.test.version=${ES_VERSION} ${ARGS} script: - sudo sysctl -w vm.max_map_count=262144 - travis_retry mvn verify -Dgeotools.version=${GEOTOOLS_VERSION} -Dgeoserver.version=${GEOSERVER_VERSION} -Des.test.version=${ES_VERSION} ${ARGS} diff --git a/gs-web-elasticsearch/doc/index.rst b/gs-web-elasticsearch/doc/index.rst index f4cc83f..092f116 100644 --- a/gs-web-elasticsearch/doc/index.rst +++ b/gs-web-elasticsearch/doc/index.rst @@ -11,7 +11,7 @@ Compatibility ------------- * Java: 1.8 -* GeoServer: 2.15.x +* GeoServer: 2.16.x * Elasticsearch: 2.4.x, 5.x, 6.x, 7.x Downloads diff --git a/gs-web-elasticsearch/pom.xml b/gs-web-elasticsearch/pom.xml index 3921c0c..fe7152b 100644 --- a/gs-web-elasticsearch/pom.xml +++ b/gs-web-elasticsearch/pom.xml @@ -7,10 +7,10 @@ elasticgeo mil.nga.giat - 2.15-SNAPSHOT + 2.16-SNAPSHOT gs-web-elasticsearch - 2.15-SNAPSHOT + 2.16-SNAPSHOT jar GeoServer Elasticsearch Module diff --git a/gt-elasticsearch-process/pom.xml b/gt-elasticsearch-process/pom.xml index 2a2404b..88565f4 100644 --- a/gt-elasticsearch-process/pom.xml +++ b/gt-elasticsearch-process/pom.xml @@ -4,10 +4,10 @@ elasticgeo mil.nga.giat - 2.15-SNAPSHOT + 2.16-SNAPSHOT gt-elasticsearch-process - 2.15-SNAPSHOT + 2.16-SNAPSHOT jar GeoTools Elasticsearch Processes diff --git a/gt-elasticsearch/pom.xml b/gt-elasticsearch/pom.xml index 016744b..8bde50f 100644 --- a/gt-elasticsearch/pom.xml +++ b/gt-elasticsearch/pom.xml @@ -4,10 +4,10 @@ elasticgeo mil.nga.giat - 2.15-SNAPSHOT + 2.16-SNAPSHOT gt-elasticsearch - 2.15-SNAPSHOT + 2.16-SNAPSHOT jar GeoTools Elasticsearch DataStore @@ -17,7 +17,7 @@ org.springframework.security spring-security-core - 4.2.7.RELEASE + 5.1.5.RELEASE aopalliance @@ -109,7 +109,13 @@ 4.11 test - + + org.hamcrest + hamcrest-all + 1.3 + test + + diff --git a/gt-elasticsearch/src/main/java/mil/nga/giat/data/elasticsearch/FilterToElasticHelper.java b/gt-elasticsearch/src/main/java/mil/nga/giat/data/elasticsearch/FilterToElasticHelper.java index 8c01bb7..67c4fab 100644 --- a/gt-elasticsearch/src/main/java/mil/nga/giat/data/elasticsearch/FilterToElasticHelper.java +++ b/gt-elasticsearch/src/main/java/mil/nga/giat/data/elasticsearch/FilterToElasticHelper.java @@ -51,6 +51,7 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; +import org.opengis.geometry.BoundingBox; class FilterToElasticHelper { @@ -247,7 +248,7 @@ private void visitGeoPointBinarySpatialOperator(BinarySpatialOperator filter, Ex "filter", ImmutableMap.of("geo_polygon", ImmutableMap.of(key, ImmutableMap.of("points", points))))); } else if (filter instanceof BBOX) { - final Envelope envelope = geometry.getEnvelopeInternal(); + final BoundingBox envelope = ((BBOX) filter).getBounds(); final double minY = clipLat(envelope.getMinY()); final double maxY = clipLat(envelope.getMaxY()); final double minX, maxX; diff --git a/gt-elasticsearch/src/test/java/mil/nga/giat/data/elasticsearch/ElasticFilterTest.java b/gt-elasticsearch/src/test/java/mil/nga/giat/data/elasticsearch/ElasticFilterTest.java index 5cadaf6..e9c5522 100644 --- a/gt-elasticsearch/src/test/java/mil/nga/giat/data/elasticsearch/ElasticFilterTest.java +++ b/gt-elasticsearch/src/test/java/mil/nga/giat/data/elasticsearch/ElasticFilterTest.java @@ -5,6 +5,7 @@ package mil.nga.giat.data.elasticsearch; import static org.junit.Assert.*; +import static org.hamcrest.collection.IsIn.isOneOf; import java.text.DateFormat; import java.text.ParseException; @@ -550,6 +551,10 @@ public void testGeoShapeBboxFilter() { coords.add(ImmutableList.of(1.1,1.1)); coords.add(ImmutableList.of(1.1,0.)); coords.add(ImmutableList.of(0.,0.)); + // vertices in reverse order + final List> reverseCoords = ImmutableList.of( + coords.get(0), coords.get(3), coords.get(2), coords.get(1), coords.get(4) + ); Map expected = ImmutableMap.of("bool", ImmutableMap.of("must", MATCH_ALL, "filter", ImmutableMap.of("geo_shape", ImmutableMap.of("geom", ImmutableMap.of("shape", @@ -558,7 +563,8 @@ public void testGeoShapeBboxFilter() { builder.visit(filter, null); assertTrue(builder.createCapabilities().fullySupports(filter)); - assertEquals(expected.toString(), builder.getQueryBuilder().toString()); + assertThat(builder.getQueryBuilder().toString(), isOneOf(expected.toString(), + expected.toString().replace(coords.toString(), reverseCoords.toString()))); } @Test @@ -627,6 +633,10 @@ public void testAndWithBbox() { coords.add(ImmutableList.of(1.1,1.1)); coords.add(ImmutableList.of(1.1,0.)); coords.add(ImmutableList.of(0.,0.)); + // vertices in reverse order + List> reverseCoords = ImmutableList.of( + coords.get(0), coords.get(3), coords.get(2), coords.get(1), coords.get(4) + ); Map expected = ImmutableMap.of("bool", ImmutableMap.of("must", ImmutableList.of( ImmutableMap.of("ids", ImmutableMap.of("values", ImmutableList.of("id1"))), ImmutableMap.of("bool", ImmutableMap.of("must", MATCH_ALL, "filter", ImmutableMap.of("geo_shape", ImmutableMap.of("geom", ImmutableMap.of("shape", @@ -636,7 +646,8 @@ public void testAndWithBbox() { builder.visit(filter, null); assertTrue(builder.createCapabilities().fullySupports(filter)); - assertEquals(expected.toString(), builder.getQueryBuilder().toString()); + assertThat(builder.getQueryBuilder().toString(), isOneOf(expected.toString(), + expected.toString().replace(coords.toString(), reverseCoords.toString()))); } @Test diff --git a/gt-elasticsearch/src/test/java/mil/nga/giat/data/elasticsearch/ElasticGeometryFilterIT.java b/gt-elasticsearch/src/test/java/mil/nga/giat/data/elasticsearch/ElasticGeometryFilterIT.java index 8dbe68b..2dd5c13 100644 --- a/gt-elasticsearch/src/test/java/mil/nga/giat/data/elasticsearch/ElasticGeometryFilterIT.java +++ b/gt-elasticsearch/src/test/java/mil/nga/giat/data/elasticsearch/ElasticGeometryFilterIT.java @@ -19,6 +19,7 @@ import org.geotools.data.simple.SimpleFeatureCollection; import org.geotools.data.simple.SimpleFeatureIterator; +import org.junit.Ignore; import org.junit.Test; import org.locationtech.jts.geom.GeometryFactory; import org.locationtech.jts.geom.LineString; @@ -304,7 +305,7 @@ public void testGeoPointAsArray() throws Exception { public void testBBOXCoveringDateline() throws Exception { init("not-active","geo"); FilterFactory ff = dataStore.getFilterFactory(); - BBOX bbox = ff.bbox("geo", 178, -98, 182, 98, "EPSG:" + SOURCE_SRID); + BBOX bbox = ff.bbox("geo", 178, -90, 182, 90, "EPSG:" + SOURCE_SRID); SimpleFeatureCollection features = featureSource.getFeatures(bbox); assertEquals(2, features.size()); } @@ -313,7 +314,7 @@ public void testBBOXCoveringDateline() throws Exception { public void testBBOXBeyondDateline() throws Exception { init("not-active","geo"); FilterFactory ff = dataStore.getFilterFactory(); - BBOX bbox = ff.bbox("geo", 180.5, -98, 182, 98, "EPSG:" + SOURCE_SRID); + BBOX bbox = ff.bbox("geo", 180.5, -90, 182, 90, "EPSG:" + SOURCE_SRID); SimpleFeatureCollection features = featureSource.getFeatures(bbox); assertEquals(1, features.size()); } diff --git a/joda-shaded/pom.xml b/joda-shaded/pom.xml index 595dadb..f1373d0 100644 --- a/joda-shaded/pom.xml +++ b/joda-shaded/pom.xml @@ -4,10 +4,10 @@ elasticgeo mil.nga.giat - 2.15-SNAPSHOT + 2.16-SNAPSHOT joda-shaded - 2.15-SNAPSHOT + 2.16-SNAPSHOT jar Elasticsearch Joda Shaded diff --git a/pom.xml b/pom.xml index d469dbb..5103252 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 mil.nga.giat elasticgeo - 2.15-SNAPSHOT + 2.16-SNAPSHOT pom ElasticGeo ElasticGeo provides a GeoTools data store that allows geospatial features from an Elasticsearch index to be published via OGC services using GeoServer. @@ -28,12 +28,12 @@ UTF-8 UTF-8 - 21.1 - 2.15.1 + 22.0 + 2.16.0 - 7.0.1 + 7.4.0 - 7.0.1 + 7.4.0 2.9.5 2.10.1 25.1-jre