# Geo\_shape: Circle query not supported

**URL:** <https://discuss.elastic.co/t/geo-shape-circle-query-not-supported/203436>\
**Category:** Elasticsearch\
**Created:** [October 14, 2019, 11:17am UTC](https://discuss.elastic.co/t/geo-shape-circle-query-not-supported/203436 "2019-10-14T11:17:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pokaleshrey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pokaleshrey/32/48680_2.png) [@pokaleshrey](https://discuss.elastic.co/u/pokaleshrey)\
**Post date:** [October 14, 2019, 11:17am UTC](https://discuss.elastic.co/t/geo-shape-circle-query-not-supported/203436/1 "2019-10-14T11:17:09Z")

</div>

I have a field indexed using below:

> "geometry": {  
> "type": "geo\_shape"  
> }

Above geometry is a LineString.

I want to see if my spatial query i.e. a circle query intersects this line for given radius.

> ```
> "filter": {
> "geo_shape": {
> "geometry": {
> "shape": {
> "type": "circle",
> "radius": "50.0m",
> "coordinates": [
> -71.1538415,
> 44.1631872
> ]
> },
> "relation": "intersects"
> }
> }
> } 
> 
> ```

Error i get is _Circle operation not supported_.

This works great if i use prefix tree.  
I have started using default BKD implementation due less heap usage of this way and better accuracy/performance.

Is there a way that i can achieve above with default geo\_shape implementation ?

Kindly help !

---

<div class="post-metadata">

**Author:** ![Ignacio\_Vera](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ignacio_vera/32/36674_2.png) [@Ignacio\_Vera](https://discuss.elastic.co/u/Ignacio_Vera)\
**Post date:** [October 16, 2019, 8:18am UTC](https://discuss.elastic.co/t/geo-shape-circle-query-not-supported/203436/2 "2019-10-16T08:18:04Z")

</div>

It is currently not supported to query by CIRCLE in the default indexing strategy. The only way to achieve that would be to approximate the circle to a polygon.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![pokaleshrey](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/pokaleshrey/32/48680_2.png) [@pokaleshrey](https://discuss.elastic.co/u/pokaleshrey)\
**Post date:** [October 25, 2019, 9:00am UTC](https://discuss.elastic.co/t/geo-shape-circle-query-not-supported/203436/3 "2019-10-25T09:00:27Z")

</div>

Thanks @Ignacio_Vera.  
The terma created by previous strategy occupies a lot of heap. Hope to see the support for for CIRCLE query soon.  
It will solve a lot of heap problems for people storing and querying spatial data.

---

<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:** [November 22, 2019, 9:05am UTC](https://discuss.elastic.co/t/geo-shape-circle-query-not-supported/203436/4 "2019-11-22T09:05:21Z")

</div>

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