mapchete 2026.4.0


pip install mapchete

  Latest version

Released: Apr 02, 2026

Project Links

Meta
Author: Joachim Ungar
Requires Python: >=3.10

Classifiers

Development Status
  • 5 - Production/Stable

Intended Audience
  • Developers

License
  • OSI Approved :: MIT License

Programming Language
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13

Topic
  • Scientific/Engineering :: GIS
https://github.com/mapchete/mapchete/blob/main/logo/mapchete_grey.svg

Tile-based geodata processing.

https://img.shields.io/pypi/v/mapchete.svg https://img.shields.io/conda/v/conda-forge/mapchete https://img.shields.io/pypi/l/mapchete.svg https://img.shields.io/github/actions/workflow/status/mapchete/mapchete/python-package.yml?label=tests https://codecov.io/gh/mapchete/mapchete/branch/main/graph/badge.svg?token=aOracso0OQ https://img.shields.io/github/repo-size/mapchete/mapchete https://readthedocs.org/projects/mapchete/badge/?version=stable

mapchete is a Python library for processing large geospatial raster and vector datasets. It reads and writes data in a tiled fashion, allowing you to run your algorithms on data that is too large to fit into memory, and it can process your data in parallel.

You define the data inputs, output format, and the geographic extent, and mapchete handles the rest. Your custom Python code is then applied to each tile, enabling complex processing workflows on a massive scale.

Key Features

  • 🗺️ Process Large Datasets: Work with massive raster and vector data without memory issues using a tile-based, out-of-core approach.

  • Parallel Processing: Automatically run computations on multiple CPU cores to significantly speed up your workflows.

  • ⚙️ Simple Configuration: Separate your processing logic from your data configuration using easy-to-read .mapchete files.

  • 🐍 Pythonic API: Use mapchete directly from the command line or as a library in your own Python applications.

  • 🔌 Flexible & Extensible: Natively supports common raster and vector formats (e.g., GeoTIFF, GeoPackage). Easily add your own drivers for custom formats.

  • 🖥️ Interactive Inspection: Instantly visualize your processing inputs and results on a browser map with the built-in serve command.

Installation

We highly recommend installing mapchete and its dependencies from PyPI using pip or uv:

pip install mapchete
# or
uv pip install mapchete

For a complete installation including all optional dependencies (like S3 support, SQL support, etc.), use the [complete] extra:

pip install mapchete[complete]

Alternatively, it can be installed from the conda-forge channel using conda or mamba:

mamba install -c conda-forge mapchete

Quickstart: Generate a Hillshade

A great way to get started with mapchete is to generate a hillshade from a Digital Elevation Model (DEM). A hillshade creates a 3D-like relief effect by modeling how the surface would be illuminated by a light source. This example uses the modern process syntax where inputs and custom parameters are defined as typed function arguments.

You can find free DEM data for your area of interest from many sources, such as the Copernicus DEM.

1. Create a mapchete configuration file.

This file now includes a process_parameters section to control the hillshade’s appearance. These values are passed directly to your Python script. Save this file as hillshade.mapchete:

# The Python file containing the processing algorithm.
process: create_hillshade.py
# Note: there is a predefined process available, so you don't need to write your own hillshade process
# process: mapchete.processes.hillshade

# The CRS and grid definition for the output.
pyramid:
  grid: geodetic

# Define the zoom levels to process.
zoom_levels:
  min: 7
  max: 12

# User-defined parameters passed to the 'execute()' function.
process_parameters:
  azimuth: 315
  altitude: 45
  z_factor: 2.0
  scale: 1.0

# Define the input data.
# The key 'dem' will be the name of the variable passed to the execute() function.
input:
  dem: path/to/your/dem.tif

# Define the output format and location.
output:
  path: ./hillshade_output
  format: PNG
  bands: 3
  dtype: uint8  # Hillshade is an 8-bit grayscale image

2. Create your processing script.

The execute function now accepts the hillshade parameters from the config file as arguments. It also uses raise Empty, the recommended way to tell mapchete that a tile has no data and should be skipped. Save this file as create_hillshade.py:

import numpy as np
from mapchete import Empty, RasterInput
# mapchete has a built-in helper for this common task!
from mapchete.processes.hillshade import hillshade

