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 linestrings that go around the globe doesn't work for BKD shapes #43837

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

Geo: indexing linestrings that go around the globe doesn't work for BKD shapes #43837

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

This looks like an old bug that was hidden by JTS, but got exposed after switching to BKD. Indexing of LINESTRING (0 0, 720 20), which represents a line that starts at (0, 0) and goes around the earth twice while moving slightly north. That line should used to decompose into three lines: MULTILINESTRING ((0 0, -180 5), (-180 5, 180 15), (-180 15, 0 20)) during indexing, which wasn't very consistent since one circle around the world LINESTRING (0 0, 360 10) was decomposed into MULTILINESTRING ((0 0, 180 5), (−180 5, 0 10)).

After switching to BKD, the same linestring LINESTRING (0 0, 720 20) is getting decomposed into only 2 strings: multilinestring ((0.0 0.0, 180.0 5.0),(180.0 5.0, 0.0 20.0))

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

Pinging @elastic/es-analytics-geo

@imotov imotov changed the title Geo: indexing geolines that go around the globe doesn't work for BKD shapes Geo: indexing linestrings that go around the globe doesn't work for BKD shapes Jul 1, 2019
@imotov imotov removed the discuss label Jul 18, 2019
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