├── .gitignore
├── gradle.properties
├── config
└── elastic.importorder
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── src
├── test
│ ├── resources
│ │ └── rest-api-spec
│ │ │ └── test
│ │ │ ├── .DS_Store
│ │ │ └── GeoExtension
│ │ │ └── .DS_Store
│ └── java
│ │ └── org
│ │ └── opendatasoft
│ │ └── elasticsearch
│ │ └── plugin
│ │ └── GeoUtilsTests.java
├── main
│ ├── java
│ │ └── org
│ │ │ └── opendatasoft
│ │ │ └── elasticsearch
│ │ │ ├── .DS_Store
│ │ │ ├── search
│ │ │ └── aggregations
│ │ │ │ └── bucket
│ │ │ │ └── geoshape
│ │ │ │ ├── GeoShape.java
│ │ │ │ ├── GeoShapeAggregatorSupplier.java
│ │ │ │ ├── GeoShapeAggregatorFactory.java
│ │ │ │ ├── GeoShapeBuilder.java
│ │ │ │ ├── InternalGeoShape.java
│ │ │ │ └── GeoShapeAggregator.java
│ │ │ ├── plugin
│ │ │ ├── GeoExtensionPlugin.java
│ │ │ └── GeoUtils.java
│ │ │ ├── script
│ │ │ └── ScriptGeoSimplify.java
│ │ │ └── ingest
│ │ │ └── GeoExtensionProcessor.java
│ └── main.iml
└── yamlRestTest
│ ├── resources
│ └── rest-api-spec
│ │ └── test
│ │ └── GeoExtension
│ │ ├── 10_basic.yml
│ │ ├── 50_invalid_polygon.yml
│ │ ├── 40_geoshape_aggregation.yml
│ │ ├── 30_simplify_script.yml
│ │ └── 20_geo_ingest_processor.yml
│ └── java
│ └── org
│ └── opendatasoft
│ └── elasticsearch
│ └── RestApiYamlIT.java
├── docker
└── Dockerfile
├── CHANGELOG.md
├── docker-compose.yml
├── .github
└── workflows
│ ├── build.yaml
│ └── release.yaml
├── gradlew.bat
├── gradlew
├── README.md
└── LICENSE
/.gitignore:
--------------------------------------------------------------------------------
1 | *.log
2 | .DS_Store
3 | .gradle/
4 | .idea/
5 | build/
6 | .vscode/
7 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | elastic_version = 8.19.6
2 | plugin_version = 8.19.6.0
3 | hamcrest_version = 2.1
4 | junit_version = 4.13.2
5 |
--------------------------------------------------------------------------------
/config/elastic.importorder:
--------------------------------------------------------------------------------
1 | #Eclipse configuration for import order for Elasticsearch
2 | 0=
3 | 1=com
4 | 2=org
5 | 3=java
6 | 4=javax
7 | 5=\#
8 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendatasoft/elasticsearch-plugin-geoshape/HEAD/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/src/test/resources/rest-api-spec/test/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendatasoft/elasticsearch-plugin-geoshape/HEAD/src/test/resources/rest-api-spec/test/.DS_Store
--------------------------------------------------------------------------------
/src/main/java/org/opendatasoft/elasticsearch/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendatasoft/elasticsearch-plugin-geoshape/HEAD/src/main/java/org/opendatasoft/elasticsearch/.DS_Store
--------------------------------------------------------------------------------
/src/test/resources/rest-api-spec/test/GeoExtension/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/opendatasoft/elasticsearch-plugin-geoshape/HEAD/src/test/resources/rest-api-spec/test/GeoExtension/.DS_Store
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
4 | networkTimeout=10000
5 | validateDistributionUrl=true
6 | zipStoreBase=GRADLE_USER_HOME
7 | zipStorePath=wrapper/dists
8 |
--------------------------------------------------------------------------------
/src/yamlRestTest/resources/rest-api-spec/test/GeoExtension/10_basic.yml:
--------------------------------------------------------------------------------
1 | "Geoshape plugin installed":
2 | - do:
3 | cluster.state: {}
4 |
5 | - set: {master_node: master}
6 |
7 | - do:
8 | nodes.info: {}
9 |
10 | - match: {nodes.$master.plugins.0.name: elasticsearch-plugin-geoshape}
11 |
--------------------------------------------------------------------------------
/docker/Dockerfile:
--------------------------------------------------------------------------------
1 | FROM docker.elastic.co/elasticsearch/elasticsearch:7.17.28 AS elasticsearch-plugin-debug
2 |
3 | COPY /build/distributions/elasticsearch-plugin-geoshape-7.17.28.0.zip /tmp/elasticsearch-plugin-geoshape-7.17.28.0.zip
4 | RUN ./bin/elasticsearch-plugin install file:/tmp/elasticsearch-plugin-geoshape-7.17.28.0.zip
5 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ### 7.17.28.0
2 |
3 | * Repackaging for Elasticsearch 7.17.28
4 |
5 | ### 7.17.6.1
6 |
7 | * Fix bbox on linestrings and points
8 |
9 | ### 7.17.6.0
10 |
11 | * Repackaging for ES 7.17.6
12 |
13 | ### 7.17.1.2
14 |
15 | * Simplify consistency: script is now using the same tolerance value as the agg one
16 |
17 | ### 7.17.1.1
18 |
19 | * Fix deduplication of points
20 | * Fix handling of GeometryCollections
21 | * Add tests
22 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | services:
2 | elasticsearch-plugin-debug:
3 | build:
4 | context: .
5 | dockerfile: docker/Dockerfile
6 | target: elasticsearch-plugin-debug
7 | environment:
8 | - discovery.type=single-node
9 | # NO DEBUG
10 | - ES_JAVA_OPTS=-Xms512m -Xmx512m
11 | # DEBUG
12 | # - ES_JAVA_OPTS=-Xms512m -Xmx512m -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5005
13 | ports:
14 | - "9200:9200"
15 | - "5005:5005" # DEBUG
16 |
--------------------------------------------------------------------------------
/src/main/main.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/.github/workflows/build.yaml:
--------------------------------------------------------------------------------
1 | name: compile-and-test
2 |
3 | on:
4 | pull_request:
5 |
6 | jobs:
7 | build:
8 | runs-on: ubuntu-latest
9 | steps:
10 | - name: Checkout sources
11 | uses: actions/checkout@v4
12 | - name: Setup Java
13 | uses: actions/setup-java@v4
14 | with:
15 | distribution: 'temurin'
16 | java-version: 21
17 | - name: Setup Gradle
18 | uses: gradle/actions/setup-gradle@v4
19 | - name: Check Format
20 | run: ./gradlew spotlessCheck
21 | - name: Compile
22 | run: ./gradlew assemble
23 | - name: Run Tests
24 | run: ./gradlew check
25 |
--------------------------------------------------------------------------------
/src/main/java/org/opendatasoft/elasticsearch/search/aggregations/bucket/geoshape/GeoShape.java:
--------------------------------------------------------------------------------
1 | package org.opendatasoft.elasticsearch.search.aggregations.bucket.geoshape;
2 |
3 | import org.elasticsearch.search.aggregations.bucket.MultiBucketsAggregation;
4 |
5 | import java.util.List;
6 |
7 | /**
8 | * An aggregation of geo_shape using wkb field.
9 | */
10 | public interface GeoShape extends MultiBucketsAggregation {
11 | interface Bucket extends MultiBucketsAggregation.Bucket {}
12 |
13 | enum Algorithm {
14 | DOUGLAS_PEUCKER,
15 | TOPOLOGY_PRESERVING
16 | }
17 |
18 | @Override
19 | List extends Bucket> getBuckets();
20 |
21 | }
22 |
--------------------------------------------------------------------------------
/src/yamlRestTest/java/org/opendatasoft/elasticsearch/RestApiYamlIT.java:
--------------------------------------------------------------------------------
1 | package org.opendatasoft.elasticsearch;
2 |
3 | import com.carrotsearch.randomizedtesting.annotations.Name;
4 | import com.carrotsearch.randomizedtesting.annotations.ParametersFactory;
5 |
6 | import org.elasticsearch.test.rest.yaml.ClientYamlTestCandidate;
7 | import org.elasticsearch.test.rest.yaml.ESClientYamlSuiteTestCase;
8 |
9 | /*
10 | * Generic loader for yaml integration tests
11 | */
12 |
13 | public class RestApiYamlIT extends ESClientYamlSuiteTestCase {
14 | public RestApiYamlIT(@Name("yaml") ClientYamlTestCandidate testCandidate) {
15 | super(testCandidate);
16 | }
17 |
18 | @ParametersFactory
19 | public static Iterable