def execute(
    dem: RasterInput,
    azimuth: int = 315,
    altitude: int = 45,
    z_factor: float = 1.0,
    scale: float = 1.0,
) -> np.ndarray:
    """
    Generate a hillshade from an input DEM tile.
    The function arguments are automatically populated from the .mapchete file.
    """
    # If the input tile is empty, raise an Empty exception to skip it.
    if dem.is_empty():
        raise Empty

    # Read the elevation data and generate the hillshade with the given parameters.
    return hillshade(
        dem.read(),
        azimuth=azimuth,
        altitude=altitude,
        z_factor=z_factor,
        scale=scale
    )

3. Run the process.

To run the process, use the execute subcommand. You can edit the values in hillshade.mapchete and re-run the process to see how the lighting changes. Make sure to use the --overwrite flag if you want to overwrite existing output.

mapchete execute hillshade.mapchete

4. View the output.

Use the serve command to inspect your results on an interactive map.

mapchete serve hillshade.mapchete

Managing Dependencies

Mapchete uses uv for dependency management and locking. The primary source of truth for dependencies is pyproject.toml.

Utilizing uv

For local development, it is recommended to use uv to manage your virtual environment and dependencies:

# Create a virtual environment and install dependencies
uv sync --all-extras

# Run mapchete or tests within the environment
uv run mapchete --help
uv run pytest

Sync Workflow

A GitHub Action workflow named sync-dependencies ensures that the project’s dependencies remain up-to-date and consistent across different environments. It runs automatically on a daily basis and on every push to the main branch.

The workflow performs the following steps:

  1. Update Locks: Runs uv lock --upgrade to refresh the uv.lock file with the latest compatible dependency versions.

  2. Sync Conda Recipe: Automatically updates the Conda recipe in conda/meta.yaml to match the requirements defined in pyproject.toml.

  3. Automated Testing: Runs the full test suite to ensure that any dependency updates don’t break existing functionality.

  4. Pull Request Creation: If changes are detected, it automatically creates a Pull Request for review.

Note on ``uv lock`` vs ``uv sync``:

  • uv lock resolves dependencies and updates the uv.lock file without installing any packages. It is used in the workflow to refresh the lock file before testing.

  • uv sync updates the virtual environment to match the lock file (and updates the lock file if necessary). This is what you’ll typically use for local development to ensure your environment is up-to-date.

Conda Recipe

The conda/meta.yaml file is a derivative of pyproject.toml and is generated using pyproject2conda. To maintain consistency, do not edit ``conda/meta.yaml`` manually; instead, update the dependencies in pyproject.toml and the sync workflow will handle the rest.

Documentation

For more detailed information, tutorials, and the API reference, please visit our full documentation at: mapchete.readthedocs.io

Contributing

Contributions are welcome! We are happy to receive bug reports, feature requests, or pull requests. Please have a look at our CONTRIBUTING.rst file for guidelines on how to get started.

License

This project is licensed under the MIT License.

