elastic / elasticsearch

Free and Open, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.53k stars 24.61k forks source link

Geometry Self-intersection in ES and QGIS,but it is not Self-intersecting in Arcgis #70358

Open Helmon-hm opened 3 years ago

Helmon-hm commented 3 years ago

*Elasticsearch version** (bin/elasticsearch --version):7.11.2

Plugins installed: []

JVM version (java -version):1.8.0_281-b09

OS version (uname -a if on a Unix-like system):win10

Description of the problem including expected versus actual behavior:Insert data into a geo_shape field in an index,report 'Self-intersection at or near point [114.4628207731032,26.132645758719093]'.But in Arcgis10.2,I used the Check Geometry tool to check the geometry without any errors.Then I used the Repair Geometry tool to repair the geometry and it also had Self-intersection in ES.By the way, it actually had Self-intersection in QGIS.Are you compatible with this situation?

Steps to reproduce:

Please include a minimal but complete recreation of the problem, including (e.g.) index creation, mappings, settings, query etc. The easier you make for us to reproduce it, the more likely that somebody will take the time to look at it.

1.create a new index with a geo_shape field.

PUT test
{
  "mappings": {
    "properties": {
      "shape":{
        "type": "geo_shape"
      }
    }
  }
}
 2.insert data into the the index
PUT test/_doc/1
{
  "shape":"MultiPolygon (((114.46282077310320346 26.13145361073594586, 114.46282077310320346 26.13175164773173265, 114.46311881009899025 26.13175164773173265, 114.46311881009899025 26.13204968472751943, 114.46341684709477704 26.13204968472751943, 114.46371488409045014 26.13204968472751943, 114.46401292108623693 26.13204968472751943, 114.46431095808202372 26.13204968472751943, 114.4646089950778105 26.13204968472751943, 114.46490703207359729 26.13204968472751943, 114.46520506906938408 26.13204968472751943, 114.46550310606505718 26.13204968472751943, 114.46550310606505718 26.13175164773173265, 114.46609918005663076 26.13175164773173265, 114.46609918005663076 26.13145361073594586, 114.46609918005663076 26.13115557374015907, 114.46550310606505718 26.13115557374015907, 114.46550310606505718 26.13085753674454281, 114.46520506906938408 26.13085753674454281, 114.46520506906938408 26.13115557374015907, 114.46520506906938408 26.13145361073594586, 114.46520506906938408 26.13175164773173265, 114.46490703207359729 26.13175164773173265, 114.4646089950778105 26.13175164773173265, 114.46431095808202372 26.13175164773173265, 114.46401292108623693 26.13175164773173265, 114.46371488409045014 26.13175164773173265, 114.46371488409045014 26.13145361073594586, 114.46341684709477704 26.13145361073594586, 114.46311881009899025 26.13145361073594586, 114.46311881009899025 26.13115557374015907, 114.46282077310320346 26.13115557374015907, 114.46282077310320346 26.13085753674454281, 114.46252273610764405 26.13085753674454281, 114.46252273610764405 26.13115557374015907, 114.46222469911185726 26.13115557374015907, 114.46192666211618416 26.13115557374015907, 114.46192666211618416 26.13145361073594586, 114.46162862512039737 26.13145361073594586, 114.46133058812461059 26.13145361073594586, 114.46133058812461059 26.13175164773173265, 114.46162862512039737 26.13175164773173265, 114.46192666211618416 26.13175164773173265, 114.46192666211618416 26.13204968472751943, 114.46192666211618416 26.13234772172330622, 114.46192666211618416 26.13264575871909301, 114.46222469911185726 26.13264575871909301, 114.46222469911185726 26.13294379571470927, 114.46252273610764405 26.13294379571470927, 114.46282077310320346 26.13294379571470927, 114.46282077310320346 26.13264575871909301, 114.46252273610764405 26.13264575871909301, 114.46252273610764405 26.13234772172330622, 114.46282077310320346 26.13234772172330622, 114.46282077310320346 26.13264575871909301, 114.46311881009899025 26.13264575871909301, 114.46311881009899025 26.13234772172330622, 114.46311881009899025 26.13204968472751943, 114.46282077310320346 26.13204968472751943, 114.46282077310320346 26.13175164773173265, 114.46252273610764405 26.13175164773173265, 114.46252273610764405 26.13145361073594586, 114.46282077310320346 26.13145361073594586)))"
}

The geomtry looks like: image That point is the error point. 3.Execute the insert statement

Provide logs (if relevant):

{
  "error" : {
    "root_cause" : [
      {
        "type" : "mapper_parsing_exception",
        "reason" : "failed to parse field [shape] of type [geo_shape]"
      }
    ],
    "type" : "mapper_parsing_exception",
    "reason" : "failed to parse field [shape] of type [geo_shape]",
    "caused_by" : {
      "type" : "invalid_shape_exception",
      "reason" : "Self-intersection at or near point [114.4628207731032,26.132645758719093]"
    }
  },
  "status" : 400
}
elasticmachine commented 3 years ago

Pinging @elastic/es-analytics-geo (Team:Analytics)

iverase commented 3 years ago

Elasticsearch tries to follow the Open Geospatial Consortium standard defined here for geometry validation. In our interpretation, the geometry above is not valid as the definition contains no holes, but the geometry does contain interior boundaries.

Looking into the ArcGIS documentation, this structure is supported:

An area shape can have inversions, which are empty spaces inside the area shape that touch the outer boundary.

So I don't think this is a bug, just seems arcGIS might have more loose requirements for polygon validation.

Helmon-hm commented 3 years ago

You know,arcGIS is in a leading position in GIS industry.If it is different between arcgis and es to judge whether the geometry is valid or not,it is hard for us to explain this situation to our Part A.So I hope you can evaluate it again.Thinks.

------------------ 原始邮件 ------------------ 发件人: "elastic/elasticsearch" @.>; 发送时间: 2021年3月16日(星期二) 晚上6:34 @.>; @.**@.>; 主题: Re: [elastic/elasticsearch] Geometry Self-intersection in ES and QGIS,but it is not Self-intersecting in Arcgis (#70358)

Elasticsearch tries to follow the Open Geospatial Consortium standard defined here for geometry validation. In our interpretation, the geometry above is not valid as the definition contains no holes, but the geometry does contain interior boundaries.

Looking into the ArcGIS documentation, this structure is supported: An area shape can have inversions, which are empty spaces inside the area shape that touch the outer boundary.
So I don't think this is a bug, just seems arcGIS might have more loose requirements for polygon validation.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.