Hi!
I have the following issue:
I have 2 measurements comming via iobroker landing in my influxdb.
One holding the longitude values, The other the latitude values
I tried something like this … but it doesn’t work
from(bucket: "iobroker")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "....parking-position.longitude" and r["_field"] == "value")
|> filter(fn: (r) => r["_measurement"] == "....parking-position.longitude" and r["_field"] == "value")
Now I just have one value field ot select when choosing “Location mode” “Coords”.
This is of course not OK.
What do I have to do to have both values available for GeoMap??
Thanks!
I played around a little bit
when doing to flux like:
from(bucket: "iobroker")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == ".parking-position.longitude" and r["_field"] == "value")
|> set(key: "_field", value: "longitude")
|> toFloat()
and
from(bucket: "iobroker")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == ".parking-position.latitude" and r["_field"] == "value")
|> set(key: "_field", value: "latitude")
|> toFloat()
I can choose two values
but when I choose them latitude for latitude and longitude for longitude I get the yellow message
If I choose both fields latitude there is no error but the result is obviously wrong:
It is not working with both longitude
After reading and playing around I came to the following result which is (almost) fine for me:
from(bucket: "iobroker")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => (r["_measurement"] == ".parking-position.latitude" or r["_measurement"] == ".parking-position.longitude") and r["_field"] == "value")
|> truncateTimeColumn(unit: 1m)
|> pivot(rowKey:["_time"], columnKey: ["_measurement"], valueColumn: "_value")
|> rename(columns: {".parking-position.latitude": "latitude"})
|> rename(columns: {".parking-position.longitude": "longitude"})
|> group()
|> drop(columns: ["_start", "_stop", "_field"])
Is there a chance to change the tooltip to show in a heatmap how often a spot was visited?
1 Like
yosiasz
November 16, 2023, 2:39pm
4
Please post a sample csv or line protocol data. that way we have your data in our influxdb
measurement,tag1,location,.parking-position.latitude,time
.parking-position.latitude,parking,Accord,41.7972,1700152037000000873
measurement,tag1,location,.parking-position.longitude,time
.parking-position.longitude,parking,Accord,-74.2319,1700152037000000873
.parking-position.longitude,parking,Adams Center,-76.0001,1700152037000000873