Point in polygon search

Hi,

I'm looking for advice (or direction to advice) for the best way to
perform point in polygon searches. My document store holds complex
polygons and the search criteria will be a single geopoint (to return
any polygons it is bounded by). My questions are:

  1. is there any native geofilter for point in polygon? They all seem
    to search stored geopoints on polygon criteria (I want the opposite)

Assuming no, I was planning on returning any polygons that contain
points north + south + east + west of the search geopoint, then doing
a ray-cast in the application to determine results exactly. In this
case:

  1. how much additional performance would storing an additional minimum
    bounded box coords (eg just North West, South East) & searching just
    that vs search on the entire polygons? Im guessing the MBB would
    return more results but be faster?

  2. is there any benefit of storing the polygon coords as geopoint
    types if I'm not going to be using the native geo filters?

Thanks in advance.

On Tuesday, February 7, 2012 at 7:33 AM, Dave Kinkead wrote:

Hi,

I'm looking for advice (or direction to advice) for the best way to
perform point in polygon searches. My document store holds complex
polygons and the search criteria will be a single geopoint (to return
any polygons it is bounded by). My questions are:

  1. is there any native geofilter for point in polygon? They all seem
    to search stored geopoints on polygon criteria (I want the opposite)

No, there is no support for storing polygons and then doing to the docs a point falls within it.

Assuming no, I was planning on returning any polygons that contain
points north + south + east + west of the search geopoint, then doing
a ray-cast in the application to determine results exactly. In this
case:

  1. how much additional performance would storing an additional minimum
    bounded box coords (eg just North West, South East) & searching just
    that vs search on the entire polygons? Im guessing the MBB would
    return more results but be faster?

the less checks you will have the better. You mean storing the bbox in the document,
and checking if the point falls within that bbox?

  1. is there any benefit of storing the polygon coords as geopoint
    types if I'm not going to be using the native geo filters?

You mean indexing them as double types, and doing range query on them? Then there
isn't really a need for the geo type.

Thanks in advance.

On Tuesday, February 7, 2012 3:59:21 AM UTC-8, kimchy wrote:

On Tuesday, February 7, 2012 at 7:33 AM, Dave Kinkead wrote:

  1. is there any native geofilter for point in polygon? They all seem
    to search stored geopoints on polygon criteria (I want the opposite)

No, there is no support for storing polygons and then doing to the docs a
point falls within it.

Just wondering if this was still the case. Are there any new features or
changes to the ES geospatial API since Feb 2012 that now makes this
possible?

--
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+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.