CLOSE ✕
Get in Touch
Thank you for your interest! Please fill out the form below if you would like to work together.
(If you are looking for my resume, click here)

Thank you! Your submission has been received!

Oops! Something went wrong while submitting the form

Introducing mapscaler

Greg Condit
|
Resource
|
Dec 22, 2020

Introducing mapscaler

SourceDocumentation Examples

Many map visualizations that use color as a dimension are misleading.

Social data is often put on a map (a choropleth), and colored to show some activity or behavior. The problem is that the data is often about people, but to the reader’s eye, maps are inherently about area. The biggest areas on the map get the reader’s attention, ignoring how many people in the data relate to that area. That’s okay if that data you are showing happens to be normalized by area — such as population density — but often this isn’t the goal of our visualizations.

Sometimes a cartogram is a better choice, but most cartograms are either skewed beyond recognition, or highly manual to create. Therefore, I’ve created a Python package to automatically scale the parts of any map by any variable, without any overlapping shapes and with minimal distortion.

Introducing mapscaler! All you need is a GeoPandas DataFrame, including one column that has values by which to scale each polygon. mapscaler will do the heavy lifting from there — scaling each polygon to the appropriate size, then rearranging them (minimally) until they don’t overlap.

Installation

<p>CODE: https://gist.github.com/conditg/44fee3dc943aaad799383257237d502c.js</p>

Dependencies:

  • NumPy
  • GeoPandas
  • Shapely

Simple Example

US Counties scaled & colored by a variable (population) using mapscaler. In practice, the color would be a separate variable for analysis.

<p>CODE: https://gist.github.com/conditg/0069fed75b231853ae70574adabed5d9.js</p>

For more info:

SourceDocumentation Examples

Greg Condit

Recent Blog Posts

Let's Work Together
Contact Me