Now sure whether it’s the right place to ask.
Currently I have the following query to fetch latitude and longitude to show in Grafana map.
Currently there are two plugins, it support for ‘Track Map’ plugin but not display anything in ‘TrackMap’ plugin. Not sure what’s missing from the query.
import "math"
from(bucket: "kafka_signals/oneDay")
|> range(start: -6h)
|> filter(fn: ® =>
r._measurement == “signal” and r.vin==“000015” and
(r[“signal.name”] == “TCU_GPS_Data_Latitude” or r[“signal.name”] == “TCU_GPS_Data_Longitude”))
|> pivot(
rowKey:["_time",“vin”],
columnKey: [“signal.name”],
valueColumn: “_value”)
|> filter(fn: ® =>
r.TCU_GPS_Data_Latitude>0)
|> rename(columns: {TCU_GPS_Data_Latitude: “latitude”})
|> rename(columns: {TCU_GPS_Data_Longitude: “longitude”})
|> filter(fn: ® => r.longitude != math.NaN() and r.latitude != math.NaN())