2026.4.0 Apr 02, 2026
2026.3.0 Mar 05, 2026
2026.2.2 Feb 27, 2026
2026.2.1 Feb 04, 2026
2025.12.0 Dec 16, 2025
2025.11.0 Nov 20, 2025
2025.10.1 Oct 10, 2025
2025.10.0 Oct 03, 2025
2025.9.2 Oct 01, 2025
2025.9.1 Sep 26, 2025
2025.9.0 Sep 02, 2025
2025.8.0 Aug 29, 2025
2025.6.0 Jun 05, 2025
2025.5.2 May 22, 2025
2025.5.1 May 20, 2025
2025.5.0 May 07, 2025
2025.4.0 Apr 09, 2025
2025.3.1 Mar 31, 2025
2025.3.0 Mar 26, 2025
2025.1.1 Jan 27, 2025
2025.1.0 Jan 14, 2025
2024.12.0 Dec 03, 2024
2024.11.1 Nov 25, 2024
2024.11.0 Nov 05, 2024
2024.10.1 Oct 29, 2024
2024.10.0 Oct 28, 2024
2024.9.0 Sep 11, 2024
2024.7.1 Jul 25, 2024
2024.7.0 Jul 24, 2024
2024.6.0 Jun 03, 2024
2024.5.2 May 15, 2024
2024.5.1 May 15, 2024
2024.5.0 May 02, 2024
2024.2.1 Feb 20, 2024
2024.2.0 Feb 14, 2024
2024.1.3 Jan 15, 2024
2024.1.2 Jan 11, 2024
2024.1.1 Jan 11, 2024
2024.1.0 Jan 04, 2024
2023.12.3 Dec 15, 2023
2023.12.2 Dec 12, 2023
2023.12.1 Dec 07, 2023
2023.12.0 Dec 05, 2023
2023.11.0 Nov 20, 2023
2023.10.0 Oct 18, 2023
2023.9.1 Sep 19, 2023
2023.9.0 Sep 05, 2023
2023.8.1 Aug 09, 2023
2023.8.0 Aug 09, 2023
2023.7.1 Jul 18, 2023
2023.7.0 Jul 04, 2023
2023.6.5 Jun 14, 2023
2023.6.4 Jun 13, 2023
2023.6.3 Jun 12, 2023
2023.6.2 Jun 12, 2023
2023.6.1 Jun 06, 2023
2023.6.0 Jun 05, 2023
2023.4.1 Apr 20, 2023
2023.4.0 Apr 20, 2023
2023.1.1 Jan 26, 2023
2023.1.0 Jan 03, 2023
2022.12.1 Dec 20, 2022
2022.12.0 Dec 16, 2022
2022.11.2 Nov 30, 2022
2022.11.1 Nov 23, 2022
2022.11.0 Nov 21, 2022
2022.9.2 Sep 16, 2022
2022.9.1 Sep 15, 2022
2022.9.0 Sep 14, 2022
2022.7.0 Jul 11, 2022
2022.6.0 Jun 10, 2022
2022.4.1 Apr 28, 2022
2022.4.0 Apr 01, 2022
2022.3.3 Mar 30, 2022
2022.3.1 Mar 11, 2022
2022.3.0 Mar 09, 2022
2022.2.2 Feb 25, 2022
2022.2.1 Feb 23, 2022
2022.2.0 Feb 03, 2022
2022.1.2 Jan 31, 2022
2022.1.1 Jan 19, 2022
2022.1.0 Jan 19, 2022
2021.12.3 Dec 16, 2021
2021.12.2 Dec 14, 2021
2021.12.1 Dec 14, 2021
2021.12.0 Dec 02, 2021
2021.11.3 Nov 23, 2021
2021.11.2 Nov 16, 2021
2021.11.1 Nov 16, 2021
2021.11.0 Nov 03, 2021
2021.10.3 Oct 19, 2021
2021.10.2 Oct 19, 2021
2021.10.1 Oct 08, 2021
2021.10.0 Oct 01, 2021
0.44 Sep 30, 2021
0.43 Sep 17, 2021
0.42 Aug 27, 2021
0.41 Aug 17, 2021
0.40 Jun 24, 2021
0.39 Jun 08, 2021
0.38 Dec 10, 2020
0.37 Nov 25, 2020
0.36 Nov 24, 2020
0.35 Aug 04, 2020
0.34 Jul 08, 2020
0.33 Mar 24, 2020
0.32 Feb 24, 2020
0.31 Dec 03, 2019
0.30 Oct 22, 2019
0.29 Jul 12, 2019
0.28 Jun 18, 2019
0.27 Jan 03, 2019
0.26 Nov 28, 2018
0.25 Oct 29, 2018
0.24 Oct 23, 2018
0.23 Aug 21, 2018
0.22 May 31, 2018
0.21 May 31, 2018
0.20 Apr 07, 2018
0.19 Feb 16, 2018
0.18 Feb 02, 2018
0.17 Feb 02, 2018
0.16 Jan 12, 2018
0.14 Jan 02, 2018
0.13 Dec 21, 2017
0.12 Nov 23, 2017
0.11 Nov 09, 2017
0.10 Oct 23, 2017
0.9 Oct 04, 2017
0.8 Sep 22, 2017
0.7 Sep 20, 2017
0.6 Sep 12, 2017
0.5 May 07, 2017
0.4 Mar 02, 2017
0.3 Sep 20, 2016
0.2 Sep 07, 2016
0.1 Aug 23, 2016
0.0.1 Feb 04, 2016
0.33.linux Mar 24, 2020
0.32.linux Feb 24, 2020
0.26.linux Nov 28, 2018

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
aiohttp
cachetools
click-plugins
click-spinner
click (>=7.1.1)
dask
distributed
fiona (>=1.8.13.post1)
fsspec
geojson-pydantic
importlib-metadata
importlib-resources
numpy (!=2.0.1,>=1.16)
oyaml
pydantic-settings (>=2.0.0)
pydantic (>=2.3.0)
pyproj
pystac-client (>=0.7.2)
pystac[urllib3] (>=1.8.2)
python-dateutil
rasterio (>1.2.10)
retry
shapely (>=2.0.0)
tilematrix (>=2022.12.0)
tqdm