Mapchete xarray output driver
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
This driver enables mapchete to write multidimensional arrays into a tile directory structure.
Usage
Example .mapchete file:
process: process.py
zoom_levels:
min: 0
max: 12
input:
output:
format: xarray
path: /some/output/path
dtype: uint16
bands: 3
storage: zarr # or netcdf
pyramid:
grid: geodetic
metatiling: 2
Example process file:
from dateutil import parser
import numpy as np
import xarray as xr
def execute(mp, stack_height=10):
# create 4D arrays with current tile shape and dtype
arrs = [
np.ones((3, ) + mp.tile.shape, dtype="uint16")
for _ in range(1, stack_height)
]
# create timestamps for each array
timestamps = [parser.parse("2018-04-0%s" % i) for i in range(1, stack_height)]
# build xarray with time axis
timeseries = xr.DataArray(
np.stack(arrs), coords={'time': timestamps}, dims=('time', 'bands', 'x', 'y')
)
# return to write
return timeseries
Installation
# install using pip:
pip install mapchete_xarray
# verify driver is vailable ('xarray' should be listed as output format):
mapchete formats
Current Limitations
no reprojection allowed
when reading from existing output, process metatiling must be smaller than xarray output metatiling
License
MIT License
Copyright (c) 2019-2020 EOX IT Services
Jun 13, 2023
2023.6.0
Oct 21, 2022
2022.10.0
Jul 12, 2022
2022.7.0
May 04, 2022
2022.5.0
Nov 03, 2021
2021.11.0
Oct 25, 2021
2021.10.0
May 07, 2020
0.4
May 20, 2019
0.3
May 20, 2019
0.2
Apr 18, 2019
0.1
Wheel compatibility matrix
Files in release
Extras:
None
Dependencies:
(>=2021.11.0)
mapchete[s3]