Skip to content

Commit

Permalink
Update to GeoServer/GeoTools 2.16.0/22.0 and Elasticsearch 7.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sjudeng committed Oct 24, 2019
1 parent 8fd981f commit f62a7b2
Show file tree
Hide file tree
Showing 10 changed files with 51 additions and 31 deletions.
21 changes: 11 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion gs-web-elasticsearch/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions gs-web-elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<parent>
<artifactId>elasticgeo</artifactId>
<groupId>mil.nga.giat</groupId>
<version>2.15-SNAPSHOT</version>
<version>2.16-SNAPSHOT</version>
</parent>
<artifactId>gs-web-elasticsearch</artifactId>
<version>2.15-SNAPSHOT</version>
<version>2.16-SNAPSHOT</version>
<packaging>jar</packaging>
<name>GeoServer Elasticsearch Module</name>
<dependencies>
Expand Down
4 changes: 2 additions & 2 deletions gt-elasticsearch-process/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<parent>
<artifactId>elasticgeo</artifactId>
<groupId>mil.nga.giat</groupId>
<version>2.15-SNAPSHOT</version>
<version>2.16-SNAPSHOT</version>
</parent>
<artifactId>gt-elasticsearch-process</artifactId>
<version>2.15-SNAPSHOT</version>
<version>2.16-SNAPSHOT</version>
<packaging>jar</packaging>
<name>GeoTools Elasticsearch Processes</name>
<dependencies>
Expand Down
14 changes: 10 additions & 4 deletions gt-elasticsearch/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<parent>
<artifactId>elasticgeo</artifactId>
<groupId>mil.nga.giat</groupId>
<version>2.15-SNAPSHOT</version>
<version>2.16-SNAPSHOT</version>
</parent>
<artifactId>gt-elasticsearch</artifactId>
<version>2.15-SNAPSHOT</version>
<version>2.16-SNAPSHOT</version>
<packaging>jar</packaging>
<name>GeoTools Elasticsearch DataStore</name>
<properties>
Expand All @@ -17,7 +17,7 @@
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>4.2.7.RELEASE</version>
<version>5.1.5.RELEASE</version>
<exclusions>
<exclusion>
<groupId>aopalliance</groupId>
Expand Down Expand Up @@ -109,7 +109,13 @@
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<resources>
<resource>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.opengis.geometry.BoundingBox;

class FilterToElasticHelper {

Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<List<Double>> reverseCoords = ImmutableList.of(
coords.get(0), coords.get(3), coords.get(2), coords.get(1), coords.get(4)
);
Map<String,Object> expected = ImmutableMap.of("bool",
ImmutableMap.of("must", MATCH_ALL, "filter", ImmutableMap.of("geo_shape",
ImmutableMap.of("geom", ImmutableMap.of("shape",
Expand All @@ -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
Expand Down Expand Up @@ -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<List<Double>> reverseCoords = ImmutableList.of(
coords.get(0), coords.get(3), coords.get(2), coords.get(1), coords.get(4)
);
Map<String,Object> 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",
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}
Expand All @@ -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());
}
Expand Down
4 changes: 2 additions & 2 deletions joda-shaded/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<parent>
<artifactId>elasticgeo</artifactId>
<groupId>mil.nga.giat</groupId>
<version>2.15-SNAPSHOT</version>
<version>2.16-SNAPSHOT</version>
</parent>
<artifactId>joda-shaded</artifactId>
<version>2.15-SNAPSHOT</version>
<version>2.16-SNAPSHOT</version>
<packaging>jar</packaging>
<name>Elasticsearch Joda Shaded</name>
<dependencies>
Expand Down
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>mil.nga.giat</groupId>
<artifactId>elasticgeo</artifactId>
<version>2.15-SNAPSHOT</version>
<version>2.16-SNAPSHOT</version>
<packaging>pom</packaging>
<name>ElasticGeo</name>
<description>ElasticGeo provides a GeoTools data store that allows geospatial features from an Elasticsearch index to be published via OGC services using GeoServer.</description>
Expand All @@ -28,12 +28,12 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<geotools.version>21.1</geotools.version>
<geoserver.version>2.15.1</geoserver.version>
<geotools.version>22.0</geotools.version>
<geoserver.version>2.16.0</geoserver.version>
<!-- Elasticsearch version for HTTP client and select Joda classes -->
<es.version>7.0.1</es.version>
<es.version>7.4.0</es.version>
<!-- Elasticsearch version used for integration testing -->
<es.test.version>7.0.1</es.test.version>
<es.test.version>7.4.0</es.test.version>
<jackson.version>2.9.5</jackson.version>
<joda.version>2.10.1</joda.version>
<guava.version>25.1-jre</guava.version>
Expand Down

0 comments on commit f62a7b2

Please sign in to comment.