Skip to content

Geo: Indexing of linestrings crossing dateline 5 times or more fails #43826

@imotov

Description

@imotov

Linestrings that cross the dateline 4 times have the last segment repeated after decomposition and linestrings that cross the date line 5 times can fail with index out of bound exception. To reproduce:

DELETE test

PUT test
{
  "mappings": {
    "properties": {
      "shape": {
        "type": "geo_shape"
      }
    }
  }
}

PUT test/_doc/1
{
  "shape": "LINESTRING (160 0, 200 10, 160 20, 200 30, 160 40, 200 50)"
}

Both issues seem to be caused by offset in the line

coordinates[offset+i-1] = Edge.position(coordinates[i-1], coordinates[i], t);

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Analytics/GeoIndexing, search aggregations of geo points and shapes>bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions