Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cartogram-1.0.2.tar.gz (57.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cartogram-1.0.2-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file cartogram-1.0.2.tar.gz.

File metadata

  • Download URL: cartogram-1.0.2.tar.gz
  • Upload date:
  • Size: 57.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cartogram-1.0.2.tar.gz
Algorithm Hash digest
SHA256 81ed9fa1c5b68d9c8cb7b96a9c3676e1830f71e1dc4ca765ce432a37e19b55e8
MD5 e263edf0d4cc57e783930fb4d4df0355
BLAKE2b-256 c5fa133f14f1e6c2ee67192cfa0275949992ce44594cb3972cfc656f969dbf15

See more details on using hashes here.

Provenance

The following attestation bundles were made for cartogram-1.0.2.tar.gz:

Publisher: release.yml on austromorph/python-cartogram

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cartogram-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: cartogram-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for cartogram-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 590a89837d64c5403c3f99cbc977a0585f8dc52d1d0b04822d27ecfc547e4eca
MD5 60fb43ea2a0ebffae6845d075a4b27f7
BLAKE2b-256 7d9f95a56aadb39c4367fc91e8a0c39272d9b4557ab4ccd3dc9a8c0f72195c1e

See more details on using hashes here.

Provenance

The following attestation bundles were made for cartogram-1.0.2-py3-none-any.whl:

Publisher: release.yml on austromorph/python-cartogram

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page