lucene icon indicating copy to clipboard operation
lucene copied to clipboard

Unable to Tessellate shape for a valid Polygon according to GDAL/OGR and PostGIS

Open garaud opened this issue 4 months ago • 0 comments

Description

Hello,

We recently have some issues with a Polygon geometry and the following error: "Unable to Tessellate shape” when we try to create a new document with the geo_shape type.

The error sends by Elasticsearch is:

{'error': {'root_cause': [{'type': 'document_parsing_exception',
    'reason': '[1:7350] failed to parse field [location] of type [geo_shape]'}],
  'type': 'document_parsing_exception',
  'reason': '[1:7350] failed to parse field [location] of type [geo_shape]',
  'caused_by': {'type': 'illegal_argument_exception',
   'reason': 'Unable to Tessellate shape. Possible malformed shape detected.'}},
 'status': 400}

Note that this is due to a Polygon which is valid according to other GIS tools such as GDAL/OGR or PostGIS.

How to reproduce

I have this Elastic mapping

{
    "mappings": {
        "properties": {
            "location": {
                "type": "geo_shape"
            }
        }
    }
}

Here a GeoJSON file with the Polygon which raises the error.

invalid-polygon.json

Version and environment details

I tried to reproduce this issue for different Elasticsearch versions: 7.17.24 and 8.15.1.

Elasticsearch 7.17.24 with Lucene 8.11.3

{"number": "7.17.24",
 "build_flavor": "default",
 "build_type": "tar",
 "build_hash": "fcf25fff740db6ab3ed5d145c58d70e4c3528ea7",
 "build_date": "2024-09-05T07:34:51.812485320Z",
 "build_snapshot": false,
 "lucene_version": "8.11.3"}

Elasticsearch 8.15.1 and Lucene 9.11.1

{"number": "8.15.1"
 "build_flavor": "default",
 "build_type": "tar",
 "build_hash": "253e8544a65ad44581194068936f2a5d57c2c051",
 "build_date": "2024-09-02T22:04:47.310170297Z",
 "build_snapshot": false,
 "lucene_version": "9.11.1"}

About my OS, I'm on MacOS Sequoia 15.0. The JVM used is the one which is included when I downloaded the .tar.gz from the Elastic website.

openjdk version "22.0.1" 2024-04-16
OpenJDK Runtime Environment (build 22.0.1+8-16)
OpenJDK 64-Bit Server VM (build 22.0.1+8-16, mixed mode, sharing)

Thanks!

garaud avatar Oct 01 '24 13:10 garaud