Hi Team,
We are working on showing kpi per region across the nation and we thought this geomap might help us!
So we have a static geojson file with customized regions, each region has an “id” in geojson, this “id” can be linked to our kpi data in mysql db.
And our goal is:
- filter region with template variable (so only selected region from geojson is shown/popup)
- show regions in different colors based on kpi value from db datasource.
So far we have load our geojson in “dynamic geojson” layer as /public/gazetteer/test.geojson as blow:
The shapes can be shown in geomap panel (bravo!)
However i am confused about the dynamic part (very limited documentation about this alpha layer, other than “providing dynamic styling on geojson”), it asks for a data filter:
Which i guess should be a query of the geojson in “GeoJson URL”, but how can we query that? Can geojson in /public/ be added as a data source somehow? Is there any example on this?
Or “dynamic geojson” actually means we can generate geojson dynamically? rather than load the file into /public?
Thank you for any insights in this! And thanks for createing this wonderful geomap panel as well.
Hi Yosiasz,
Thank you! We actually have come across this thread before we post.
The solution in this thread seems to involve loading geojson in postgres, read the geosjon, process and query and reassemble then load back to grafana as we web service endpoint.
We are looking for a more native approach, so we are wondering how this grafana native “dynamic geojson” layer works. Does it allow to dynamically generate geojson based on grafana query results or does it to query a static geojson file.
1 Like
Reads local file. Where did you read this dynamic feature?
But you already are reading kpi stuff from my sql so what’s the problem with loading your data in a db?
I have a possibly similar question and wonder if you got this to work? I don’t need the GeoJSON to be generated dynamically, but I do want to render the styles dynamically based upon the panel’s query (change the polygon color, for example). I can load the GeoJSON file just fine (GeoJSON URL field) and also specify the query (in the Data field). I assume the ID Field is how to match and associate data from the query with each feature in the GeoJSON, but what property in each GeoJSON are we supposed to matching to?