MapScaler
Scale areas of a geopandas map by any property (such as population) - without the shapes overlapping - to create more intuitive and beautiful choropleth visualizations.
Quick Start:
Suppose you have a GeoPandas Dataframe df, including a column scaleby that is a float column indicating how much each sample should grow or shrink to reflect each location's respective population. The goal is for the area of each location to visually portray it's contribution to the entire map for your chosen variable (population, in this example).
import mapscaler as ms
ss = ms.ShapeScaler()
scaled_df = ss.scale_map(df, 'scaleby')
The above code returns a new GeoPandas dataframe with an updated geometry column, with each shape's area having been scaled (up or down) to reflect its respective scalar.
Similarly, all shapes can be converted to circles before scaling by using the BubbleScaler:
import mapscaler as ms
bs = ms.BubbleScaler()
scaled_df = bs.scale_map(df, 'scaleby')
More realistically, you may need to tweak a few arguments to get an ideal map, depending on the distribution of your initial areas and the distribution of your scalars. See the documentation for full examples.
Release files for mapscaler 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mapscaler-0.0.4.tar.gz | 1.7 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mapscaler-0.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 3.4 MB
Release files / mapscaler-0.0.4.tar.gz
| Download URL | mapscaler-0.0.4.tar.gz |
|---|---|
| Size | 1.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
284e6a9ecf9911bdfc5a5b0b79279d2f7a4421c064ec0daf5661de9b2e713b96
|
|
BLAKE2b-256 checksum How to use checksums |
b619b3fdba63546412ed02a10df57ae627ea58af3502f7ee2919a5f208a15e21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200529 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|
Release files / mapscaler-0.0.4-py3-none-any.whl
| Download URL | mapscaler-0.0.4-py3-none-any.whl |
|---|---|
| Size | 1.7 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
042a5835d345b1edc799648a1ae76a9a2e141122f384bfc10c4c96d4e4cd868e
|
|
BLAKE2b-256 checksum How to use checksums |
f6a84c09a3f50b9c2f96569025f33f66d30974378ebbd63895c2444c5dcd6cbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/47.1.1.post20200529 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2
|