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:
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:
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?
is there any benefit of storing the polygon coords as geopoint
types if I'm not going to be using the native geo filters?
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:
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:
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?
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.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.