Hey there,

please file a github issue for this one, to make sure it does not get lost
(havent checked the details, but looks like a valid bug from my birds eye
view). Thanks a lot!


--Alex


On Mon, Apr 28, 2014 at 7:41 PM, Pablo Castro <[email protected]> wrote:

> Using Elasticsearch 1.1.1. I'm seeing geo_polygon behave oddly when the
> input polygon cross the date line. From a quick look at
> GeoPolygonFilter.GeoPolygonDocSet.pointInPolygon it doesn't seem that this
> is explicitly handled.
>
> The reproduce this create an index/mapping as:
>
> POST /geo
>
> { "mappings": { "docs": { "properties": { "p": { "type": "geo_point" } } }
> } }
>
> Upload a document:
>
> PUT /geo/docs/1
>
> { "p": { "lat": 40, "lon": 179 } }
>
> Search with a polygon that's a box around the uploaded point and that
> crosses the date line:
>
> POST /geo/docs/_search
>
> {
>   "filter": { "geo_polygon": { "p": { "points": [
>       { "lat": 42, "lon": 178 },
>       { "lat": 39, "lon": 178 },
>       { "lat": 39, "lon": -179 },
>       { "lat": 42, "lon": -179 },
>       { "lat": 42, "lon": 178 }
>   ] } } }
> }
>
> ES returns 0 results. If I use a polygon that stays to the west of the
> date line I do get results:
>
> {
>   "filter": { "geo_polygon": { "p": { "points": [
>       { "lat": 42, "lon": 178 },
>       { "lat": 39, "lon": 178 },
>       { "lat": 39, "lon": 179.5 },
>       { "lat": 42, "lon": 179.5 },
>       { "lat": 42, "lon": 178 }
>   ] } } }
> }
>
> Also, if I use a bounding box query with the same coordinates as the
> initial polygon, it does work:
>
> {
>   "filter": { "geo_bounding_box": { "p":
>     { "top_left": { "lat": 42, "lon": 178 },
>        "bottom_right": { "lat": 39, "lon": -179 }
>      }
>   } }
> }
>
> It seems that this code needs to either split the check into east and west
> checks or normalize the input values. Am I missing something?
>
> Thanks
> -pablo
>
>  --
> You received this message because you are subscribed to the Google Groups
> "elasticsearch" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elasticsearch/598de712-4e0c-405d-9575-52216bbb8692%40googlegroups.com<https://groups.google.com/d/msgid/elasticsearch/598de712-4e0c-405d-9575-52216bbb8692%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/CAGCwEM-DEw%2BzEySk5JsN23pSshtg2Oo8fGHgWcMVYc3SS_4UZA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to