# What happens if coordinates are stored lat,lon instead of lon,lat?

**URL:** <https://discuss.elastic.co/t/what-happens-if-coordinates-are-stored-lat-lon-instead-of-lon-lat/135423>\
**Category:** Elasticsearch\
**Created:** [June 11, 2018, 6:56pm UTC](https://discuss.elastic.co/t/what-happens-if-coordinates-are-stored-lat-lon-instead-of-lon-lat/135423 "2018-06-11T18:56:52Z")\
**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:** [June 11, 2018, 6:56pm UTC](https://discuss.elastic.co/t/what-happens-if-coordinates-are-stored-lat-lon-instead-of-lon-lat/135423/1 "2018-06-11T18:56:53Z")

</div>

I have a big index in which i have used geo\_point and geo\_shape (of type lineString).

The way i have stored coordinates in both above field is (lat,lon) and not (lon,lat as per documentation).

My distance queries work good, as my search queries too are with (lat,lon).

Can you foresee any problem if i continue using this format ?  
What can go wrong ?

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 14, 2018, 9:32am UTC](https://discuss.elastic.co/t/what-happens-if-coordinates-are-stored-lat-lon-instead-of-lon-lat/135423/2 "2018-06-14T09:32:04Z")

</div>

We support all these formats - [https://www.elastic.co/guide/en/elasticsearch/reference/6.3/geo-point.html](https://www.elastic.co/guide/en/elasticsearch/reference/6.3/geo-point.html)

So it really depends how they are mapped I guess. But if someone assumes it's lon,lat and starts querying, then they will have a weird time 😉

---

<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:** [June 19, 2018, 7:03pm UTC](https://discuss.elastic.co/t/what-happens-if-coordinates-are-stored-lat-lon-instead-of-lon-lat/135423/3 "2018-06-19T19:03:35Z")

</div>

Thanks Mark. This question was mostly related to array format. And you are correct i had stored [lat lon] for my geo\_shape, and it gives weird results. After making it [lon lat] as per GeoJson standard, it started behaving properly.  
I have increased the precision to get better results. Now i am struggling with the indexing time vs accuracy problem.

---

<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 17, 2018, 7:03pm UTC](https://discuss.elastic.co/t/what-happens-if-coordinates-are-stored-lat-lon-instead-of-lon-lat/135423/4 "2018-07-17T19:03:48Z")

</div>

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