grafana / worldmap-panel

Worldmap panel plugin for Grafana 3.0 that can be overlaid with circles for data points.
MIT License
311 stars 199 forks source link

Use latitude and longitude if given in table data #144

Closed kylios closed 6 years ago

kylios commented 6 years ago

I've seen a couple issues open for this, and in one of them, you mentioned you'd accept a pull request for this feature. I took a stab at it, and got it working in a local grafana instance that's connected to an influxdb data source with some location data in the form of lat and lon. There was no good place in my pipeline to convert these points to geohash before inserting them into my database, and I figured it would just be nice if this plugin supported rendering latitude and longitude points as well as geohash points.

When reading and formatting table data only, it will look for latitude and longitude specified in the datapoint and use those. If a geohash is provided, then that will override any given latitude and longitude. There is a unit test to show this working.

2018-06-10-144945_1122x1120_escrotum

CLAassistant commented 6 years ago

CLA assistant check
All committers have signed the CLA.

daniellee commented 6 years ago

This looks like a very useful feature - should work well with the sql datasources as well. Thank you!

jacoscaz commented 6 years ago

This is fantastic!

OliPassey commented 6 years ago

Is this in general release now? Is there any documentation? Struggling to get it showing any markings on the map.

Sending data: GPSTracking,subject=Oli,latitude=51.**,longitude=-0.**,country=UK value=10

Which is accepted into InfluxDB ok, but no markers - any ideas / info would be much appreciated.

Edit: Got it working, huge thanks for adding this code @kylios Using with GPSLogger.app Msg Body should be: GPSTracking,Country=UK,Subject=Oli latitude=%LAT,longitude=%LON for anyone interested.

daniellee commented 6 years ago

@OliPassey looks you already got it working. The docs are here: https://github.com/grafana/worldmap-panel#table-data-with-latitude-and-longitude-columns