# How to convert two inserted values in kibana in a single Geopoint

**URL:** <https://discuss.elastic.co/t/how-to-convert-two-inserted-values-in-kibana-in-a-single-geopoint/264153>\
**Category:** Kibana\
**Created:** [February 12, 2021, 3:47pm UTC](https://discuss.elastic.co/t/how-to-convert-two-inserted-values-in-kibana-in-a-single-geopoint/264153 "2021-02-12T15:47:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mheni](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Mheni](https://discuss.elastic.co/u/Mheni)\
**Post date:** [February 12, 2021, 3:47pm UTC](https://discuss.elastic.co/t/how-to-convert-two-inserted-values-in-kibana-in-a-single-geopoint/264153/1 "2021-02-12T15:47:57Z")

</div>

I Insert 2 values(Lat and Long) in Kibana and I want to convert them in a single Geopoint . The Aim is to present them using a heatMap.

---

<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:** [February 12, 2021, 3:54pm UTC](https://discuss.elastic.co/t/how-to-convert-two-inserted-values-in-kibana-in-a-single-geopoint/264153/2 "2021-02-12T15:54:42Z")

</div>

See the geo\_point data type example [here](https://www.elastic.co/guide/en/elasticsearch/reference/current/geo-point.html)

---

<div class="post-metadata">

**Author:** ![Mheni](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@Mheni](https://discuss.elastic.co/u/Mheni)\
**Post date:** [February 12, 2021, 4:20pm UTC](https://discuss.elastic.co/t/how-to-convert-two-inserted-values-in-kibana-in-a-single-geopoint/264153/3 "2021-02-12T16:20:04Z")

</div>

I receive two values "Lat" and "Lon" using sparkstreaming and i would like to convert them to a single geopoint . how to automatically convert them to geopoint.

---

<div class="post-metadata">

**Author:** ![aaron-nimocks](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/aaron-nimocks/32/73965_2.png) [@aaron-nimocks](https://discuss.elastic.co/u/aaron-nimocks)\
**Post date:** [February 12, 2021, 4:30pm UTC](https://discuss.elastic.co/t/how-to-convert-two-inserted-values-in-kibana-in-a-single-geopoint/264153/4 "2021-02-12T16:30:33Z")

</div>

First you create a mapping for your index that will specify that field as a type `geo_point`.

```auto
PUT YOUR-INDEX-NAME
{
  "mappings": {
    "properties": {
      "location": {
        "type": "geo_point"
      }
    }
  }
}

```

Now when you index your field you can provide `lat` and `long` in the below format and it will store them as a `geo_point` and can be used in a heatmap in Maps.

```auto
PUT YOUR-INDEX-NAME/_doc/1
{
  "text": "Geo-point as an object",
  "location": { 
    "lat": 41.12,
    "lon": -71.34
  }
}

```

---

<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:** [March 12, 2021, 4:30pm UTC](https://discuss.elastic.co/t/how-to-convert-two-inserted-values-in-kibana-in-a-single-geopoint/264153/5 "2021-03-12T16:30:34Z")

</div>

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