All Projects → ungarj → Mapchete

ungarj / Mapchete

Licence: mit
Tile-based geodata processing using rasterio & Fiona

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Mapchete

Python Geospatial
A collection of Python packages for geospatial analysis with binder-ready notebook examples
Stars: ✭ 187 (+44.96%)
Mutual labels:  vector, raster, gis
Grass
GRASS GIS - free and open source Geographic Information System (GIS)
Stars: ✭ 281 (+117.83%)
Mutual labels:  vector, raster, gis
Earthenterprise
Google Earth Enterprise - Open Source
Stars: ✭ 2,425 (+1779.84%)
Mutual labels:  vector, raster, gis
Geocube
Tool to convert geopandas vector data into rasterized xarray data.
Stars: ✭ 87 (-32.56%)
Mutual labels:  vector, raster, gis
wxee
A Python interface between Earth Engine and xarray for processing time series data
Stars: ✭ 113 (-12.4%)
Mutual labels:  gis, raster
postile
Project migrated to: https://gitlab.com/Oslandia/postile
Stars: ✭ 67 (-48.06%)
Mutual labels:  vector, gis
geoblaze
Blazing Fast JavaScript Raster Processing Engine
Stars: ✭ 80 (-37.98%)
Mutual labels:  gis, raster
Datacube Core
Open Data Cube analyses continental scale Earth Observation data through time
Stars: ✭ 285 (+120.93%)
Mutual labels:  raster, gis
Blendergis
Blender addons to make the bridge between Blender and geographic data
Stars: ✭ 4,642 (+3498.45%)
Mutual labels:  raster, gis
Fiona
Fiona reads and writes geographic data files
Stars: ✭ 787 (+510.08%)
Mutual labels:  vector, gis
Geotiff.io
Static website for viewing and analyzing GeoTIFF's in the browser
Stars: ✭ 53 (-58.91%)
Mutual labels:  raster, gis
Geospatial Python CourseV1
This is an collection of blog posts turned into a course format
Stars: ✭ 53 (-58.91%)
Mutual labels:  vector, raster
grass-addons
GRASS GIS Addons Repository (Manuals: https://grass.osgeo.org/grass-stable/manuals/addons/ | Linux-logs: https://grass.osgeo.org/addons/grass8/logs/ | Windows logs: https://wingrass.fsv.cvut.cz/grass82/addons/grass-8.2.0/logs/)
Stars: ✭ 64 (-50.39%)
Mutual labels:  vector, raster
GeoJSON.jl
Utilities for working with GeoJSON data in Julia
Stars: ✭ 46 (-64.34%)
Mutual labels:  vector, gis
pyMap
Raster Map Download Helper
Stars: ✭ 83 (-35.66%)
Mutual labels:  tile, raster
go-mbgl
Go bindings for Mapbox GL Native
Stars: ✭ 16 (-87.6%)
Mutual labels:  gis, raster
Tiledmapview
Tiled map loader for Android , based on the pyramid model, supports a variety of projections, including Web Mercator projection, latitude and longitude projection and custom projection; supports locating, adding layers and overlays. Android瓦片地图加载控件,基于金字塔模型,支持多种投影,包括Web墨卡托投影,经纬度直投及自定义投影等;支持定位,添加图层和覆盖物。
Stars: ✭ 45 (-65.12%)
Mutual labels:  tile, gis
Leaflet Geoman
🍂🗺️ The most powerful leaflet plugin for drawing and editing geometry layers
Stars: ✭ 1,088 (+743.41%)
Mutual labels:  vector, gis
georaster-layer-for-leaflet
Display GeoTIFFs and soon other types of raster on your Leaflet Map
Stars: ✭ 168 (+30.23%)
Mutual labels:  gis, raster
awesome-spectral-indices
A ready-to-use curated list of Spectral Indices for Remote Sensing applications.
Stars: ✭ 357 (+176.74%)
Mutual labels:  gis, raster

======== Mapchete

Tile-based geodata processing.

.. image:: https://badge.fury.io/py/mapchete.svg :target: https://badge.fury.io/py/mapchete

.. image:: https://travis-ci.org/ungarj/mapchete.svg?branch=master :target: https://travis-ci.org/ungarj/mapchete

.. image:: https://coveralls.io/repos/github/ungarj/mapchete/badge.svg?branch=master :target: https://coveralls.io/github/ungarj/mapchete?branch=master

.. image:: https://readthedocs.org/projects/mapchete/badge/?version=latest :target: http://mapchete.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status

.. image:: https://img.shields.io/pypi/pyversions/mapchete.svg :target: https://pypi.python.org/pypi/mapchete

Mapchete processes raster and vector geodata in digestable chunks.

Processing larger amounts of data requires chunking the input data into smaller tiles and process them one by one. Python provides a lot of useful packages to process geodata like shapely_ or numpy_. From within your process code you will have access to the geodata in the form of NumPy arrays for raster data or GeoJSON-like feature dictionaries for vector data.

With the help of fiona_ and rasterio_ Mapchete takes care about resampling and reprojecting geodata, applying your Python code to the tiles and writing the output either into a single file or into a directory of files organized in a WMTS_-like tile pyramid. Details on tiling scheme and available map projections are outlined in the tiling documentation_.

.. _shapely: http://toblerity.org/shapely/ .. _numpy: http://www.numpy.org/ .. _fiona: https://github.com/Toblerity/Fiona .. _rasterio: https://github.com/mapbox/rasterio/ .. _WMTS: https://en.wikipedia.org/wiki/Web_Map_Tile_Service .. _tiling documentation: https://mapchete.readthedocs.io/en/latest/tiling.html

.. figure:: https://mapchete.readthedocs.io/en/latest/_images/mercator_pyramid.svg :align: center :target: https://mapchete.readthedocs.io/en/latest/tiling.html

(standard Web Mercator pyramid used in the web)


Usage

You need a .mapchete file for the process configuration. The configuration is based on the YAML syntax.

.. code-block:: yaml

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

You also need either a .py file or a Python module path where you specify the process itself.

.. code-block:: python

def execute(mp, resampling="nearest"):

    # Open elevation model.
    with mp.open("dem") as src:
        # Skip tile if there is no data available or read data into a NumPy array.
        if src.is_empty(1):
            return "empty"
        else:
            dem = src.read(1, resampling=resampling)

    # Create hillshade using a built-in hillshade function.
    hillshade = mp.hillshade(dem)

    # Clip with polygons from vector file 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 (first, install dependencies by pip install mapchete[serve] go to localhost:5000):

.. code-block:: shell

$ 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.

.. code-block:: shell

$ mapchete execute hillshade.mapchete

Documentation

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_.

.. _documentation: http://mapchete.readthedocs.io/en/latest/index.html

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_.

.. _cloudless: https://cloudless.eox.at/ .. _EOX Maps: http://maps.eox.at/


Installation

via PyPi:

.. code-block:: shell

$ pip install mapchete

from source:

.. code-block:: shell

$ git clone [email protected]:ungarj/mapchete.git && cd mapchete
$ pip install .

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

.. code-block:: shell

$ pip install --upgrade rasterio fiona shapely --no-binary :all:

To keep the core dependencies minimal if you install mapchete using pip, some features are only available if you manually install additional dependencies:

.. code-block:: shell

# for contour extraction:
$ pip install mapchete[contours]

# for S3 bucket reading and writing:
$ pip install mapchete[s3]

# for mapchete serve:
$ pip install mapchete[serve]

# for VRT generation:
$ pip install mapchete[vrt]

License

MIT License

Copyright (c) 2015 - 2020 EOX IT Services_

.. _EOX IT Services: https://eox.at/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].