# Why geo\_distance is filtering in elliptical shape?

**URL:** <https://discuss.elastic.co/t/why-geo-distance-is-filtering-in-elliptical-shape/7352>\
**Category:** Elasticsearch\
**Created:** [April 16, 2012, 4:11pm UTC](https://discuss.elastic.co/t/why-geo-distance-is-filtering-in-elliptical-shape/7352 "2012-04-16T16:11:59Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ondrej\_Bilka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ondrej_bilka/32/2912_2.png) [@Ondrej\_Bilka](https://discuss.elastic.co/u/Ondrej_Bilka)\
**Post date:** [April 16, 2012, 4:11pm UTC](https://discuss.elastic.co/t/why-geo-distance-is-filtering-in-elliptical-shape/7352/1 "2012-04-16T16:11:59Z")

</div>

Hello,  
I have an ES database of GEO objects and I need to search the nearest  
objects around some geo\_point in custom distance and show them on Google  
Map.  
I'm using geo\_distance filter, everything works perfect, but I have  
recognized, that the filter is not filtering in circullar-like distance (in  
exact X km radius), but in some elliptical shape. For better understanding  
I've attached screenshots. I'd like to create google circle on the map to  
show the border of distance, but now it is not accurate because the  
ellipse.  
I don't know the reason, why it is like that, or if I'm doing something  
wrong. Or is it bug?

_Unfiltered Objects_

_Filtered_

[https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)

Filtered - lower zoom to better recognizing the ellipse, on both left and  
right side of the inner circle should be some objects too

[https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)

Many thanks for explanation!

---

<div class="post-metadata">

**Author:** ![Igor\_Motov](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/igor_motov/32/45193_2.png) [@Igor\_Motov](https://discuss.elastic.co/u/Igor_Motov)\
**Post date:** [April 16, 2012, 4:26pm UTC](https://discuss.elastic.co/t/why-geo-distance-is-filtering-in-elliptical-shape/7352/2 "2012-04-16T16:26:17Z")

</div>

Are you using "plane" distance\_type or "arc" distance\_type?

On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:

> Hello,  
> I have an ES database of GEO objects and I need to search the nearest  
> objects around some geo\_point in custom distance and show them on Google  
> Map.  
> I'm using geo\_distance filter, everything works perfect, but I have  
> recognized, that the filter is not filtering in circullar-like distance (in  
> exact X km radius), but in some elliptical shape. For better understanding  
> I've attached screenshots. I'd like to create google circle on the map to  
> show the border of distance, but now it is not accurate because the  
> ellipse.  
> I don't know the reason, why it is like that, or if I'm doing something  
> wrong. Or is it bug?
> 
> _Unfiltered Objects_
> 
> _Filtered_
> 
> [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> 
> Filtered - lower zoom to better recognizing the ellipse, on both left and  
> right side of the inner circle should be some objects too
> 
> [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> 
> Many thanks for explanation!

---

<div class="post-metadata">

**Author:** ![Ondrej\_Bilka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ondrej_bilka/32/2912_2.png) [@Ondrej\_Bilka](https://discuss.elastic.co/u/Ondrej_Bilka)\
**Post date:** [April 17, 2012, 8:32am UTC](https://discuss.elastic.co/t/why-geo-distance-is-filtering-in-elliptical-shape/7352/3 "2012-04-17T08:32:37Z")

</div>

Hi, I' ve tried both with no effect.

Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):

> Are you using "plane" distance\_type or "arc" distance\_type?
> 
> On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> 
> > Hello,  
> > I have an ES database of GEO objects and I need to search the nearest  
> > objects around some geo\_point in custom distance and show them on Google  
> > Map.  
> > I'm using geo\_distance filter, everything works perfect, but I have  
> > recognized, that the filter is not filtering in circullar-like distance (in  
> > exact X km radius), but in some elliptical shape. For better understanding  
> > I've attached screenshots. I'd like to create google circle on the map to  
> > show the border of distance, but now it is not accurate because the  
> > ellipse.  
> > I don't know the reason, why it is like that, or if I'm doing something  
> > wrong. Or is it bug?
> > 
> > _Unfiltered Objects_
> > 
> > _Filtered_
> > 
> > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > 
> > Filtered - lower zoom to better recognizing the ellipse, on both left and  
> > right side of the inner circle should be some objects too
> > 
> > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > 
> > Many thanks for explanation!

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 17, 2012, 1:11pm UTC](https://discuss.elastic.co/t/why-geo-distance-is-filtering-in-elliptical-shape/7352/4 "2012-04-17T13:11:16Z")

</div>

Can you set optimize\_bbox to "none" and see if it makes a difference while  
using arc distance type.

2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)

> Hi, I' ve tried both with no effect.
> 
> Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):
> 
> > Are you using "plane" distance\_type or "arc" distance\_type?
> > 
> > On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> > 
> > > Hello,  
> > > I have an ES database of GEO objects and I need to search the nearest  
> > > objects around some geo\_point in custom distance and show them on Google  
> > > Map.  
> > > I'm using geo\_distance filter, everything works perfect, but I have  
> > > recognized, that the filter is not filtering in circullar-like distance (in  
> > > exact X km radius), but in some elliptical shape. For better understanding  
> > > I've attached screenshots. I'd like to create google circle on the map to  
> > > show the border of distance, but now it is not accurate because the  
> > > ellipse.  
> > > I don't know the reason, why it is like that, or if I'm doing something  
> > > wrong. Or is it bug?
> > > 
> > > _Unfiltered Objects_
> > > 
> > > _Filtered_
> > > 
> > > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > > 
> > > Filtered - lower zoom to better recognizing the ellipse, on both left  
> > > and right side of the inner circle should be some objects too
> > > 
> > > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > > 
> > > Many thanks for explanation!

---

<div class="post-metadata">

**Author:** ![Ondrej\_Bilka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ondrej_bilka/32/2912_2.png) [@Ondrej\_Bilka](https://discuss.elastic.co/u/Ondrej_Bilka)\
**Post date:** [April 17, 2012, 1:30pm UTC](https://discuss.elastic.co/t/why-geo-distance-is-filtering-in-elliptical-shape/7352/5 "2012-04-17T13:30:11Z")

</div>

Thanks for your reply, I set it but it is still the same, no difference.  
I think that with the zoom I use is distance\_type not so important.

Dne úterý, 17. dubna 2012 15:11:16 UTC+2 kimchy napsal(a):

> Can you set optimize\_bbox to "none" and see if it makes a difference while  
> using arc distance type.
> 
> 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> 
> > Hi, I' ve tried both with no effect.
> > 
> > Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):
> > 
> > > Are you using "plane" distance\_type or "arc" distance\_type?
> > > 
> > > On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> > > 
> > > > Hello,  
> > > > I have an ES database of GEO objects and I need to search the nearest  
> > > > objects around some geo\_point in custom distance and show them on Google  
> > > > Map.  
> > > > I'm using geo\_distance filter, everything works perfect, but I have  
> > > > recognized, that the filter is not filtering in circullar-like distance (in  
> > > > exact X km radius), but in some elliptical shape. For better understanding  
> > > > I've attached screenshots. I'd like to create google circle on the map to  
> > > > show the border of distance, but now it is not accurate because the  
> > > > ellipse.  
> > > > I don't know the reason, why it is like that, or if I'm doing something  
> > > > wrong. Or is it bug?
> > > > 
> > > > _Unfiltered Objects_
> > > > 
> > > > _Filtered_
> > > > 
> > > > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > > > 
> > > > Filtered - lower zoom to better recognizing the ellipse, on both left  
> > > > and right side of the inner circle should be some objects too
> > > > 
> > > > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > > > 
> > > > Many thanks for explanation!

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 17, 2012, 1:58pm UTC](https://discuss.elastic.co/t/why-geo-distance-is-filtering-in-elliptical-shape/7352/6 "2012-04-17T13:58:15Z")

</div>

Then thats strange..., can you possibly create a gist recreation where it  
shows the problem?

2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)

> Thanks for your reply, I set it but it is still the same, no difference.  
> I think that with the zoom I use is distance\_type not so important.
> 
> Dne úterý, 17. dubna 2012 15:11:16 UTC+2 kimchy napsal(a):
> 
> > Can you set optimize\_bbox to "none" and see if it makes a difference  
> > while using arc distance type.
> > 
> > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > 
> > > Hi, I' ve tried both with no effect.
> > > 
> > > Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):
> > > 
> > > > Are you using "plane" distance\_type or "arc" distance\_type?
> > > > 
> > > > On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> > > > 
> > > > > Hello,  
> > > > > I have an ES database of GEO objects and I need to search the nearest  
> > > > > objects around some geo\_point in custom distance and show them on Google  
> > > > > Map.  
> > > > > I'm using geo\_distance filter, everything works perfect, but I have  
> > > > > recognized, that the filter is not filtering in circullar-like distance (in  
> > > > > exact X km radius), but in some elliptical shape. For better understanding  
> > > > > I've attached screenshots. I'd like to create google circle on the map to  
> > > > > show the border of distance, but now it is not accurate because the  
> > > > > ellipse.  
> > > > > I don't know the reason, why it is like that, or if I'm doing  
> > > > > something wrong. Or is it bug?
> > > > > 
> > > > > _Unfiltered Objects_
> > > > > 
> > > > > _Filtered_
> > > > > 
> > > > > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > > > > 
> > > > > Filtered - lower zoom to better recognizing the ellipse, on both left  
> > > > > and right side of the inner circle should be some objects too
> > > > > 
> > > > > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > > > > 
> > > > > Many thanks for explanation!

---

<div class="post-metadata">

**Author:** ![Ondrej\_Bilka](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ondrej_bilka/32/2912_2.png) [@Ondrej\_Bilka](https://discuss.elastic.co/u/Ondrej_Bilka)\
**Post date:** [April 17, 2012, 3:46pm UTC](https://discuss.elastic.co/t/why-geo-distance-is-filtering-in-elliptical-shape/7352/7 "2012-04-17T15:46:31Z")

</div>

Yes, very strange. 🙂  
I don't know what to recreate, I'm attaching basic filter query and mapping  
in Elastica plugin, I'm using Elastica only to create document.  
For obtaining data I use PHP curl functions.  
Database has about 150000 items. There is nothing more special about it.

> <https://gist.github.com/anonymous/2406859>

Many thanks!

Dne úterý, 17. dubna 2012 15:58:15 UTC+2 kimchy napsal(a):

> Then thats strange..., can you possibly create a gist recreation where it  
> shows the problem?
> 
> 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> 
> > Thanks for your reply, I set it but it is still the same, no difference.  
> > I think that with the zoom I use is distance\_type not so important.
> > 
> > Dne úterý, 17. dubna 2012 15:11:16 UTC+2 kimchy napsal(a):
> > 
> > > Can you set optimize\_bbox to "none" and see if it makes a difference  
> > > while using arc distance type.
> > > 
> > > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > > 
> > > > Hi, I' ve tried both with no effect.
> > > > 
> > > > Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):
> > > > 
> > > > > Are you using "plane" distance\_type or "arc" distance\_type?
> > > > > 
> > > > > On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> > > > > 
> > > > > > Hello,  
> > > > > > I have an ES database of GEO objects and I need to search the nearest  
> > > > > > objects around some geo\_point in custom distance and show them on Google  
> > > > > > Map.  
> > > > > > I'm using geo\_distance filter, everything works perfect, but I have  
> > > > > > recognized, that the filter is not filtering in circullar-like distance (in  
> > > > > > exact X km radius), but in some elliptical shape. For better understanding  
> > > > > > I've attached screenshots. I'd like to create google circle on the map to  
> > > > > > show the border of distance, but now it is not accurate because the  
> > > > > > ellipse.  
> > > > > > I don't know the reason, why it is like that, or if I'm doing  
> > > > > > something wrong. Or is it bug?
> > > > > > 
> > > > > > _Unfiltered Objects_
> > > > > > 
> > > > > > _Filtered_
> > > > > > 
> > > > > > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > > > > > 
> > > > > > Filtered - lower zoom to better recognizing the ellipse, on both left  
> > > > > > and right side of the inner circle should be some objects too
> > > > > > 
> > > > > > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > > > > > 
> > > > > > Many thanks for explanation!

Dne úterý, 17. dubna 2012 15:58:15 UTC+2 kimchy napsal(a):

> Then thats strange..., can you possibly create a gist recreation where it  
> shows the problem?
> 
> 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> 
> > Thanks for your reply, I set it but it is still the same, no difference.  
> > I think that with the zoom I use is distance\_type not so important.
> > 
> > Dne úterý, 17. dubna 2012 15:11:16 UTC+2 kimchy napsal(a):
> > 
> > > Can you set optimize\_bbox to "none" and see if it makes a difference  
> > > while using arc distance type.
> > > 
> > > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > > 
> > > > Hi, I' ve tried both with no effect.
> > > > 
> > > > Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):
> > > > 
> > > > > Are you using "plane" distance\_type or "arc" distance\_type?
> > > > > 
> > > > > On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> > > > > 
> > > > > > Hello,  
> > > > > > I have an ES database of GEO objects and I need to search the nearest  
> > > > > > objects around some geo\_point in custom distance and show them on Google  
> > > > > > Map.  
> > > > > > I'm using geo\_distance filter, everything works perfect, but I have  
> > > > > > recognized, that the filter is not filtering in circullar-like distance (in  
> > > > > > exact X km radius), but in some elliptical shape. For better understanding  
> > > > > > I've attached screenshots. I'd like to create google circle on the map to  
> > > > > > show the border of distance, but now it is not accurate because the  
> > > > > > ellipse.  
> > > > > > I don't know the reason, why it is like that, or if I'm doing  
> > > > > > something wrong. Or is it bug?
> > > > > > 
> > > > > > _Unfiltered Objects_
> > > > > > 
> > > > > > _Filtered_
> > > > > > 
> > > > > > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > > > > > 
> > > > > > Filtered - lower zoom to better recognizing the ellipse, on both left  
> > > > > > and right side of the inner circle should be some objects too
> > > > > > 
> > > > > > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > > > > > 
> > > > > > Many thanks for explanation!

Dne úterý, 17. dubna 2012 15:58:15 UTC+2 kimchy napsal(a):

> Then thats strange..., can you possibly create a gist recreation where it  
> shows the problem?
> 
> 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> 
> > Thanks for your reply, I set it but it is still the same, no difference.  
> > I think that with the zoom I use is distance\_type not so important.
> > 
> > Dne úterý, 17. dubna 2012 15:11:16 UTC+2 kimchy napsal(a):
> > 
> > > Can you set optimize\_bbox to "none" and see if it makes a difference  
> > > while using arc distance type.
> > > 
> > > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > > 
> > > > Hi, I' ve tried both with no effect.
> > > > 
> > > > Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):
> > > > 
> > > > > Are you using "plane" distance\_type or "arc" distance\_type?
> > > > > 
> > > > > On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> > > > > 
> > > > > > Hello,  
> > > > > > I have an ES database of GEO objects and I need to search the nearest  
> > > > > > objects around some geo\_point in custom distance and show them on Google  
> > > > > > Map.  
> > > > > > I'm using geo\_distance filter, everything works perfect, but I have  
> > > > > > recognized, that the filter is not filtering in circullar-like distance (in  
> > > > > > exact X km radius), but in some elliptical shape. For better understanding  
> > > > > > I've attached screenshots. I'd like to create google circle on the map to  
> > > > > > show the border of distance, but now it is not accurate because the  
> > > > > > ellipse.  
> > > > > > I don't know the reason, why it is like that, or if I'm doing  
> > > > > > something wrong. Or is it bug?
> > > > > > 
> > > > > > _Unfiltered Objects_
> > > > > > 
> > > > > > _Filtered_
> > > > > > 
> > > > > > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > > > > > 
> > > > > > Filtered - lower zoom to better recognizing the ellipse, on both left  
> > > > > > and right side of the inner circle should be some objects too
> > > > > > 
> > > > > > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > > > > > 
> > > > > > Many thanks for explanation!

Dne úterý, 17. dubna 2012 15:58:15 UTC+2 kimchy napsal(a):

> Then thats strange..., can you possibly create a gist recreation where it  
> shows the problem?
> 
> 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> 
> > Thanks for your reply, I set it but it is still the same, no difference.  
> > I think that with the zoom I use is distance\_type not so important.
> > 
> > Dne úterý, 17. dubna 2012 15:11:16 UTC+2 kimchy napsal(a):
> > 
> > > Can you set optimize\_bbox to "none" and see if it makes a difference  
> > > while using arc distance type.
> > > 
> > > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > > 
> > > > Hi, I' ve tried both with no effect.
> > > > 
> > > > Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):
> > > > 
> > > > > Are you using "plane" distance\_type or "arc" distance\_type?
> > > > > 
> > > > > On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> > > > > 
> > > > > > Hello,  
> > > > > > I have an ES database of GEO objects and I need to search the nearest  
> > > > > > objects around some geo\_point in custom distance and show them on Google  
> > > > > > Map.  
> > > > > > I'm using geo\_distance filter, everything works perfect, but I have  
> > > > > > recognized, that the filter is not filtering in circullar-like distance (in  
> > > > > > exact X km radius), but in some elliptical shape. For better understanding  
> > > > > > I've attached screenshots. I'd like to create google circle on the map to  
> > > > > > show the border of distance, but now it is not accurate because the  
> > > > > > ellipse.  
> > > > > > I don't know the reason, why it is like that, or if I'm doing  
> > > > > > something wrong. Or is it bug?
> > > > > > 
> > > > > > _Unfiltered Objects_
> > > > > > 
> > > > > > _Filtered_
> > > > > > 
> > > > > > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > > > > > 
> > > > > > Filtered - lower zoom to better recognizing the ellipse, on both left  
> > > > > > and right side of the inner circle should be some objects too
> > > > > > 
> > > > > > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > > > > > 
> > > > > > Many thanks for explanation!

Dne úterý, 17. dubna 2012 15:58:15 UTC+2 kimchy napsal(a):

> Then thats strange..., can you possibly create a gist recreation where it  
> shows the problem?
> 
> 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> 
> > Thanks for your reply, I set it but it is still the same, no difference.  
> > I think that with the zoom I use is distance\_type not so important.
> > 
> > Dne úterý, 17. dubna 2012 15:11:16 UTC+2 kimchy napsal(a):
> > 
> > > Can you set optimize\_bbox to "none" and see if it makes a difference  
> > > while using arc distance type.
> > > 
> > > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > > 
> > > > Hi, I' ve tried both with no effect.
> > > > 
> > > > Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):
> > > > 
> > > > > Are you using "plane" distance\_type or "arc" distance\_type?
> > > > > 
> > > > > On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> > > > > 
> > > > > > Hello,  
> > > > > > I have an ES database of GEO objects and I need to search the nearest  
> > > > > > objects around some geo\_point in custom distance and show them on Google  
> > > > > > Map.  
> > > > > > I'm using geo\_distance filter, everything works perfect, but I have  
> > > > > > recognized, that the filter is not filtering in circullar-like distance (in  
> > > > > > exact X km radius), but in some elliptical shape. For better understanding  
> > > > > > I've attached screenshots. I'd like to create google circle on the map to  
> > > > > > show the border of distance, but now it is not accurate because the  
> > > > > > ellipse.  
> > > > > > I don't know the reason, why it is like that, or if I'm doing  
> > > > > > something wrong. Or is it bug?
> > > > > > 
> > > > > > _Unfiltered Objects_
> > > > > > 
> > > > > > _Filtered_
> > > > > > 
> > > > > > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > > > > > 
> > > > > > Filtered - lower zoom to better recognizing the ellipse, on both left  
> > > > > > and right side of the inner circle should be some objects too
> > > > > > 
> > > > > > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > > > > > 
> > > > > > Many thanks for explanation!

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [April 19, 2012, 1:27pm UTC](https://discuss.elastic.co/t/why-geo-distance-is-filtering-in-elliptical-shape/7352/8 "2012-04-19T13:27:03Z")

</div>

It would be great to have data set and sample search request that shows the  
problem.

2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)

> Yes, very strange. 🙂  
> I don't know what to recreate, I'm attaching basic filter query and  
> mapping in Elastica plugin, I'm using Elastica only to create document.  
> For obtaining data I use PHP curl functions.  
> Database has about 150000 items. There is nothing more special about it.
> 
> [ElasticSearch geo distance filter · GitHub](https://gist.github.com/2406859)
> 
> Many thanks!
> 
> Dne úterý, 17. dubna 2012 15:58:15 UTC+2 kimchy napsal(a):
> 
> > Then thats strange..., can you possibly create a gist recreation where it  
> > shows the problem?
> > 
> > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > 
> > > Thanks for your reply, I set it but it is still the same, no difference.  
> > > I think that with the zoom I use is distance\_type not so important.
> > > 
> > > Dne úterý, 17. dubna 2012 15:11:16 UTC+2 kimchy napsal(a):
> > > 
> > > > Can you set optimize\_bbox to "none" and see if it makes a difference  
> > > > while using arc distance type.
> > > > 
> > > > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > > > 
> > > > > Hi, I' ve tried both with no effect.
> > > > > 
> > > > > Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):
> > > > > 
> > > > > > Are you using "plane" distance\_type or "arc" distance\_type?
> > > > > > 
> > > > > > On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> > > > > > 
> > > > > > > Hello,  
> > > > > > > I have an ES database of GEO objects and I need to search the  
> > > > > > > nearest objects around some geo\_point in custom distance and show them on  
> > > > > > > Google Map.  
> > > > > > > I'm using geo\_distance filter, everything works perfect, but I have  
> > > > > > > recognized, that the filter is not filtering in circullar-like distance (in  
> > > > > > > exact X km radius), but in some elliptical shape. For better understanding  
> > > > > > > I've attached screenshots. I'd like to create google circle on the map to  
> > > > > > > show the border of distance, but now it is not accurate because the  
> > > > > > > ellipse.  
> > > > > > > I don't know the reason, why it is like that, or if I'm doing  
> > > > > > > something wrong. Or is it bug?
> > > > > > > 
> > > > > > > _Unfiltered Objects_
> > > > > > > 
> > > > > > > _Filtered_
> > > > > > > 
> > > > > > > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > > > > > > 
> > > > > > > Filtered - lower zoom to better recognizing the ellipse, on both  
> > > > > > > left and right side of the inner circle should be some objects too
> > > > > > > 
> > > > > > > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > > > > > > 
> > > > > > > Many thanks for explanation!
> 
> Dne úterý, 17. dubna 2012 15:58:15 UTC+2 kimchy napsal(a):
> 
> > Then thats strange..., can you possibly create a gist recreation where it  
> > shows the problem?
> > 
> > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > 
> > > Thanks for your reply, I set it but it is still the same, no difference.  
> > > I think that with the zoom I use is distance\_type not so important.
> > > 
> > > Dne úterý, 17. dubna 2012 15:11:16 UTC+2 kimchy napsal(a):
> > > 
> > > > Can you set optimize\_bbox to "none" and see if it makes a difference  
> > > > while using arc distance type.
> > > > 
> > > > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > > > 
> > > > > Hi, I' ve tried both with no effect.
> > > > > 
> > > > > Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):
> > > > > 
> > > > > > Are you using "plane" distance\_type or "arc" distance\_type?
> > > > > > 
> > > > > > On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> > > > > > 
> > > > > > > Hello,  
> > > > > > > I have an ES database of GEO objects and I need to search the  
> > > > > > > nearest objects around some geo\_point in custom distance and show them on  
> > > > > > > Google Map.  
> > > > > > > I'm using geo\_distance filter, everything works perfect, but I have  
> > > > > > > recognized, that the filter is not filtering in circullar-like distance (in  
> > > > > > > exact X km radius), but in some elliptical shape. For better understanding  
> > > > > > > I've attached screenshots. I'd like to create google circle on the map to  
> > > > > > > show the border of distance, but now it is not accurate because the  
> > > > > > > ellipse.  
> > > > > > > I don't know the reason, why it is like that, or if I'm doing  
> > > > > > > something wrong. Or is it bug?
> > > > > > > 
> > > > > > > _Unfiltered Objects_
> > > > > > > 
> > > > > > > _Filtered_
> > > > > > > 
> > > > > > > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > > > > > > 
> > > > > > > Filtered - lower zoom to better recognizing the ellipse, on both  
> > > > > > > left and right side of the inner circle should be some objects too
> > > > > > > 
> > > > > > > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > > > > > > 
> > > > > > > Many thanks for explanation!
> 
> Dne úterý, 17. dubna 2012 15:58:15 UTC+2 kimchy napsal(a):
> 
> > Then thats strange..., can you possibly create a gist recreation where it  
> > shows the problem?
> > 
> > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > 
> > > Thanks for your reply, I set it but it is still the same, no difference.  
> > > I think that with the zoom I use is distance\_type not so important.
> > > 
> > > Dne úterý, 17. dubna 2012 15:11:16 UTC+2 kimchy napsal(a):
> > > 
> > > > Can you set optimize\_bbox to "none" and see if it makes a difference  
> > > > while using arc distance type.
> > > > 
> > > > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > > > 
> > > > > Hi, I' ve tried both with no effect.
> > > > > 
> > > > > Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):
> > > > > 
> > > > > > Are you using "plane" distance\_type or "arc" distance\_type?
> > > > > > 
> > > > > > On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> > > > > > 
> > > > > > > Hello,  
> > > > > > > I have an ES database of GEO objects and I need to search the  
> > > > > > > nearest objects around some geo\_point in custom distance and show them on  
> > > > > > > Google Map.  
> > > > > > > I'm using geo\_distance filter, everything works perfect, but I have  
> > > > > > > recognized, that the filter is not filtering in circullar-like distance (in  
> > > > > > > exact X km radius), but in some elliptical shape. For better understanding  
> > > > > > > I've attached screenshots. I'd like to create google circle on the map to  
> > > > > > > show the border of distance, but now it is not accurate because the  
> > > > > > > ellipse.  
> > > > > > > I don't know the reason, why it is like that, or if I'm doing  
> > > > > > > something wrong. Or is it bug?
> > > > > > > 
> > > > > > > _Unfiltered Objects_
> > > > > > > 
> > > > > > > _Filtered_
> > > > > > > 
> > > > > > > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > > > > > > 
> > > > > > > Filtered - lower zoom to better recognizing the ellipse, on both  
> > > > > > > left and right side of the inner circle should be some objects too
> > > > > > > 
> > > > > > > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > > > > > > 
> > > > > > > Many thanks for explanation!
> 
> Dne úterý, 17. dubna 2012 15:58:15 UTC+2 kimchy napsal(a):
> 
> > Then thats strange..., can you possibly create a gist recreation where it  
> > shows the problem?
> > 
> > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > 
> > > Thanks for your reply, I set it but it is still the same, no difference.  
> > > I think that with the zoom I use is distance\_type not so important.
> > > 
> > > Dne úterý, 17. dubna 2012 15:11:16 UTC+2 kimchy napsal(a):
> > > 
> > > > Can you set optimize\_bbox to "none" and see if it makes a difference  
> > > > while using arc distance type.
> > > > 
> > > > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > > > 
> > > > > Hi, I' ve tried both with no effect.
> > > > > 
> > > > > Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):
> > > > > 
> > > > > > Are you using "plane" distance\_type or "arc" distance\_type?
> > > > > > 
> > > > > > On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> > > > > > 
> > > > > > > Hello,  
> > > > > > > I have an ES database of GEO objects and I need to search the  
> > > > > > > nearest objects around some geo\_point in custom distance and show them on  
> > > > > > > Google Map.  
> > > > > > > I'm using geo\_distance filter, everything works perfect, but I have  
> > > > > > > recognized, that the filter is not filtering in circullar-like distance (in  
> > > > > > > exact X km radius), but in some elliptical shape. For better understanding  
> > > > > > > I've attached screenshots. I'd like to create google circle on the map to  
> > > > > > > show the border of distance, but now it is not accurate because the  
> > > > > > > ellipse.  
> > > > > > > I don't know the reason, why it is like that, or if I'm doing  
> > > > > > > something wrong. Or is it bug?
> > > > > > > 
> > > > > > > _Unfiltered Objects_
> > > > > > > 
> > > > > > > _Filtered_
> > > > > > > 
> > > > > > > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > > > > > > 
> > > > > > > Filtered - lower zoom to better recognizing the ellipse, on both  
> > > > > > > left and right side of the inner circle should be some objects too
> > > > > > > 
> > > > > > > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > > > > > > 
> > > > > > > Many thanks for explanation!
> 
> Dne úterý, 17. dubna 2012 15:58:15 UTC+2 kimchy napsal(a):
> 
> > Then thats strange..., can you possibly create a gist recreation where it  
> > shows the problem?
> > 
> > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > 
> > > Thanks for your reply, I set it but it is still the same, no difference.  
> > > I think that with the zoom I use is distance\_type not so important.
> > > 
> > > Dne úterý, 17. dubna 2012 15:11:16 UTC+2 kimchy napsal(a):
> > > 
> > > > Can you set optimize\_bbox to "none" and see if it makes a difference  
> > > > while using arc distance type.
> > > > 
> > > > 2012/4/17 Ondřej Bílka [ondrej.bilka@gmail.com](mailto:ondrej.bilka@gmail.com)
> > > > 
> > > > > Hi, I' ve tried both with no effect.
> > > > > 
> > > > > Dne pondělí, 16. dubna 2012 18:26:17 UTC+2 Igor Motov napsal(a):
> > > > > 
> > > > > > Are you using "plane" distance\_type or "arc" distance\_type?
> > > > > > 
> > > > > > On Monday, April 16, 2012 12:11:59 PM UTC-4, Ondřej Bílka wrote:
> > > > > > 
> > > > > > > Hello,  
> > > > > > > I have an ES database of GEO objects and I need to search the  
> > > > > > > nearest objects around some geo\_point in custom distance and show them on  
> > > > > > > Google Map.  
> > > > > > > I'm using geo\_distance filter, everything works perfect, but I have  
> > > > > > > recognized, that the filter is not filtering in circullar-like distance (in  
> > > > > > > exact X km radius), but in some elliptical shape. For better understanding  
> > > > > > > I've attached screenshots. I'd like to create google circle on the map to  
> > > > > > > show the border of distance, but now it is not accurate because the  
> > > > > > > ellipse.  
> > > > > > > I don't know the reason, why it is like that, or if I'm doing  
> > > > > > > something wrong. Or is it bug?
> > > > > > > 
> > > > > > > _Unfiltered Objects_
> > > > > > > 
> > > > > > > _Filtered_
> > > > > > > 
> > > > > > > [https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2](https://lh3.googleusercontent.com/--Gp7lcyF99E/T4xDv7q7bDI/AAAAAAAAADI/vHp3tPIkEmI/s1600/filtered2)
> > > > > > > 
> > > > > > > Filtered - lower zoom to better recognizing the ellipse, on both  
> > > > > > > left and right side of the inner circle should be some objects too
> > > > > > > 
> > > > > > > [https://lh5.googleusercontent.com/-i\_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq\_7oF\_EgqI/s1600/filtered](https://lh5.googleusercontent.com/-i_kcJfe9Paw/T4xD8PwsNUI/AAAAAAAAADU/Mq_7oF_EgqI/s1600/filtered)
> > > > > > > 
> > > > > > > Many thanks for explanation!

---

<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:** [July 6, 2017, 3:32am UTC](https://discuss.elastic.co/t/why-geo-distance-is-filtering-in-elliptical-shape/7352/9 "2017-07-06T03:32:00Z")

</div>


