daq-tools / kotori

A flexible data historian based on InfluxDB, Grafana, MQTT, and more. Free, open, simple.
https://getkotori.org/
GNU Affero General Public License v3.0
110 stars 17 forks source link

Compatibility with Grafana Trackmap Panel #65

Closed amotl closed 2 years ago

amotl commented 3 years ago

Hi there,

people using Kotori for tracking moving objects are often avid fans of the TrackMap Panel for Grafana by @pR0Ps and contributors (cheers!).

As originally reported at #31, it appears that grafana-trackmap-panel expects that the latitude and longitude attributes to be stored within InfluxDB fields. Currently, Kotori stores them into InfluxDB tags instead, based on a simple heuristic.

https://github.com/daq-tools/kotori/blob/0247da5e4ff53a6e46e0c5db85fa71e3f5fa4546/kotori/daq/storage/influx.py#L195-L199

We might think about changing that default behavior and making it configurable instead.

With kind regards, Andreas.

amotl commented 3 years ago

In order to turn off the current behavior, please use Kotori from the repository and adjust those lines within kotori/kotori/daq/storage/influx.py accordingly:

-if "latitude" in data and "longitude" in data: 
+if False and "latitude" in data and "longitude" in data: 
    chunk["tags"]["latitude"] = data["latitude"] 
    chunk["tags"]["longitude"] = data["longitude"] 
    del data['latitude'] 
    del data['longitude']