Did you get this working in the end Maarten?

I have the same problem with the way 'intersects' works and Jilles's 
solution doesn't work for me; possibly due to the 'tree_levels' accuracy 
for quad tree.

As a kind of workaround, I was thinking that you could draw 2 'envelope' 
geo_shape intersection; one vertical and one horizontal.
Using a boolean filter you could reduce your results to only the polygons 
which intersect BOTH intersections.

It would look something like this:

<https://lh3.googleusercontent.com/-NkNXyNjCLwQ/U6wBLrRIbNI/AAAAAAAAJkU/383LpZNwVzE/s1600/bbox.png>

Here's an example of the query:

https://gist.github.com/missinglink/ce25f1f9f7554ff1010f


Unfortunately I couldn't get this working either, do you think this may be 
a simpler workaround for the 'intersects' issue?

-P



On Tuesday, 5 March 2013 14:17:01 UTC+1, Jilles van Gurp wrote:
>
> Actually, I was wrong again. I did make it work in the end.
>
> If others want to replicate my experiment, I pasted a few sample queries 
> and responses as well as the data and mapping I indexed here: 
> http://pastebin.com/QpXvYK5B
>
> The first query shows that a query with a circle of 1m radius returns 
> Berlin and Mitte for a circle near Rosenthalerplatz. So, the 1m circle 
> polygon intersects with both polygons that fully contain the circle polygon.
>
> If I increase the radius to 300 meter it also finds the nearby pois. There 
> is a problem with accuracy though. I noticed that 100 meter doesn't return 
> any of the pois. even though I know that it should have returned a few. If 
> I increase to 150 it returns the Prenzlauerberg polygon but still no POIs. 
> At 157 still the same. At 158, I suddenly get 8 results. 
>
> I might be able to improve the accuracy by playing with the levels in the 
> mapping.
>
> So what might be happening is that you are running into this accuracy 
> issue here as well. If you haven't already, upgrading to a post 0.90-beta1 
> snapshot build might help you. That would get you the changes made a few 
> days ago to the geo_shape implementation.
>
> Jilles
>
>
>
>
> On Monday, March 4, 2013 6:44:10 PM UTC+1, Maarten Janssen wrote:
>>
>> Or even better a new ShapeRelation should be produced called CONTAINS or 
>> IS_PART_OF where you get do the other way around. In our case (I think we 
>> need the same approach) we could go top down and match first all the 
>> polygons, and then use indeed a contains method, but in my opnion it should 
>> be part of the spatial search capabilities.
>>
>>
>> On Mon, Mar 4, 2013 at 6:33 PM, Jilles van Gurp <jilles...@gmail.com> 
>> wrote:
>>
>>> Hmm, I just tried this and it seems you are right. Very annoying. I 
>>> guess was assuming too much about intersects.
>>>
>>> I guess you could turn things around and use a really large circle that 
>>> for sure includes all the polygons you care about and then do a filter on 
>>> polygon containment after you get the results. My library offers a contains 
>>> function. But that is far from ideal.
>>>
>>> This sounds like it might be a bug though since technically a large 
>>> feature should intersect with any small feature contained by it. 
>>>
>>> Jilles
>>>
>>>
>>>  
>>>
>>>  -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "elasticsearch" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/elasticsearch/bDUQKTK0oe0/unsubscribe?hl=en-US
>>> .
>>> To unsubscribe from this group and all its topics, send an email to 
>>> elasticsearc...@googlegroups.com.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>  
>>>  
>>>
>>
>>
>>
>> -- 
>> Maarten Janssen
>> CTO Infohubble
>>
>> Email:  mjan...@infohubble.com
>> URL:    www.infohubble.com
>> Mobile: +31620006790
>> Card:   eee.am/mjanssen
>>
>> *Address:*
>>
>> Infohubble BV
>> Gebouw Sevilla
>> Entrada 304
>> 1096 ED Amsterdam
>> The Netherlands
>>  
>

-- 
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 elasticsearch+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elasticsearch/efa8d361-fc4f-46fb-9e99-d40910caa395%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to