Skip to main content

Python wrapper for vtzero C++ library.

Project description

python-vtzero

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

Status Packaging status

Requirements

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

Install

You can install python-vtzero using pip

$ 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
$ pip install -e .

Example

A complete example can be found here

from vtzero.tile import VectorTile, Tile, Layer, Point

# Create MVT
tile = Tile()

# Add a layer
layer = Layer(tile, b'my_layer')

# Add a point
feature = 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 mvt
data = tile.serialize()

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

vtzero-0.0.1b2.tar.gz (85.7 kB view details)

Uploaded Source

File details

Details for the file vtzero-0.0.1b2.tar.gz.

File metadata

  • Download URL: vtzero-0.0.1b2.tar.gz
  • Upload date:
  • Size: 85.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.9.5

File hashes

Hashes for vtzero-0.0.1b2.tar.gz
Algorithm Hash digest
SHA256 63cf1f89e1e0658a661878e757beece8d4c4171df9cf59fb97107d43a22a2e0e
MD5 f5bb363307adba982cb25b7d9101d3ce
BLAKE2b-256 b4691dfe6a7d70e3e2021b3774b6e1a12ba12698c88aca1d8dc5e0ef50c41905

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