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

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.

See the geo_point data type example here

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.

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

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.

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

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