# Is the given point inside a Geo Shape?

**URL:** <https://discuss.elastic.co/t/is-the-given-point-inside-a-geo-shape/78949>\
**Category:** Elasticsearch\
**Created:** [March 17, 2017, 1:57am UTC](https://discuss.elastic.co/t/is-the-given-point-inside-a-geo-shape/78949 "2017-03-17T01:57:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![damian-pf](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/damian-pf/32/16444_2.png) [@damian-pf](https://discuss.elastic.co/u/damian-pf)\
**Post date:** [March 17, 2017, 1:57am UTC](https://discuss.elastic.co/t/is-the-given-point-inside-a-geo-shape/78949/1 "2017-03-17T01:57:56Z")

</div>

Hey guys could someone help me a bit with this query?

I need a query that I can pass a latitude/longitude point to and it will return any of the stored GeoShapes that the point is inside.

Bonus points: I also need to check if the point is within (say) 100m of a stored point.

For context: I have documents that either have an associated GeoShape or a latitude/longitude.

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [March 20, 2017, 9:21am UTC](https://discuss.elastic.co/t/is-the-given-point-inside-a-geo-shape/78949/2 "2017-03-20T09:21:23Z")

</div>

Hey,

geo shapes support a specific geo shape called a point, which you can use to query for documents that have this point within their shape. See [https://www.elastic.co/guide/en/elasticsearch/reference/5.2/geo-shape.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/geo-shape.html)

The example in the documentation contains such a query (it's just inverted) [https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-geo-shape-query.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.2/query-dsl-geo-shape-query.html)

If you need to search by distance you might need to add a special geo point and use the geo distance query though.

--Alex

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 17, 2017, 9:21am UTC](https://discuss.elastic.co/t/is-the-given-point-inside-a-geo-shape/78949/3 "2017-04-17T09:21:25Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
