mapchete 0.24


pip install mapchete==0.24

Project Links

Meta
Author: Joachim Ungar

Classifiers

Development Status
  • 3 - Alpha

Intended Audience
  • Developers

Topic
  • Scientific/Engineering :: GIS

License
  • OSI Approved :: MIT License

Programming Language
  • Python :: 3.5
  • Python :: 3.6

Tile-based geodata processing.

https://badge.fury.io/py/mapchete.svg https://travis-ci.org/ungarj/mapchete.svg?branch=master https://coveralls.io/repos/github/ungarj/mapchete/badge.svg?branch=master Documentation Status https://img.shields.io/pypi/pyversions/mapchete.svg

NOTE: this package only supports Python 3.5 and 3.6 from now on.

Developing a script which does some geoprocessing is usually an iterative process where modifying code, running the script and inspecting the output repeat until the desired result. This can take a long time as processing and visualizing the output data repeat very often and therefore sum up. Especially when using a remote machine because the input data is huge, the time to wait for the script to finish, download and open the output can be tedious.

Mapchete aims to facilitate this development circle by providing tools to quickly inspect the output (from a remote or local machine) and allows larger scale processing jobs by running multiple tiles in parallel.

Python is used a lot because it is a very user-friendly language to quickly develop working processing chains and it provides a rich ecosystem of packages which help to efficiently process geodata (e.g. shapely for features, numpy for rasters).

Mapchete takes care about dissecting, resampling and reprojecting geodata, applying user defined Python code to each tile and writing the output into a WMTS-like tile pyramid which is already optimized to be further used for web maps.

Usage

You need a .mapchete file for the process configuration

process: my_python_process.py  # or a Python module path: mypythonpackage.myprocess
zoom_levels:
    min: 0
    max: 12
input:
    dem: /path/to/dem.tif
    land_polygons: /path/to/polygon/file.geojson
output:
    format: PNG_hillshade
    path: /output/path
pyramid:
    grid: mercator

# process specific parameters
resampling: cubic_spline

and a .py file or a Python module path where you specify the process itself

def execute(mp, resampling="nearest", **kwargs):
    # Open elevation model.
    with mp.open("dem", resampling=resampling) as src:
        # Skip tile if there is no data available.
        if src.is_empty(1):
            return "empty"
        dem = src.read(1)
    # Create hillshade.
    hillshade = mp.hillshade(dem)
    # Clip with polygons and return result.
    with mp.open("land_polygons") as land_file:
        return mp.clip(hillshade, land_file.read())

You can then interactively inspect the process output directly on a map in a browser (go to localhost:5000):

mapchete serve hillshade.mapchete --memory

The serve tool recognizes changes in your process configuration or in the process file. If you edit one of these, just refresh the browser and inspect the changes (note: use the --memory flag to make sure to reprocess each tile and turn off browser caching).

Once you are done with editing, batch process everything using the execute tool.

mapchete execute hillshade.mapchete

There are many more options such as zoom-dependent process parameters, metatiling, tile buffers or interpolating from an existing output of a higher zoom level. For deeper insights, please go to the documentation.

Mapchete is used in many preprocessing steps for the EOX Maps layers:

  • Merge multiple DEMs into one global DEM.

  • Create a customized relief shade for the Terrain Layer.

  • Generalize landmasks & coastline from OSM for multiple zoom levels.

  • Extract cloudless pixel for Sentinel-2 cloudless.

Installation

via PyPi:

pip install mapchete

from source:

pip install -r requirements.txt
python setup.py install

To make sure Rasterio and Fiona are properly built against your local GDAL installation, don’t install the binaries but build them on your system:

pip install "rasterio>=1.0.2" "fiona>=1.8b1" --no-binary :all:

License

MIT License

Copyright (c) 2015 - 2018 EOX IT Services

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.0rc0 Nov 28, 2018
No dependencies