However, searching for intersection between a point and a circle (is this
point in a circle) doesn't seem to work. Checking if a point is in a
polygon can be done like this:
So that will check if the point (150, -30) is in the polygon with the id
GKN.. But if the "polygon" is instead a circle, I don't get any hits
(regardless of how big I make the circle). Since the search is for a
geo_shape and got a geo_circle and a geo_polygon are geo_shapes, it seems
like this should work.
It's my impression, and indeed experience, that searching a distance from a
geo_point means that the distance is a radius, and therefore the search is
a circular shape. No need for an explicit shape: A circle is nothing more
than a distance from a point.
So here's my use case: say that you have 50 points, with different radii.
A new point is added and I want to check, is this point within any of the
other 50 circles. I can't do just a search for a distance, because there's
no one distance to search for. Does that make sense?
On Tuesday, 1 April 2014 04:46:17 UTC+11, InquiringMind wrote:
It's my impression, and indeed experience, that searching a distance from
a geo_point means that the distance is a radius, and therefore the search
is a circular shape. No need for an explicit shape: A circle is nothing
more than a distance from a point.
So here's my use case: say that you have 50 points, with different radii.
A new point is added and I want to check, is this point within any of the
other 50 circles. I can't do just a search for a distance, because there's
no one distance to search for. Does that make sense?
On Tuesday, 1 April 2014 04:46:17 UTC+11, InquiringMind wrote:
It's my impression, and indeed experience, that searching a distance from
a geo_point means that the distance is a radius, and therefore the search
is a circular shape. No need for an explicit shape: A circle is nothing
more than a distance from a point.
Look for the circle2polygon method. It's in Java but it's quite easy to
convert it to other languages since it is a simple static method. Using
that you should be able to use the geo_shape query to do intersects queries
on es. Would actually be nice if they added support for circles using
something like this. I guess the main issue is figuring out how many
segments you need on the circle.
Jilles
On Thursday, July 10, 2014 10:51:03 AM UTC+2, Silviu Rosu wrote:
I am having the same problem with the search all assets that have a circle
that intersects a point. Did somebody have a solution to this?
@Silviu, sorry I never got around to submitting a "complete example,
including mapping, indexing and searching" and instead worked around it
with polygons. If you have the energy it would be great to get that example
submitted.
Cheers,
Viktor
On Friday, 11 July 2014 00:38:12 UTC+10, Jilles van Gurp wrote:
Look for the circle2polygon method. It's in Java but it's quite easy to
convert it to other languages since it is a simple static method. Using
that you should be able to use the geo_shape query to do intersects queries
on es. Would actually be nice if they added support for circles using
something like this. I guess the main issue is figuring out how many
segments you need on the circle.
Jilles
On Thursday, July 10, 2014 10:51:03 AM UTC+2, Silviu Rosu wrote:
I am having the same problem with the search all assets that have a
circle
that intersects a point. Did somebody have a solution to this?
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.