# Convert lat and long to geohash

**URL:** https://discuss.elastic.co/t/convert-lat-and-long-to-geohash/197631
**Category:** Kibana
**Created:** [September 1, 2019, 8:11pm UTC](https://discuss.elastic.co/t/convert-lat-and-long-to-geohash/197631 "2019-09-01T20:11:39Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)
#### Post date: [September 2, 2019, 4:17pm UTC](https://discuss.elastic.co/t/convert-lat-and-long-to-geohash/197631/4 "2019-09-02T16:17:53Z")

</div>

hi @Brian_Seel

First What Version are you on?

2nd my understanding is that there is no data type geohash, geohash is an aggregation used to aggregate `geo_point` data.

[https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html)

Apologies but from the one line log line I can not tell, not enough context.

Where did that log come from Logstash?  
Did you create an index\_template manually like in the thread referenced, are you using a beat module?  
Are you trying to manage the template from Logstash?  
Both?

The typically flow if you are creating custom data is ..

1. Create and index template with the desired data types
2. Create your logstash to read, transform and load your data
3. Iterate 1 & 2 till you get it right, may include delete the index template until you get it right
4. Discover and visualize the data. If the data has a geo\_point data type it should show up automatically in the drop downs when you try to create a visualization.

But yes based on that context if "looks" like it is there is a geo\_point data type...

you can check by running these commands in the Dev tools

`GET /name-of-index/_mapping`

And look at the mappings you should see something like this....

```
{
  "city_center" : {
    "mappings" : {
      "properties" : {
        "location" : {
          "type" : "geo_point"
        },
        "name" : {
          "type" : "text"
        }
      }
    }
  }
}

```

and if you run a search it should look something like

```
GET /city/_search

{
  "took" : 0,
  "timed_out" : false,
  "_shards" : {
    "total" : 1,
    "successful" : 1,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 1,
      "relation" : "eq"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "city_center",
        "_type" : "_doc",
        "_id" : "oAzB8mwBheMK44zyIkBj",
        "_score" : 1.0,
        "_source" : {
          "name" : "stamford",
          "location" : [
            -73.554212,
            41.053923
          ]
        }
      }
    ]
  }
}

```

You should also be able to see the index\_templates using this

`GET /_template/name-of-template`

---

_[View the full topic](https://discuss.elastic.co/t/convert-lat-and-long-to-geohash/197631)._
