Compute continous cartograms (anamorphic maps)
Project description
Compute continous cartograms (anamorphic maps)
This is a Python package to compute cartograms from geopandas.GeoDataFrames
, using the algorithm presented in Dougenik et al. (1985). It is the ‘sister project’ and Python implementation of our QGIS plugin which continues to be available.
Installation
cartogram
is available from the PyPi package
repository, install it, for instance, using pip
:
pip install cartogram
Quick start
Input data
You will need a polygon data set in any format readable by
geopandas
that
features a numeric attribute column to use as the relative target values to base
the cartogram distortion on.
If you want to have a quick try-out, see the population data for Austrian
provinces in the tests/data
directory of this repository.
Cartogram creation
import cartogram
import geopandas
df = geopandas.read_file("input-data.gpkg")
c = cartogram.Cartogram(df, column="population")
c.to_file("output-data.gpkg")
Documentation
Find more detailed examples and an API reference at https://python-cartogram.readthedocs.io/.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cartogram-0.0.2.tar.gz
.
File metadata
- Download URL: cartogram-0.0.2.tar.gz
- Upload date:
- Size: 17.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34b237ddda54e0316cc06281753d759c3d29095b4054f93b7ff7e9071ca8e2bf |
|
MD5 | 18ae33f3f714111b2a046411a760b4e8 |
|
BLAKE2b-256 | 9735982029ff13b0ae60908d1a10596c3dc15746e184b34f76fb375661f1986a |
File details
Details for the file cartogram-0.0.2-py3-none-any.whl
.
File metadata
- Download URL: cartogram-0.0.2-py3-none-any.whl
- Upload date:
- Size: 17.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93e39addec33380f755d410344321b0ac98c88949de66c37647300a6a91688da |
|
MD5 | 9582d79217817d6bbcb54b2ba10e2c23 |
|
BLAKE2b-256 | 779f2f74a8989b59ef0af3c5cc2da4c8af5b821607afed57eb78dea34770f989 |