[crash] ES should reorder envelope corners #2544

Closed
mvrhov opened this Issue Jan 14, 2013 · 6 comments

Comments

Projects
None yet
6 participants

mvrhov commented Jan 14, 2013

It might happen that the coordinates for an envelope geo type arrive in top right bottom left. When that happens right now ES 0.20.2 the ES dies with oom. When you look at the hprof dump all you see is millions of org.elasticsearch.common.lucene.spatial.prefix.tree.GeohashPrefixTree$GhCell objects in my case that was about 6mio worth of them.

I see two solutions to this:

  • be friendly and correct the coordinates to be in proper order top left, bottom right
  • return an error
Contributor

s1monw commented Mar 2, 2013

hey, I think this has been fixed but can you provide a testcase for this to make sure I am not missing it?

mvrhov commented Mar 5, 2013

Hi, It has not been fixed.
e.g. ,"coordinates":[[150.5981,-30.548016666667],[150.06046666666,-31.037683333334]] will still break the 0.90b1

Contributor

chilling commented Jun 10, 2013

Hi @mvrhov, can you provide an example how you use these coordinates. Do you use this in a filter or a query? I just tested it myself and I also do not receive any error response. So I'm going to fix this.

mvrhov commented Jun 10, 2013

@chilling: I haven't tested this since 0.90b1 come out. However the oom was happening when inserting a new record.

Contributor

chilling commented Jun 10, 2013

Ok. I think currently this error will be ignored but I'm going to fixit. The solution will be returning an error rather than autocorrecting it.

@ghost ghost assigned chilling Oct 30, 2013

@clintongormley clintongormley added the :Geo label Nov 10, 2014

Contributor

missinglink commented Dec 28, 2014

@nknize nknize self-assigned this Dec 29, 2014

nknize added a commit to nknize/elasticsearch that referenced this issue Dec 30, 2014

[GEO] GIS envelope validation
ShapeBuilder expected coordinates for Envelope types in strict Top-Left, Bottom-Right order. Given that GeoJSON does not enforce coordinate order (as seen in #8672) clients could specify envelope bounds in any order and be compliant with the GeoJSON spec but not the ES ShapeBuilder logic. This change loosens the ShapeBuilder requirements on envelope coordinate order, reordering where necessary.

closes #2544
closes #9067
closes #9079
closes #9080

@nknize nknize closed this in #9091 Dec 30, 2014

nknize added a commit that referenced this issue Dec 30, 2014

[GEO] GIS envelope validation
ShapeBuilder expected coordinates for Envelope types in strict Top-Left, Bottom-Right order. Given that GeoJSON does not enforce coordinate order (as seen in #8672) clients could specify envelope bounds in any order and be compliant with the GeoJSON spec but not the ES ShapeBuilder logic. This change loosens the ShapeBuilder requirements on envelope coordinate order, reordering where necessary.

closes #2544
closes #9067
closes #9079
closes #9080

nknize added a commit that referenced this issue Dec 30, 2014

[GEO] GIS envelope validation
ShapeBuilder expected coordinates for Envelope types in strict Top-Left, Bottom-Right order. Given that GeoJSON does not enforce coordinate order (as seen in #8672) clients could specify envelope bounds in any order and be compliant with the GeoJSON spec but not the ES ShapeBuilder logic. This change loosens the ShapeBuilder requirements on envelope coordinate order, reordering where necessary.

closes #2544
closes #9067
closes #9079
closes #9080

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015

[GEO] GIS envelope validation
ShapeBuilder expected coordinates for Envelope types in strict Top-Left, Bottom-Right order. Given that GeoJSON does not enforce coordinate order (as seen in #8672) clients could specify envelope bounds in any order and be compliant with the GeoJSON spec but not the ES ShapeBuilder logic. This change loosens the ShapeBuilder requirements on envelope coordinate order, reordering where necessary.

closes #2544
closes #9067
closes #9079
closes #9080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment