Choropleth map: custom polygons


#1

Hi,
First of all, thanks for adding the new Choropleth map visualisation! It looks great and I immediately started thinking of places I’d like to start using it :slight_smile:
However, none of the data I want to map is at country level, which appears to be what it currently supports.

It’s great that it has a simple option like country codes for people who don’t have their own polygons stored, but for those of us that have custom polygons in databases it’d be fantastic if we could have the option to use a polygon from a column in the results.
Perhaps if when making the visualisation, the first drop-down was “Polygon source” with options “Country code” and “Column in results”. If ever you wanted, this could then be expanded to also have options such as WOEIDs or even cities as additional simple options, but for me the main thing is definitely custom polygons.
Once you selected “Column in results” the next option would be the data format. I think the minimum options here would need to be GeoJSON and Well Known Text (WKT).

Before the choropleth map was added, i’d requested polygon support for the standard map (What new visualizations would you like to see in Redash?), but I think having this in the choropleth map would be even better for most of the uses I was imagining.
Cheers,
Josh


#2

Hi Josh,

I +1 your request, since I need Brazilian states maps in my work. I’ve tried to build my Redash development VM but I wasn’t able to do it quickly so I decided to improvise:

  • I’ve downloaded a Brazil’s GeoJSON file and renamed it to countries.geo.json
  • Then I changed the name of the fields in order to match original’s fields in countries.geo.json
  • Finally I replaced the old file in /opt/redash/current/client/dist/data (0962607.countries.geo.json) with the new one

It worked like a charm! Unfortunately this was only a workaround because I’ll need new maps from each state in Brazil…

Greetings,

Arnaldo


#3

I +1 this as well. We are utilizing redash more and more and are starting to take advantage of the spatial visualizations, however, all of our analytical data is taken at the County level of the United States. Thank you for a wonderful product!


#4

Supporting additional GeoJSON options is definitely a welcomed addition. If someone wants to create a pull request, it will be great :slight_smile: