Adding support for geo queries has been on our roadmap for a long time, but we’re unlikely to get to it in the near future. In the meantime you could store exact lat, long in field values and store geohashes as tags for quick lookup in an area. Would take a little bit of extra work, but I think doable.
I’ve made an app using the node-influx client to pull data and node-geohash for the geohash decoding. Getting the data into a format for Google Maps or Mapbox from there is pretty easy.
I think @pauldix’s suggestion to store the geohash as a tag and lat, lng as fields is the best way to go.
There are a potential analytics that could be done with geo-data that would not require map integration.
I’d like Grafana charts that show when vehicles are moving, their speed and distance traveled over time. I’d be interested in calculating how far my fleet has traveled in the prior day/week/month. Etc.
I am using the world map plugin of grafana, and there is not a good documentation for using Influxdb.
I don’t know how to write and connect those JSON endpoints with grafana.
Here is what I am using,
client = InfluxDBClient('localhost',8086,'first','password','latlnggeo')
geohash = Geohash.encode('latlnglist[0]', 'latlnglist[1]')
latlng_json_body = [{
"measurement": "latlngdata",
"tags": {
"vehicle":"Scooter"
},
"time":"2017-03-24T09:42:12.358946935Z",
"fields":{
"lat":latlnglist[0], #latitude from list
"lng":latlnglist[1], #longitude from list
"geohash":geohash,
"metric":"Count"
}
}
]
client.write_points(latlng_json_body)
indent preformatted text by 4 spaces
I have another question, may be you people can help me with this. I am not posting in the community as this is related to grafana and not influx.
Its about enhancing the use of grafana’s world map plugin.
Thank you.