woutervh- / grafana-mapbox

Grafana mapbox-gl panel plugin
Apache License 2.0
5 stars 0 forks source link

lat & lon from influx coordinate data (NMEA2000 navigation.position) how to? #1

Open virtuvas opened 3 years ago

virtuvas commented 3 years ago

hi there,

would really like to use your panel but I'm struggling on how to format the data to achieve it. Studied the animated gif, failed miserably...

What I have is a GPS giving me NMEA2000 formatted position data, which through signalK come to an influxDB. Querying from grafana I get:

Latitude in Query A SELECT last("lat") AS "latitude" FROM "navigation.position" WHERE $timeFilter GROUP BY time($__interval) fill(null)

and Longitude in Query B SELECT mean("lon") AS "longitude" FROM "navigation.position" WHERE $timeFilter GROUP BY time($__interval) fill(null)

tried: Time column name: time Location data: Geo-coordinate Laititude column name: A, or latitude or Latidude, or lat Longitude column name: B, or longitude or Longitude, or lon

map comes up but empty. I know I have values there, when I swap the panel to Graph, it shows two parallel lines (boat is stationary now)

I'm surely missing something (and it's only a couple of days that I started with influxdb and grafana...) could you please give me some pointers?

cheers

V.

virtuvas commented 3 years ago

found it!

OK, you only do one query: SELECT mean("lat") AS "latitude", mean("lon") AS "longitude" FROM "navigation.position" WHERE $timeFilter GROUP BY time($__interval) fill(null) in TABLE format, then select the panel and make sure you got the settings right: Time Geo-coordinate latitude longitude and you should be OK.

Now, only if I could have a set scale so that I can view just the part of the globe in need (not moving that much, an area 100km would do)

cheers

V.