# Visualizing fading effect of geo points in kibana

**URL:** https://discuss.elastic.co/t/visualizing-fading-effect-of-geo-points-in-kibana/87427
**Category:** Kibana
**Created:** [May 29, 2017, 10:35am UTC](https://discuss.elastic.co/t/visualizing-fading-effect-of-geo-points-in-kibana/87427 "2017-05-29T10:35:31Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![Rahul\_Lao](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Rahul\_Lao](https://discuss.elastic.co/u/Rahul_Lao)
#### Post date: [May 29, 2017, 10:35am UTC](https://discuss.elastic.co/t/visualizing-fading-effect-of-geo-points-in-kibana/87427/1 "2017-05-29T10:35:31Z")

</div>

I am trying to display data in kibana which has geo location attribute in it. Thus i am trying to display it using Tile Map.

I am able to see the points on the map but what i want is to show in a fading effect. That is the most recent data should have higher value for heat map effect on the map while the oldest entry the least value for heat map color.

Is there a way i can do this?

The data that i import using logstash is

> 8702.04,11.3045,46.1689,255.17,345.4,4.23,400fe2,EZY87VZ,false,1.49519499E9,2017-05-19 13:56:30,United Kingdom  
> 9982.2,11.1508,46.5768,260.3,345.11,8.13,400fe2,EZY87VZ,false,1.49519517E9,2017-05-19 13:59:29,United Kingdom  
> 10972.8,10.9876,46.9772,250.97,337.59,0.33,400fe2,EZY87VZ,false,1.49519535E9,2017-05-19 14:02:30,United Kingdom  
> 11582.4,10.7482,47.3419,245.31,334.67,-0.33,400fe2,EZY87VZ,false,1.495195529E9,2017-05-19 14:05:29,United Kingdom  
> 11590.02,10.3498,47.6354,251.07,316.33,-0.33,400fe2,EZY87VZ,false,1.495195709E9,2017-05-19 14:08:29,United Kingdom

As you can see, this dataset has a date attribute as the second last field, i want to use this date to show somehow the last record with date "2017-05-19 14:08:29" as the darkest spot(red) and other lighter and gradually getting lighter in color and thus the fading effect.

Right now all the points are visible on map but with same intensity of color as shown in below snapshot

 ![](https://us1.discourse-cdn.com/elastic/original/3X/3/b/3b0547830236d6ca8bed41a7d86c94f37c74f7bc.PNG)

The metrics used for creating this is

 ![](https://us1.discourse-cdn.com/elastic/original/3X/5/c/5c9ca524b8995f6dcf196466444e7941e2b45515.PNG)

Can someone suggest how can i achieve this.  
Thanks

---

<div class="post-metadata">

### Author: ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)
#### Post date: [May 30, 2017, 5:03am UTC](https://discuss.elastic.co/t/visualizing-fading-effect-of-geo-points-in-kibana/87427/2 "2017-05-30T05:03:13Z")

</div>

This is not currently a feature of our visualizations. Feel free to open up a feature request here: [https://github.com/elastic/kibana/issues](https://github.com/elastic/kibana/issues)

---

<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: [May 30, 2017, 5:49am UTC](https://discuss.elastic.co/t/visualizing-fading-effect-of-geo-points-in-kibana/87427/3 "2017-05-30T05:49:28Z")

</div>

Try doing a max aggregation on the timestamp field, it should do something like what you want.

---

<div class="post-metadata">

### Author: ![Rahul\_Lao](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Rahul\_Lao](https://discuss.elastic.co/u/Rahul_Lao)
#### Post date: [June 9, 2017, 1:08pm UTC](https://discuss.elastic.co/t/visualizing-fading-effect-of-geo-points-in-kibana/87427/4 "2017-06-09T13:08:54Z")

</div>

By adding a new field (myscore) in the dataset and using that i could somehow achieve the fading effect.

Dataset

```
8702.04,11.3045,46.1689,255.17,345.4,4.23,400fe2,EZY87VZ,false,1.49519499E9,2017-05-19 13:56:30,United Kingdom,6
9982.2,11.1508,46.5768,260.3,345.11,8.13,400fe2,EZY87VZ,false,1.49519517E9,2017-05-19 13:59:45,United Kingdom,22
10972.8,10.9876,46.9772,250.97,337.59,0.33,400fe2,EZY87VZ,false,1.49519535E9,2017-05-19 14:03:30,United Kingdom,51
11582.4,10.7482,47.3419,245.31,334.67,-0.33,400fe2,EZY87VZ,false,1.495195529E9,2017-05-19 14:07:29,United Kingdom,111
11590.02,10.3498,47.6354,251.07,316.33,-0.33,400fe2,EZY87VZ,false,1.495195709E9,2017-05-19 14:14:15,United Kingdom,842

```

So as you can see i have added another field (myscore) in the last.

 ![](https://us1.discourse-cdn.com/elastic/original/3X/3/0/309efeb9d7177ec6eedc296b4093cabdf7c2fe75.jpg)

The metric used for creating this is

 ![](https://us1.discourse-cdn.com/elastic/original/3X/d/9/d9195c9ccaf2d5c9f6422e2a8296e755a12ccdcc.PNG)

Options  
 ![](https://us1.discourse-cdn.com/elastic/original/3X/9/5/956bcd990ba9f265730dc7c2a1080014c5ebe3bd.PNG)

---

<div class="post-metadata">

### Author: ![Rahul\_Lao](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Rahul\_Lao](https://discuss.elastic.co/u/Rahul_Lao)
#### Post date: [June 9, 2017, 1:27pm UTC](https://discuss.elastic.co/t/visualizing-fading-effect-of-geo-points-in-kibana/87427/5 "2017-06-09T13:27:50Z")

</div>

@warkolm @tsmalley

The above solution that i have shared was a work around that i could do.

**But this is what i am not looking for.**

I want to use the original dataset, which has a timestamp field in it. I then want to utilize that timestamp to reflect the @timestamp in elasticsearch....which can be done.  
Then i want to fetch records using a query and custom score function such that the most recent ones have highest score and the score gradually decreases with timestamp. This again can be done.

Refer

> [@Correlation/updation of document score on timestamp, during query time in kibana search](https://discuss.elastic.co/t/correlation-updation-of-document-score-on-timestamp-during-query-time-in-kibana-search/88421):
>
> Hello, In Kibana say i am able to populate data using a Tile Map as heat map. Consider below few lines of data that I index in elastic search 3078.48,-96.7991,33.0579,148.39,109.44,0.0,a808c4,,false,1.496753069E9,2017-06-06 14:44:29,United States 9159.24,-87.9397,34.6983,220.73,268.93,-11.38,a086d8,FDX476 ,false,1.496753004E9,2017-06-06 14:41:58,United States 5661.66,-84.9921,38.679,164.45,221.07,13.0,ac1c13,N88GA ,false,1.496753068E9,2017-06-06 14:44:28,United States 518.16,-96.5803,33.20…

Using this discussion i created a score function for timestamp.

So now i have the original dataset without the myscore field, and using my custom query i get results which has score updated according to timestamp.

Query

```
    curl -XGET 'localhost:9200/test/_search?pretty' -H 'Content-Type: application/json' -d'
    {
        "query": {
            "function_score": {
                "gauss": {
                    "@timestamp": {
                          "origin": "1496061764181", 
                          "scale": "1ms", 
                          "decay" : 0.5 
                    }
                }
            }
        }
    }
    '

```

But the problem is that i cannot achieve this fading effect when i consider \_score field. Refer below screenshots.

 ![](https://us1.discourse-cdn.com/elastic/original/3X/9/3/934b576bbf37f110942fd18c1451eecc1f44e8d2.jpg)

Options  
 ![](https://us1.discourse-cdn.com/elastic/original/3X/e/9/e9d1554b7e2821f1da2c15f1c8c3730faa86f575.PNG)

Why is \_score field on hovering over the point not reflecting the score? And why can't the fading effect be achieved with this?

Please can you suggest what can be done.

---

<div class="post-metadata">

### Author: ![tylersmalley](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tylersmalley/32/8833_2.png) [@tylersmalley](https://discuss.elastic.co/u/tylersmalley)
#### Post date: [June 12, 2017, 3:20pm UTC](https://discuss.elastic.co/t/visualizing-fading-effect-of-geo-points-in-kibana/87427/6 "2017-06-12T15:20:26Z")

</div>

@thomasneirynck - mind providing some insights?

---

<div class="post-metadata">

### Author: ![thomasneirynck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/thomasneirynck/32/23313_2.png) [@thomasneirynck](https://discuss.elastic.co/u/thomasneirynck)
#### Post date: [June 13, 2017, 3:02am UTC](https://discuss.elastic.co/t/visualizing-fading-effect-of-geo-points-in-kibana/87427/7 "2017-06-13T03:02:24Z")

</div>

@Rahul_Lao

Can you attach the request/response of that last query?

Open the spy-panel using the little grey arrow on the bottom left. It has two tabs; one with the ES request, and one with the ES response.

thx,

---

<div class="post-metadata">

### Author: ![Rahul\_Lao](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Rahul\_Lao](https://discuss.elastic.co/u/Rahul_Lao)
#### Post date: [June 13, 2017, 1:28pm UTC](https://discuss.elastic.co/t/visualizing-fading-effect-of-geo-points-in-kibana/87427/8 "2017-06-13T13:28:01Z")

</div>

Default – no query in kibana query bar

Elasticsearch request body

```
{
  "query": {
    "bool": {
      "must": [
        {
          "query_string": {
            "query": "*",
            "analyze_wildcard": true
          }
        },
        {
          "range": {
            "@timestamp": {
              "gte": 1494767233584,
              "lte": 1497359233585,
              "format": "epoch_millis"
            }
          }
        }
      ],
      "must_not": []
    }
  },
  "size": 0,
  "_source": {
    "excludes": []
  },
  "aggs": {
    "2": {
      "geohash_grid": {
        "field": "location",
        "precision": 4
      },
      "aggs": {
        "1": {
          "top_hits": {
            "_source": "_score",
            "size": 1,
            "sort": [
              {
                "@timestamp": {
                  "order": "desc"
                }
              }
            ]
          }
        },
        "3": {
          "geo_centroid": {
            "field": "location"
          }
        }
      }
    }
  }
}

```

Elasticsearch response body

```
{
  "took": 1,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 5,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "2": {
      "buckets": [
        {
          "1": {
            "hits": {
              "total": 1,
              "max_score": null,
              "hits": [
                {
                  "_index": "test",
                  "_type": "logs",
                  "_id": "AVxUOuMaCj46ZjiRI0pp",
                  "_score": null,
                  "_source": {},
                  "sort": [
                    1496061764169
                  ]
                }
              ]
            }
          },
          "3": {
            "location": {
              "lat": 46.16889998316765,
              "lon": 11.304499972611666
            }
          },
          "key": "u20n",
          "doc_count": 1
        },
        {
          "1": {
            "hits": {
              "total": 1,
              "max_score": null,
              "hits": [
                {
                  "_index": "test",
                  "_type": "logs",
                  "_id": "AVxUOuMaCj46ZjiRI0ps",
                  "_score": null,
                  "_source": {},
                  "sort": [
                    1496061764180
                  ]
                }
              ]
            }
          },
          "3": {
            "location": {
              "lat": 47.341899974271655,
              "lon": 10.748199932277203
            }
          },
          "key": "u0rt",
          "doc_count": 1
        },
        {
          "1": {
            "hits": {
              "total": 1,
              "max_score": null,
              "hits": [
                {
                  "_index": "test",
                  "_type": "logs",
                  "_id": "AVxUOuMaCj46ZjiRI0pt",
                  "_score": null,
                  "_source": {},
                  "sort": [
                    1496061764181
                  ]
                }
              ]
            }
          },
          "3": {
            "location": {
              "lat": 47.63539994135499,
              "lon": 10.349799860268831
            }
          },
          "key": "u0rq",
          "doc_count": 1
        },
        {
          "1": {
            "hits": {
              "total": 1,
              "max_score": null,
              "hits": [
                {
                  "_index": "test",
                  "_type": "logs",
                  "_id": "AVxUOuMaCj46ZjiRI0pr",
                  "_score": null,
                  "_source": {},
                  "sort": [
                    1496061764178
                  ]
                }
              ]
            }
          },
          "3": {
            "location": {
              "lat": 46.97719993069768,
              "lon": 10.98759999498725
            }
          },
          "key": "u0rg",
          "doc_count": 1
        },
        {
          "1": {
            "hits": {
              "total": 1,
              "max_score": null,
              "hits": [
                {
                  "_index": "test",
                  "_type": "logs",
                  "_id": "AVxUOuMaCj46ZjiRI0pq",
                  "_score": null,
                  "_source": {},
                  "sort": [
                    1496061764171
                  ]
                }
              ]
            }
          },
          "3": {
            "location": {
              "lat": 46.57679993659258,
              "lon": 11.150799840688705
            }
          },
          "key": "u0rb",
          "doc_count": 1
        }
      ]
    }
  },
  "status": 200
}
```

---

<div class="post-metadata">

### Author: ![Rahul\_Lao](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Rahul\_Lao](https://discuss.elastic.co/u/Rahul_Lao)
#### Post date: [June 13, 2017, 1:28pm UTC](https://discuss.elastic.co/t/visualizing-fading-effect-of-geo-points-in-kibana/87427/9 "2017-06-13T13:28:50Z")

</div>

With Query in kibana query bar

Elasticsearch request body

```
{
  "query": {
    "bool": {
      "must": [
        {
          "function_score": {
            "gauss": {
              "@timestamp": {
                "origin": "1496061764181",
                "scale": "1ms",
                "decay": 0.5
              }
            }
          }
        },
        {
          "range": {
            "@timestamp": {
              "gte": 1494767539343,
              "lte": 1497359539343,
              "format": "epoch_millis"
            }
          }
        }
      ],
      "must_not": []
    }
  },
  "size": 0,
  "_source": {
    "excludes": []
  },
  "aggs": {
    "2": {
      "geohash_grid": {
        "field": "location",
        "precision": 4
      },
      "aggs": {
        "1": {
          "top_hits": {
            "_source": "_score",
            "size": 1,
            "sort": [
              {
                "@timestamp": {
                  "order": "desc"
                }
              }
            ]
          }
        },
        "3": {
          "geo_centroid": {
            "field": "location"
          }
        }
      }
    }
  }
}

```

Elasticsearch response body

```
{
  "took": 2,
  "timed_out": false,
  "_shards": {
    "total": 5,
    "successful": 5,
    "failed": 0
  },
  "hits": {
    "total": 5,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "2": {
      "buckets": [
        {
          "1": {
            "hits": {
              "total": 1,
              "max_score": null,
              "hits": [
                {
                  "_index": "test",
                  "_type": "logs",
                  "_id": "AVxUOuMaCj46ZjiRI0pp",
                  "_score": null,
                  "_source": {},
                  "sort": [
                    1496061764169
                  ]
                }
              ]
            }
          },
          "3": {
            "location": {
              "lat": 46.16889998316765,
              "lon": 11.304499972611666
            }
          },
          "key": "u20n",
          "doc_count": 1
        },
        {
          "1": {
            "hits": {
              "total": 1,
              "max_score": null,
              "hits": [
                {
                  "_index": "test",
                  "_type": "logs",
                  "_id": "AVxUOuMaCj46ZjiRI0ps",
                  "_score": null,
                  "_source": {},
                  "sort": [
                    1496061764180
                  ]
                }
              ]
            }
          },
          "3": {
            "location": {
              "lat": 47.341899974271655,
              "lon": 10.748199932277203
            }
          },
          "key": "u0rt",
          "doc_count": 1
        },
        {
          "1": {
            "hits": {
              "total": 1,
              "max_score": null,
              "hits": [
                {
                  "_index": "test",
                  "_type": "logs",
                  "_id": "AVxUOuMaCj46ZjiRI0pt",
                  "_score": null,
                  "_source": {},
                  "sort": [
                    1496061764181
                  ]
                }
              ]
            }
          },
          "3": {
            "location": {
              "lat": 47.63539994135499,
              "lon": 10.349799860268831
            }
          },
          "key": "u0rq",
          "doc_count": 1
        },
        {
          "1": {
            "hits": {
              "total": 1,
              "max_score": null,
              "hits": [
                {
                  "_index": "test",
                  "_type": "logs",
                  "_id": "AVxUOuMaCj46ZjiRI0pr",
                  "_score": null,
                  "_source": {},
                  "sort": [
                    1496061764178
                  ]
                }
              ]
            }
          },
          "3": {
            "location": {
              "lat": 46.97719993069768,
              "lon": 10.98759999498725
            }
          },
          "key": "u0rg",
          "doc_count": 1
        },
        {
          "1": {
            "hits": {
              "total": 1,
              "max_score": null,
              "hits": [
                {
                  "_index": "test",
                  "_type": "logs",
                  "_id": "AVxUOuMaCj46ZjiRI0pq",
                  "_score": null,
                  "_source": {},
                  "sort": [
                    1496061764171
                  ]
                }
              ]
            }
          },
          "3": {
            "location": {
              "lat": 46.57679993659258,
              "lon": 11.150799840688705
            }
          },
          "key": "u0rb",
          "doc_count": 1
        }
      ]
    }
  },
  "status": 200
}

```

Screenshot - \_score is empty in both cases  
 ![](https://us1.discourse-cdn.com/elastic/original/3X/7/d/7da9f8080cc813ff8621d193c9637bbe22dffdbe.png)

---

<div class="post-metadata">

### Author: ![Rahul\_Lao](https://avatars.discourse-cdn.com/v4/letter/r/f0a364/32.png) [@Rahul\_Lao](https://discuss.elastic.co/u/Rahul_Lao)
#### Post date: [June 13, 2017, 1:31pm UTC](https://discuss.elastic.co/t/visualizing-fading-effect-of-geo-points-in-kibana/87427/10 "2017-06-13T13:31:07Z")

</div>

Even running query in discover tab doesnot update the score

 ![](https://us1.discourse-cdn.com/elastic/original/3X/3/f/3faac900cd95765885544fdf8bfe7147928be495.png)

---

<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 11, 2017, 1:31pm UTC](https://discuss.elastic.co/t/visualizing-fading-effect-of-geo-points-in-kibana/87427/11 "2017-07-11T13:31:32Z")

</div>

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