rio-tiler-mvt
A rio-tiler plugin to translate tile array to MVT (using python-vtzero).
More on COG Talk blog posts
Install
Requirements
rio-tiler-mvt use python-vtzero wrapper to encode point and polygons to MVT. Because VTZERO is a C++ library, python-vtzero is written in Cython, thus cython is required to compile this library.
$ pip install cython # see https://github.com/tilery/python-vtzero#requirements
$ pip install rio-tiler-mvt
Or
$ git clone http://github.com/cogeotiff/rio-tiler-mvt
$ cd rio-tiler-mvt
$ pip install -e .
Rio-tiler + Mapbox Vector tiles
API
pixel_encoder
pixels_encoder(
data: numpy.ndarray,
mask: numpy.ndarray,
band_names: list = [],
layer_name: str = "my_layer",
feature_type: str = "point"
)
Inputs:
- data: raster tile data to encode
- mask: mask data
- band_names: Raster band's names
- layer_name: Layer name
- feature_type: Feature type (point or polygon)
Returns:
- mvt : Mapbox Vector Tile encoded data.
Examples:
from rio_tiler.io import COGReader
from rio_tiler_mvt import pixels_encoder
with COGReader("fixtures/test.tif") as cog
img = cog.tile(72, 63, 7, resampling_method="nearest")
mvt = pixels_encoder(img.data, img.mask, layer_name="test", feature_type="point")
shapes_encoder
shapes_encoder(
data: numpy.ndarray, # 1D array (height, width)
mask: numpy.ndarray,
layer_name: str = "my_layer",
colormap: dict = {},
class_names: dict = {}
)
Inputs:
- data: raster tile data to encode
- mask: mask data
- layer_name: Layer name
- colormap: GDAL colormap. If provided a
colorvalue will be added to the feature properties - class_names: Dictionary mapping pixel value with class names. If provided a
namevalue will be added to the feature properties.
Returns:
- mvt : Mapbox Vector Tile encoded data.
Contribution & Development
Issues and pull requests are more than welcome.
dev install
$ git clone https://github.com/cogeotiff/rio-tiler-mvt.git
$ cd rio-tiler-mvt
$ pip install -e .[dev]
pre-commit
This repo is set to use pre-commit to run isort, flake8, pydocstring, black ("uncompromising Python code formatter") and mypy when committing new code.
$ pre-commit install
Links
- satellite-3d: http://github.com/developmentseed/satellite-3d.git
- titiler-mvt: http://github.com/developmentseed/titiler-mvt.git
- rio-viz: http://github.com/developmentseed/rio-viz.git
Metadata
Release files for rio-tiler-mvt 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rio_tiler_mvt-0.2.0.tar.gz | 90.5 kB | Without provenance | Details for rio_tiler_mvt-0.2.0.tar.gz |
Release files / rio_tiler_mvt-0.2.0.tar.gz
| Download URL | rio_tiler_mvt-0.2.0.tar.gz |
|---|---|
| Size | 90.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d2595d9ae929db06663b70bccf234849bd1b6949f29d4eafc827b63759bff039
|
|
BLAKE2b-256 checksum How to use checksums |
3badf5393ecb11abfcd69025bf02f93fc7b0e287e6ab58700a7d45dfccfeb872
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.13.1
|
Security for rio-tiler-mvt 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.