Skip to main content

topojson

PyPI version License github actions Conda version

Encode spatial data as topology in Python!

Topojson is a library that is capable of creating a topojson encoded format of nearly any spatial object in Python.

With topojson it is possible to reduce the size of your spatial data. Mostly by orders of magnitude. It is able to do so through:

  • Eliminating redundancy through computation of a topology
  • Fixed-precision integer encoding of coordinates and
  • Simplification and quantization of arcs

See Topojson Documentation Site for all info how to use this package.

Usage

The package can be used in multiple different ways, with the main purpose to create a TopoJSON topology.

See the Python Topojson Documentation Site for all info or this Notebook with some examples, such as the following:

click to open notebook

Click on the image to go the Notebook Viewer with code-snippets how these images are created or visit the Topojson Documentation Site.

Installation

Topojson is available on PyPI and conda-forge:

pip install topojson

In a project managed with uv:

uv add topojson

Or with conda:

conda install -c conda-forge topojson

This package topojson has the following hard dependencies:

  • numpy
  • shapely

Further, optional soft dependencies are:

  • altair - enlarge the experience by visualizing your TopoJSON output
  • simplification - Visvalingam-Whyatt in toposimplify, and a quicker Douglas-Peucker that does not prevent oversimplification
  • geojson - parse string input with GeoJSON data
  • geopandas - parse your TopoJSON output directly into a GeoDataFrame
  • ipywidgets - make your life complete with the interactive experience

Other resources

For a better understanding how the different included simplification algorithms work

  • dp: Douglas–Peucker
  • vw: Visvalingam-Whyatt

You can have a look to this blog post on Line simplification algorithms. There you can find out that the epsilon value for vw is area-based and that the epsilon value for dp is distance-based.

Also, if your source projection is in meters, then it is very likely that your epsilon value should be magnitudes larger than in the examples of the documentation, where the source projection is in degrees.

There is a section on simplification in the book on 'Geocomputation with Python' that describes toposimplification as follow:

The main advantage of .toposimplify is that it is topologically “aware”: it simplifies the combined borders of the polygons (rather than each polygon on its own), thus ensuring that the overlap is maintained.

Get in touch

For now, just use the Github issues. That can be:

  • usage questions
  • bug reports
  • feature suggestions
  • or anything related

Finally, see the Python Topojson Documentation Site for all info how to use this package.

Metadata

Release files for topojson 2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for topojson 2.2
File Size Uploaded
topojson-2.2.tar.gz 102.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for topojson 2.2
File Interpreter ABI Platform
topojson-2.2-py3-none-any.whl Python 3 none any Details

Total release size: 208.7 kB

Release files / topojson-2.2.tar.gz

Download URL topojson-2.2.tar.gz
Size 102.1 kB
Tags Source
SHA-256 checksum
How to use checksums
82ba0f40c24c302fa866b04d453b0318518c93dd01eb21eb07ee3e4a7f8fabb0
BLAKE2b-256 checksum
How to use checksums
4b2ece0e8c236b933970a155dfb38a8c0c3d82b88589694c9ebfb73dfa02bee1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / topojson-2.2-py3-none-any.whl

Download URL topojson-2.2-py3-none-any.whl
Size 106.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ddc017f88d8ee2e8b3deff3d34a03b78146a2227f94a498c0f0ed62f1df839c
BLAKE2b-256 checksum
How to use checksums
c54d6dd7eb3b78ded112efd8762aba834a99e9f8cad67e395290af34182f6c3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page