Skip to main content

Create rasters from global tiles

Project description

tile-mate

PyPI license PyPI pyversions PyPI version Conda version Conda platforms

This tool provides a tool to create continuous rasters of global publicly available tiles such as Pekel Occurence and ESA 10 m land cover. This is a simpler cousin of dem-stitcher without the need for basic post-processing (e.g. fractional pixel translation and vertical datum transformations).

The API can be summarized as

from tile_mate import get_raster_from_tiles

bounds = [-120.55, 34.85, -120.25, 35.15]
X, p = get_raster_from_tiles(bounds, tile_shortname='esa_world_cover_2021')

# X is an c x m x n numpy array, where c is the number of channels specified by `count`
# p is a dictionary (or a rasterio profile) including relevant GIS metadata; CRS is epsg:4326

The rasters are returned in the global lat/lon projection epsg:4326 and the API assumes that bounds are supplied in this format.

import rasterio

with rasterio.open('esa_worlf_cover_2021_subset.tif', 'w', **p) as ds:
   ds.write(X)

Installation

In order to easily manage dependencies, we recommend using dedicated project environments via Anaconda/Miniconda or Python virtual environments.

  1. Install the environment in this repository with mamba env update -f environment.yml
  2. Activate the environment conda activate tile-mate
  3. Install the library with pip via pip install tile-mate

For development, clone the repository and navigate to it in the terminal.

python -m pip install . -e

Python 3.10+ is supported.

Notebooks

We have notebooks to demonstrate common usage:

Datasets Supported

The datasets supported are:

In [1]: from tile_mate.stitcher import DATASET_SHORTNAMES

In [2]: DATASET_SHORTNAMES
Out[2]: ['pekel_water_occ_2021',
 'esa_world_cover_2020',
 'esa_world_cover_2021',
 'hansen_annual_mosaic',
 's1_coherence_2020',
 'cop_100_lulc_discrete']

These correspond to

See these notebooks to see how these tiles are generated and organized.

Dateline support

None curently.

Contributing

We welcome contributions to this open-source package. To do so:

  1. Create an GitHub issue ticket desrcribing what changes you need (e.g. issue-1)
  2. Fork this repo
  3. Make your modifications in your own fork
  4. Make a pull-request (PR) in this repo with the code in your fork and tag the repo owner or a relevant contributor.

We use flake8 and associated linting packages to ensure some basic code quality (see the environment.yml). These will be checked for each commit in a PR. Try to write tests wherever possible.

Support

  1. Create an GitHub issue ticket desrcribing what changes you would like to see or to report a bug.
  2. We will work on solving this issue (hopefully with you).

Acknowledgements

This tool was developed to support OPERA.

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

tile-mate-0.0.8.tar.gz (5.6 MB view details)

Uploaded Source

Built Distribution

tile_mate-0.0.8-py3-none-any.whl (4.4 MB view details)

Uploaded Python 3

File details

Details for the file tile-mate-0.0.8.tar.gz.

File metadata

  • Download URL: tile-mate-0.0.8.tar.gz
  • Upload date:
  • Size: 5.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for tile-mate-0.0.8.tar.gz
Algorithm Hash digest
SHA256 2461982122dfec60e0a90dfa4524fa1113482cd7700ef5fb0bfaaf84fb4897cd
MD5 deb8e67fa615fe22c87496f7116764d5
BLAKE2b-256 a94069f97445bbec13d3f941bfbc316620de2ca5665e2e4328463cba012a9f5e

See more details on using hashes here.

File details

Details for the file tile_mate-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: tile_mate-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 4.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.8

File hashes

Hashes for tile_mate-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6734bb1a9ac9a817e8f060028c0c475b70376dcb0a917959a1c3cc0af6f91c00
MD5 f163d4465176ef0ada240d0d20e8638b
BLAKE2b-256 1f97ef411da27bb66919aa233d187852ebf1142045b184423da399753d029e64

See more details on using hashes here.

Supported by

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