# How to determines if a geo point is within a polygon

**URL:** <https://discuss.elastic.co/t/how-to-determines-if-a-geo-point-is-within-a-polygon/298383>\
**Category:** Elasticsearch\
**Created:** [February 28, 2022, 8:56am UTC](https://discuss.elastic.co/t/how-to-determines-if-a-geo-point-is-within-a-polygon/298383 "2022-02-28T08:56:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![yeziblo](https://avatars.discourse-cdn.com/v4/letter/y/74df32/32.png) [@yeziblo](https://discuss.elastic.co/u/yeziblo)\
**Post date:** [February 28, 2022, 8:56am UTC](https://discuss.elastic.co/t/how-to-determines-if-a-geo-point-is-within-a-polygon/298383/1 "2022-02-28T08:56:42Z")

</div>

Hi team!

I have a question for geo query.

For example, I have a index which name is city, and in this index, I create a field which type is geo\_shape.

Now I have a address's longitude and latitude, I want to get the city that this address belongs to by querying the city index.

Can Elasticsearch do that?

Thanks and have a nice day!

---

<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:** [March 28, 2022, 8:57am UTC](https://discuss.elastic.co/t/how-to-determines-if-a-geo-point-is-within-a-polygon/298383/2 "2022-03-28T08:57:26Z")

</div>

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