Paint areas in map according to query - impossible?

Good morning, everyone!

I’m working with a GeoJSON map that delineates several named areas, specifically labeled ‘A’, ‘B’, ‘C’, and ‘D’. Alongside this, I have a database table mapping these area names to associated values or costs, structured with two columns: name (‘A’, ‘B’, ‘C’, ‘D’) and value (120, 150, 360, 10).

My goal is to visually represent these values on the map by coloring the areas based on certain value thresholds. This concept is similar to what’s demonstrated in this video: Visual Representation Example. However, I’ve encountered challenges in achieving this, and previous discussions, such as this one on the Grafana community forum, haven’t led to a resolution.

I considered using the Cities Orchestra plugin as a potential solution, given its capabilities for integrating GEOJSON data for visual representation. Unfortunately, while I can successfully upload my GEOJSON file to GeoMap, I haven’t been able to do the same with Cities Orchestra. My current setup with GeoMap allows me to display the areas, but I’m looking to enhance this by coloring the areas based on the values linked to each name, as determined by a database query.

Here’s what I currently have on the standard GeoMap:

I’m seeking advice on how to achieve the desired visualization, where the areas are colored according to their associated values from the database. If anyone has experience with this or can offer insights on how to leverage Cities Orchestra (or any other tool/plugin) for this purpose, your guidance would be greatly appreciated!

Bumping the thread.
After some careful analysis, I found out that GeoMap works filtering static data from the geojson. Now i’m trying to make a script to generate the geojson values dynamically. However still doesn’t seem to be that hard to integrate polygon data from geojson + values from queries.

that feature should be available in 10.4

2 Likes

Thank you for your reply. In the meantime, i’m using the static geojson styling features. Figured that using a script to overwrite the geojson files prompts an update on the dashboard.

Looking again at the github, it seems that this won’t help my case. Again, the objective is to have the areas defined by the geojson and all the styling coming from the SQL Queries, with the relationships between the polygons/areas and the queries being only the names.

I know your pain :slight_smile: I asked for that feature as well
give is a thumbs up so it gets visibility or fork grafana and copy the code from orchestra city to be able to query from database.

geomap is one of the weirdest plugins as it works with either a url or geojson file on disk.

but the new preview feature of dynamic geojson might also be of interest to you.

if you can change the url in that geojson field dynamically then you can use geomap otherwise you need to use orchestra city.

but geomap needs to implement what you mention.

another option is this plugin

Is it already possible to do it with orchestra? How can I do it? There is little to no documentation. Could you provide help?

sorry I meant to say you can query a database in orchestra plugin not color things

I am trying to see if one can use Dynamic Text plugin and do mapping using leaflet.js

so far nothing to report on it

@leandrofavaretto26

This might be of interest to you using leaflet.js until geomap comes with query from sql feature and when orchestra cities comes with polygon color feature.