Skip to content

Repository files navigation

python-vtzero

Experimental Python wrapper of vtzero a minimalist vector tile decoder and encoder in C++

StatusPackaging status

Requirements

  • Python >= 3.8
  • gcc/clang++ >= 4.5 (C++11)

Install

You can install python-vtzero using pip

$ python -m pip install vtzero

or install from source

$ git clone https://github.com/tilery/python-vtzero
$ cd python-vtzero
# Download vendor submodules (protozero, mvt-fixtures, vtzero)
$ git submodule update --init
# Compile Cython module
$ python setup.py build_ext --inplace
$ python -m pip install -e .

Example

A complete example can be found here

fromvtzero.tileimportVectorTile, Tile, Layer, Point# Create MVTtile=Tile()
# Add a layerlayer=Layer(tile, b'my_layer')
# Add a pointfeature=Point(layer)
feature.add_points(1)
feature.set_point(10, 10)
feature.add_property(b'foo', b'bar')
feature.add_property(b'x', b'y')
feature.commit()
# Encode mvtdata=tile.serialize()

About

Experimental Cython wrapper around vtzero

Resources

Stars

14 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages