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

Bug in geo_bounding_box #9067

Closed
shastox opened this issue Dec 25, 2014 · 1 comment · Fixed by #9091
Closed

Bug in geo_bounding_box #9067

shastox opened this issue Dec 25, 2014 · 1 comment · Fixed by #9091
Assignees
Labels
:Analytics/Geo Indexing, search aggregations of geo points and shapes

Comments

@shastox
Copy link

shastox commented Dec 25, 2014

Hi, i have many objects.

Mapping:
            "mappings" => [
                'np' => [
                    "properties" => [
                        "location" => [
                            "type" => "geo_point",
                            "lat_lon" => true,
                        ],
                    ],
                ],
            ],

Create index:

'location' => [
'lat' => ...,
'lon' => ...
]

But when i search objects with current request:

[filter] => Array
                        (
                            [geo_bounding_box] => Array
                                (
                                    [type] => indexed
                                    [location] => Array
                                        (
                                            [top_left] => Array
                                                (
                                                    [lat] => 55.124701389506
                                                    [lon] => 38.188874499768
                                                )

                                            [bottom_right] => Array
                                                (
                                                    [lat] => 55.100701389506
                                                    [lon] => 38.164874499768
                                                )

                                        )

                                )
                        )

I have many right results, but one or two objects have these coordinates:
[lat] => 55.1100127
[lon] => 37.9883611

This object is close, but not in requested area.

How can it be?

Sorry, i am from Russia.

@missinglink
Copy link
Contributor

The co-ordinates you specified are top-right bottom-left, you can visualize this more clearly here: https://gist.github.com/anonymous/5a6e2304f14f89dcdd33

see: #9080

@clintongormley clintongormley added the :Analytics/Geo Indexing, search aggregations of geo points and shapes label Dec 29, 2014
nknize added a commit to nknize/elasticsearch that referenced this issue Dec 30, 2014
ShapeBuilder expected coordinates for Envelope types in strict Top-Left, Bottom-Right order. Given that GeoJSON does not enforce coordinate order (as seen in elastic#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 elastic#2544
closes elastic#9067
closes elastic#9079
closes elastic#9080
nknize added a commit that referenced this issue Dec 30, 2014
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
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
ShapeBuilder expected coordinates for Envelope types in strict Top-Left, Bottom-Right order. Given that GeoJSON does not enforce coordinate order (as seen in elastic#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 elastic#2544
closes elastic#9067
closes elastic#9079
closes elastic#9080
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants