Dynamic GeoJSON Layer

Good Morning…
I’ll start by stating that I have gone through all of the posts labeled ‘Dynamic GeoJSON Layer’ and did not find any clues… and the posts are over a year old. :wink:

Head banging on keyboard… would love some insight / help

grafana 11.2.0

I have a marker layer in a geomap layer that is displaying positions of people that are being tracked via a pipeline that is fed by LiDAR sensors.
I am attempting to add a dynamic geojson layer on top of that, that displays polygons that are zones in this area. I would also like to set thresholds based on occupancy in the zones, that will make the color of the polygon change based on that data. The zone locations will change from day to day, that is why we are attempting the dynamic layer. The data all comes from influxdb buckets.

Here is my query:

from(bucket: “lidar_zone”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == “zones”)
|> filter(fn: (r) => r._field == “vertices” or r._field == “active_occupants”)
|> pivot(rowKey:[“_time”], columnKey: [“_field”], valueColumn: “_value”)
|> group(columns: [“name”])
|> keep(columns: [“_time”, “vertices”, “active_occupants”, “name”])
|> map(fn: (r) => ({
“name”: r[“name”], // Accessing ‘name’ tag as a column
“active_occupants”: r.active_occupants,
“vertices”: r.vertices
}))
|> yield(name: “geojson_data”)

I am able to receive the correct data from this query, but I am having trouble getting the polygons to draw on the layer.

Panel Config:

{
“annotations”: {
“list”: [
{
“builtIn”: 1,
“datasource”: {
“type”: “grafana”,
“uid”: “-- Grafana --”
},
“enable”: true,
“hide”: true,
“iconColor”: “rgba(0, 211, 255, 1)”,
“name”: “Annotations & Alerts”,
“type”: “dashboard”
}
]
},
“editable”: true,
“fiscalYearStartMonth”: 0,
“graphTooltip”: 0,
“id”: 9,
“links”: ,
“panels”: [
{
“datasource”: {
“default”: true,
“type”: “influxdb”,
“uid”: “bdx01f0iamadcd”
},
“fieldConfig”: {
“defaults”: {
“color”: {
“mode”: “thresholds”
},
“custom”: {
“hideFrom”: {
“legend”: false,
“tooltip”: false,
“viz”: false
}
},
“mappings”: ,
“thresholds”: {
“mode”: “absolute”,
“steps”: [
{
“color”: “green”,
“value”: null
},
{
“color”: “red”,
“value”: 80
}
]
}
},
“overrides”:
},
“gridPos”: {
“h”: 22,
“w”: 20,
“x”: 0,
“y”: 0
},
“id”: 1,
“options”: {
“basemap”: {
“config”: {},
“name”: “Layer 0”,
“opacity”: 0,
“type”: “xyz”
},
“controls”: {
“mouseWheelZoom”: true,
“showAttribution”: false,
“showDebug”: false,
“showMeasure”: false,
“showScale”: false,
“showZoom”: true
},
“layers”: [
{
“config”: {
“dataStyle”: {},
“idField”: “vertices Zone-0”,
“rules”: ,
“src”: “public/maps/example-with-style.geojson”,
“style”: {
“color”: {
“fixed”: “dark-green”
},
“opacity”: 0.4,
“rotation”: {
“fixed”: 0,
“max”: 360,
“min”: -360,
“mode”: “mod”
},
“size”: {
“fixed”: 5,
“max”: 15,
“min”: 2
},
“symbol”: {
“fixed”: “img/icons/marker/circle.svg”,
“mode”: “fixed”
},
“symbolAlign”: {
“horizontal”: “center”,
“vertical”: “center”
},
“textConfig”: {
“fontSize”: 12,
“offsetX”: 0,
“offsetY”: 0,
“textAlign”: “center”,
“textBaseline”: “middle”
}
}
},
“filterData”: {
“id”: “byRefId”,
“options”: “A”
},
“name”: “Layer 2”,
“opacity”: 0.4,
“tooltip”: true,
“type”: “dynamic-geojson”
}
],
“tooltip”: {
“mode”: “details”
},
“view”: {
“allLayers”: true,
“id”: “fit”,
“lat”: 0,
“lon”: 0,
“zoom”: 15
}
},
“pluginVersion”: “11.2.0”,
“targets”: [
{
“datasource”: {
“type”: “influxdb”,
“uid”: “bdx01f0iamadcd”
},
“query”: " from(bucket: "lidar_zone")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == "zones")\n |> filter(fn: (r) => r._field == "vertices" or r._field == "active_occupants")\n |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")\n |> group(columns: ["name"]) \n |> keep(columns: ["_time", "vertices", "active_occupants", "name"])\n |> map(fn: (r) => ({\n "name": r["name"], // Accessing ‘name’ tag as a column\n "active_occupants": r.active_occupants,\n "vertices": r.vertices\n }))\n |> yield(name: "geojson_data")",
“refId”: “A”
},
{
“datasource”: {
“type”: “influxdb”,
“uid”: “bdx01f0iamadcd”
},
“hide”: false,
“query”: “”,
“refId”: “B”
}
],
“title”: “Panel Title”,
“type”: “geomap”
}
],
“refresh”: “5s”,
“schemaVersion”: 39,
“tags”: ,
“templating”: {
“list”:
},
“time”: {
“from”: “now-6h”,
“to”: “now”
},
“timepicker”: {},
“timezone”: “browser”,
“title”: “New dashboard”,
“uid”: “bdzscx92qdlhcd”,
“version”: 13,
“weekStart”: “”
}

sounds worrisome. what is the use of this people tracker

That’s not an issue… I regularly track thousands of people. This is a crowd analysis system. Big public events like music festivals… public safety. We watch dense crowds and people flow… LiDAR is anonymous data!

Might not be an issue for you but one can ask use case.

What does the data look like coming back from influxdb

sorry for the confusion… at first I thought you meant technically tracking people was worrisome… not that the use case might be. :fist_right:

{
“state”: “Done”,
“series”: [
{
“refId”: “A”,
“meta”: {
“typeVersion”: [
0,
0
],
“executedQueryString”: " from(bucket: "lidar_zone")\n |> range(start: 2024-10-04T15:50:48.387Z, stop: 2024-10-04T21:50:48.387Z)\n |> filter(fn: (r) => r._measurement == "zones")\n |> filter(fn: (r) => r._field == "vertices" or r._field == "active_occupants")\n |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")\n |> group(columns: ["name"]) \n |> keep(columns: ["_time", "vertices", "active_occupants", "name"])\n |> map(fn: (r) => ({\n "name": r["name"], // Accessing ‘name’ tag as a column\n "active_occupants": r.active_occupants,\n "vertices": r.vertices\n }))\n |> yield(name: "geojson_data")"
},
“fields”: [
{
“name”: “active_occupants”,
“type”: “number”,
“typeInfo”: {
“frame”: “int64”,
“nullable”: true
},
“labels”: {
“name”: “Zone-0”
},
“config”: {},
“values”: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
“entities”: {},
“state”: {
“calcs”: {
“sum”: 0,
“max”: 0,
“min”: 0,
“logmin”: 1.7976931348623157e+308,
“mean”: 0,
“last”: 0,
“first”: 0,
“lastNotNull”: 0,
“firstNotNull”: 0,
“count”: 15,
“nonNullCount”: 15,
“allIsNull”: false,
“allIsZero”: true,
“range”: 0,
“diff”: 0,
“delta”: 0,
“step”: 0,
“diffperc”: null,
“previousDeltaUp”: true
}
}
},
{
“name”: “vertices”,
“type”: “string”,
“typeInfo”: {
“frame”: “string”,
“nullable”: true
},
“labels”: {
“name”: “Zone-0”
},
“config”: {},
“values”: [
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”,
“[{"x": 14.326321046, "y": 37.579475126}, {"x": 14.326328754, "y": 37.579460663}, {"x": 14.326370694, "y": 37.5794568}, {"x": 14.326364459, "y": 37.579477821}, {"x": 14.326321046, "y": 37.579475126}]”
],
“entities”: {},
“state”: null
}
],
“length”: 15
},
{
“refId”: “A”,
“fields”: [
{
“name”: “active_occupants”,
“type”: “number”,
“typeInfo”: {
“frame”: “int64”,
“nullable”: true
},
“labels”: {
“name”: “Zone-1”
},
“config”: {},
“values”: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
“entities”: {},
“state”: {
“calcs”: {
“sum”: 0,
“max”: 0,
“min”: 0,
“logmin”: 1.7976931348623157e+308,
“mean”: 0,
“last”: 0,
“first”: 0,
“lastNotNull”: 0,
“firstNotNull”: 0,
“count”: 15,
“nonNullCount”: 15,
“allIsNull”: false,
“allIsZero”: true,
“range”: 0,
“diff”: 0,
“delta”: 0,
“step”: 0,
“diffperc”: null,
“previousDeltaUp”: true
}
}
},
{
“name”: “vertices”,
“type”: “string”,
“typeInfo”: {
“frame”: “string”,
“nullable”: true
},
“labels”: {
“name”: “Zone-1”
},
“config”: {},
“values”: [
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”,
“[{"x": 14.325964782, "y": 37.579510251}, {"x": 14.326050702, "y": 37.579510251}, {"x": 14.326046962, "y": 37.579474228}, {"x": 14.325961041, "y": 37.57947324}, {"x": 14.325964782, "y": 37.579510251}]”
],
“entities”: {},
“state”: null
}
],
“length”: 15
}
],
“annotations”: ,
“request”: {
“app”: “dashboard”,
“requestId”: “Q437”,
“timezone”: “browser”,
“panelId”: 1,
“panelPluginId”: “geomap”,
“dashboardUID”: “bdzscx92qdlhcd”,
“range”: {
“from”: “2024-10-04T15:50:48.387Z”,
“to”: “2024-10-04T21:50:48.387Z”,
“raw”: {
“from”: “now-6h”,
“to”: “now”
}
},
“timeInfo”: “”,
“interval”: “10s”,
“intervalMs”: 10000,
“targets”: [
{
“datasource”: {
“type”: “influxdb”,
“uid”: “bdx01f0iamadcd”
},
“query”: " from(bucket: "lidar_zone")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == "zones")\n |> filter(fn: (r) => r._field == "vertices" or r._field == "active_occupants")\n |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")\n |> group(columns: ["name"]) \n |> keep(columns: ["_time", "vertices", "active_occupants", "name"])\n |> map(fn: (r) => ({\n "name": r["name"], // Accessing ‘name’ tag as a column\n "active_occupants": r.active_occupants,\n "vertices": r.vertices\n }))\n |> yield(name: "geojson_data")",
“refId”: “A”
}
],
“maxDataPoints”: 2047,
“scopedVars”: {
“__interval”: {
“value”: “$__interval”
},
“__interval_ms”: {
“value”: “$__interval_ms”
}
},
“startTime”: 1728078648387,
“filters”: ,
“endTime”: 1728078648396
},
“timings”: {
“dataProcessingTime”: 0
},
“structureRev”: 6
}

was asking for the data coming from influxdb not the json blob of your dashboard.

those do not look like geojson, they look like what might be longitude latitude values.

so the dynamic geojson might not work for you

image

That’s my center on your map! I tried to transform to geojson I get this error:
invalid: runtime error @8:6-22:6: map: map object property “geojson” is object type which is not supported in a flux table.

geojson": {
“type”: “Feature”,
“geometry”: {
“type”: “Polygon”, // Assuming vertices form a polygon
“coordinates”: [r.vertices] // GeoJSON expects coordinates as an array of arrays

1 Like

so in flux you cannot post process the result of your query to return geojson string?

maybe you might want to use business text with leaflet or business chart plugin

or

your coordinates should be

"coordinates":[[[13.027317523956874,37.50101042949303]

not
"coordinates":[[[{"x":14.326321046,"y":37.579475126}

Great catch! Thank you. I now have a query that is returning:

2024-10-05 17:15:18.953 geojson {type: Feature, geometry: {type: Polygon, coordinates: [[[14.326321046,37.579475126], [14.326328754,37.579460663], [14.326370694,37.5794568], [14.326364459,37.579477821], [14.326321046,37.579475126]]]}, properties: {name: Zone-0}} Zone-0
2024-10-05 17:15:18.953 geojson {type: Feature, geometry: {type: Polygon, coordinates: [[[14.326321046,37.579475126], [14.326328754,37.579460663], [14.326370694,37.5794568], [14.326364459,37.579477821], [14.326321046,37.579475126]]]}, properties: {name: Zone-0}} Zone-0
2024-10-05 17:15:18.953 geojson {type: Feature, geometry: {type: Polygon, coordinates: [[[14.325964782,37.579510251], [14.326050702,37.579510251], [14.326046962,37.579474228], [14.325961041,37.57947324], [14.325964782,37.579510251]]]}, properties: {name: Zone-1}} Zone-1
2024-10-05 17:15:18.953 geojson {type: Feature, geometry: {type: Polygon, coordinates: [[[14.325964782,37.579510251], [14.326050702,37.579510251], [14.326046962,37.579474228], [14.325961041,37.57947324], [14.325964782,37.579510251]]]}, properties: {name: Zone-1}} Zone-1

So that’s cool!

I still for the life of me get the polygons to appear. Here is the panel json:

{
“id”: 1,
“title”: “Zone Map”,
“gridPos”: {
“h”: 22,
“w”: 20,
“x”: 0,
“y”: 0
},
“targets”: [
{
“datasource”: {
“type”: “influxdb”,
“uid”: “bdx01f0iamadcd”
},
“query”: “import "regexp"\n\nfrom(bucket: "lidar_zone")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == "zones")\n |> filter(fn: (r) => r._field == "vertices")\n |> group()\n |> map(fn: (r) => ({\n r with\n _value: if exists r._value and r._value != "" then\n "{\"type\": \"Feature\", \"geometry\": {\"type\": \"Polygon\", \"coordinates\": [" +\n regexp.replaceAllString(\n r: regexp.compile(v: "{\"x\": *([0-9.]+), *\"y\": *([0-9.]+)}"),\n v: string(v: r._value),\n t: "[$1,$2]"\n ) +\n "]}, \"properties\": {\"name\": \"" + r.name + "\"}}"\n else\n "{\"type\": \"Feature\", \"geometry\": {\"type\": \"Polygon\", \"coordinates\": }, \"properties\": {\"name\": \"" + r.name + "\"}}",\n _field: "geojson"\n }))\n |> keep(columns: ["_time", "_value", "_field", "name"])\n |> yield(name: "geojson_data")”,
“refId”: “A”
}
],
“options”: {
“basemap”: {
“type”: “default”,
“name”: “Layer 0”
},
“controls”: {
“mouseWheelZoom”: true,
“showZoom”: true
},
“layers”: [
{
“config”: {
“src”: “public/maps/countries.geojson”,
“rules”: ,
“style”: {
“size”: {
“fixed”: 5,
“min”: 2,
“max”: 15
},
“color”: {
“fixed”: “dark-green”
},
“opacity”: 0.4,
“symbol”: {
“mode”: “fixed”,
“fixed”: “img/icons/marker/circle.svg”
},
“symbolAlign”: {
“horizontal”: “center”,
“vertical”: “center”
},
“textConfig”: {
“fontSize”: 12,
“textAlign”: “center”,
“textBaseline”: “middle”,
“offsetX”: 0,
“offsetY”: 0
},
“rotation”: {
“fixed”: 0,
“mode”: “mod”,
“min”: -360,
“max”: 360
}
},
“dataStyle”: {}
},
“location”: {
“mode”: “auto”
},
“type”: “dynamic-geojson”,
“name”: “Layer 1”,
“filterData”: {
“id”: “byRefId”,
“options”: “A”
}
}
],
“view”: {
“id”: “zero”,
“lat”: 37.5795,
“lon”: 14.3261,
“zoom”: 18
}
},
“fieldConfig”: {
“defaults”: {
“color”: {
“mode”: “thresholds”
},
“mappings”: ,
“thresholds”: {
“mode”: “absolute”,
“steps”: [
{
“color”: “green”
},
{
“color”: “red”,
“value”: 80
}
]
}
},
“overrides”:
},
“datasource”: {
“default”: true,
“uid”: “bdx01f0iamadcd”,
“type”: “influxdb”
},
“pluginVersion”: “11.2.0”,
“type”: “geomap”
}

still not a valid geojson nor json. needs to have double quotes.

{
	"type": "Polygon",
	"coordinates": [
		[
			[
				13.027317523956875,
				37.50101042949303
			],

read geojson standard.

I do believe that I got it this time:

{“type”:“FeatureCollection”,“features”:[{“type”:“Feature”,“geometry”:{“type”:“Polygon”,“coordinates”:[[[10.08,22.53], [13.84,5.36], [31.4,3.51], [27.01,20.11], [10.08,22.53]]]},“properties”:{“name”:“Zone-0”}},{“type”:“Feature”,“geometry”:{“type”:“Polygon”,“coordinates”:[[[10.08,22.53], [13.84,5.36], [31.4,3.51], [27.01,20.11], [10.08,22.53]]]},“properties”:{“name”:“Zone-0”}}

I still cannot get the polygons to be drawn on the dynamic geojson layer. Any thoughts?

Panel JSON

{
“datasource”: {
“default”: true,
“uid”: “bdx01f0iamadcd”,
“type”: “influxdb”
},
“fieldConfig”: {
“defaults”: {
“custom”: {
“hideFrom”: {
“tooltip”: false,
“viz”: false,
“legend”: false
}
},
“mappings”: ,
“thresholds”: {
“mode”: “absolute”,
“steps”: [
{
“color”: “green”,
“value”: null
},
{
“color”: “red”,
“value”: 80
}
]
},
“color”: {
“mode”: “thresholds”
}
},
“overrides”:
},
“gridPos”: {
“h”: 22,
“w”: 20,
“x”: 0,
“y”: 0
},
“id”: 1,
“options”: {
“view”: {
“allLayers”: false,
“id”: “zero”,
“lat”: 0,
“lon”: 0,
“zoom”: 15,
“lastOnly”: false,
“layer”: “Zone Polygons”,
“padding”: 0
},
“controls”: {
“showZoom”: true,
“mouseWheelZoom”: true,
“showAttribution”: true,
“showScale”: false,
“showMeasure”: false,
“showDebug”: false,
“zoom”: 3
},
“tooltip”: {
“mode”: “details”
},
“basemap”: {
“config”: {},
“name”: “Layer 0”,
“opacity”: 0.9,
“type”: “xyz”
},
“layers”: [
{
“config”: {
“style”: {
“color”: {
“fixed”: “dark-green”
},
“opacity”: 0.4,
“rotation”: {
“fixed”: 0,
“max”: 360,
“min”: -360,
“mode”: “mod”
},
“size”: {
“fixed”: 5,
“max”: 15,
“min”: 2
},
“symbol”: {
“fixed”: “img/icons/marker/circle.svg”,
“mode”: “fixed”
},
“symbolAlign”: {
“horizontal”: “center”,
“vertical”: “center”
},
“textConfig”: {
“fontSize”: 12,
“offsetX”: 0,
“offsetY”: 0,
“textAlign”: “center”,
“textBaseline”: “middle”
}
}
},
“filterData”: {
“id”: “byRefId”,
“options”: “A”
},
“name”: “Zone Polygons”,
“opacity”: 0.4,
“tooltip”: true,
“type”: “geojson”
}
]
},
“pluginVersion”: “11.2.0”,
“targets”: [
{
“datasource”: {
“type”: “influxdb”,
“uid”: “bdx01f0iamadcd”
},
“query”: “import "regexp"\n\nfrom(bucket: "lidar_zone")\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop)\n |> filter(fn: (r) => r._measurement == "zones" and r._field == "vertices")\n |> group()\n |> map(fn: (r) => ({\n r with\n _value: "{\"type\":\"Feature\",\"geometry\":{\"type\":\"Polygon\",\"coordinates\":[" +\n regexp.replaceAllString(\n r: regexp.compile(v: "\\{\"x\": *([^,]+), *\"y\": *([^\\}]+)\\}"),\n v: r._value,\n t: "[$1,$2]"\n ) +\n "]},\"properties\":{\"name\":\"" + r.name + "\"}}"\n }))\n |> reduce(fn: (r, accumulator) => ({\n features: accumulator.features + (if accumulator.features != "" then "," else "") + r._value\n }), identity: {features: ""})\n |> map(fn: (r) => ({\n _value: "{\"type\":\"FeatureCollection\",\"features\":[" + r.features + "]}"\n }))\n |> yield(name: "geojson_data")”,
“refId”: “A”
}
],
“title”: “Zone Map”,
“type”: “geomap”
}

please vet your geojson data if it is a valid json first
also no need to keep posting your dashboard json model

the geojson you posted is not valid json.