Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
imotov opened this issue Jul 1, 2019 · 1 comment · Fixed by #47471
Closed

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

imotov opened this issue Jul 1, 2019 · 1 comment · Fixed by #47471
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >bug

Comments

@imotov
Copy link
Contributor

imotov commented Jul 1, 2019

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);

@imotov imotov added >bug :Analytics/Geo Indexing, search aggregations of geo points and shapes labels Jul 1, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-analytics-geo

imotov added a commit to imotov/elasticsearch that referenced this issue Oct 2, 2019
LINESTRING (0 0, 720 20) is now decomposed into 3 strings:
multilinestring (
  (0.0 0.0, 180.0 5.0),
  (-180.0 5.0, 180 15),
  (-180.0 15.0, 0 20)
)

It also fixes issues with linestrings that intersect antimeridian
more than 5 times.

Fixes elastic#43837
Fixes elastic#43826
imotov added a commit that referenced this issue Oct 9, 2019
LINESTRING (0 0, 720 20) is now decomposed into 3 strings:
multilinestring (
  (0.0 0.0, 180.0 5.0),
  (-180.0 5.0, 180 15),
  (-180.0 15.0, 0 20)
)

It also fixes issues with linestrings that intersect antimeridian
more than 5 times.

Fixes #43837
Fixes #43826
imotov added a commit that referenced this issue Oct 9, 2019
LINESTRING (0 0, 720 20) is now decomposed into 3 strings:
multilinestring (
  (0.0 0.0, 180.0 5.0),
  (-180.0 5.0, 180 15),
  (-180.0 15.0, 0 20)
)

It also fixes issues with linestrings that intersect antimeridian
more than 5 times.

Fixes #43837
Fixes #43826
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes >bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants