# Geo points lat/lon

**URL:** <https://discuss.elastic.co/t/geo-points-lat-lon/178759>\
**Category:** Elasticsearch\
**Created:** [April 27, 2019, 4:00pm UTC](https://discuss.elastic.co/t/geo-points-lat-lon/178759 "2019-04-27T16:00:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ansamHox](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@ansamHox](https://discuss.elastic.co/u/ansamHox)\
**Post date:** [April 27, 2019, 4:00pm UTC](https://discuss.elastic.co/t/geo-points-lat-lon/178759/1 "2019-04-27T16:00:19Z")

</div>

I have data which is mapped with:

```
 "location" : {
                "properties" : {
                  "lon" : {
                    "type" : "long"
                  },
                  "lat" : {
                    "type" : "long"
                  }
                }
              }

```

I want to use visualization on my dashboard, but Geohash says there's no geo point in my index. Can I change just type from long to geo\_point or I need to use whole field location as geo\_point?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 27, 2019, 4:43pm UTC](https://discuss.elastic.co/t/geo-points-lat-lon/178759/2 "2019-04-27T16:43:41Z")

</div>

You need to define `location` as a geo point.  
You need to reindex.

---

<div class="post-metadata">

**Author:** ![ansamHox](https://avatars.discourse-cdn.com/v4/letter/a/54ee81/32.png) [@ansamHox](https://discuss.elastic.co/u/ansamHox)\
**Post date:** [April 27, 2019, 7:45pm UTC](https://discuss.elastic.co/t/geo-points-lat-lon/178759/3 "2019-04-27T19:45:59Z")

</div>

My question was, should it be

```
"location" : {
                "properties" : {
                  "lon" : {
                    "type" : "geo_point"
                  },
                  "lat" : {
                    "type" : "geo_point"
                  }
                }
              }

```

or must be only one field (without lat and lon)

```
{
    "mappings": {
        "_doc": {
            "properties": {
                "location": {
                    "type": "geo_point"
                }
            }
        }
    }
}

```

EDIT - I tried both, always get an error while reindexing..

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [April 27, 2019, 9:35pm UTC](https://discuss.elastic.co/t/geo-points-lat-lon/178759/4 "2019-04-27T21:35:59Z")

</div>

It must be the later

---

<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:** [May 25, 2019, 9:36pm UTC](https://discuss.elastic.co/t/geo-points-lat-lon/178759/5 "2019-05-25T21:36:03Z")

</div>

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