All Projects → mapbox → vector-tile-base

mapbox / vector-tile-base

Licence: other
A very basic and low level library written in python for encoding and decoding Mapbox Vector Tiles

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to vector-tile-base

Kartotherian
Map Tile Server
Stars: ✭ 230 (+447.62%)
Mutual labels:  vector-tiles
all-transit
Interactive visualization of all transit in the Transitland database
Stars: ✭ 22 (-47.62%)
Mutual labels:  vector-tiles
rok4
ROK4 est une suite d'outils open source développée par l'IGN France permettant la diffusion de données raster et vecteur en WMS, WMTS ou TMS. DEPRECATED ! Projet maintenu ici : https://github.com/rok4/documentation
Stars: ✭ 18 (-57.14%)
Mutual labels:  vector-tiles
qgis-maptiler-plugin
QGIS MapTiler Plugin: vector tiles, basemaps, geocoding, OSM, QuickMapServices
Stars: ✭ 73 (+73.81%)
Mutual labels:  vector-tiles
tilekiln
No description or website provided.
Stars: ✭ 3 (-92.86%)
Mutual labels:  vector-tiles
flutter-maplibre-gl
A flutter package for showing customizable vector/raster maps with Maplibre GL (forked from tobrun/flutter-mapbox-gl)
Stars: ✭ 69 (+64.29%)
Mutual labels:  vector-tiles
Ngx Leaflet Starter
A soup of Angular and Leaflet
Stars: ✭ 208 (+395.24%)
Mutual labels:  vector-tiles
victor
Turn mapbox vector tiles into static maps in R
Stars: ✭ 28 (-33.33%)
Mutual labels:  vector-tiles
mapsplit
A fast way to split OSM data in to a portable tiled format
Stars: ✭ 55 (+30.95%)
Mutual labels:  vector-tiles
cloud-tileserver
Serve mapbox vectortiles via AWS stack
Stars: ✭ 48 (+14.29%)
Mutual labels:  vector-tiles
grava
Mapbox Vector Tile Server - Go
Stars: ✭ 74 (+76.19%)
Mutual labels:  vector-tiles
openstreetmap-carto-vector-tiles
A general-purpose OpenStreetMap mapnik style, in CartoCSS, served with vector tiles
Stars: ✭ 46 (+9.52%)
Mutual labels:  vector-tiles
vectorpipe
Convert Vector data to VectorTiles with GeoTrellis.
Stars: ✭ 64 (+52.38%)
Mutual labels:  vector-tiles
Qwantmaps
Central repository for Qwant Maps resources
Stars: ✭ 239 (+469.05%)
Mutual labels:  vector-tiles
HMap
:earth: HMap | 基于openlayers的封装组件
Stars: ✭ 64 (+52.38%)
Mutual labels:  vector-tiles
Mbtileserver
Basic Go server for mbtiles
Stars: ✭ 218 (+419.05%)
Mutual labels:  vector-tiles
vector-tile-demo-js
Demo Application for switching vector tile styles on the fly
Stars: ✭ 15 (-64.29%)
Mutual labels:  vector-tiles
tilegrinder
♻️ A node.js GIS helper library for easy alteration of Vector Tiles in an MBTiles container
Stars: ✭ 64 (+52.38%)
Mutual labels:  vector-tiles
leaflet-geojson-selector
Show GeoJSON Layer like as Interactive Menu List
Stars: ✭ 88 (+109.52%)
Mutual labels:  vector-tiles
timvt
PostGIS based Vector Tile server.
Stars: ✭ 113 (+169.05%)
Mutual labels:  vector-tiles

vector-tile-base

This library encodes and decodes Mapbox Vector Tiles. It is intended for use by developers with clear understanding of the Vector Tile format. The code is written as a pure python implementation with support of the google protobuf python format.

Depends

  • Google protobuf python bindings

Development

Install the python locally with pip:

pip install -e .

To run tests use pytest:

pytest

Example

Some very simple code examples

Encode

There is an example encoding provided in examples and can be used to ecode a .mvt file.

python examples/encode.py my.mvt
import vector_tile_base
import sys

vt = vector_tile_base.VectorTile()
layer = vt.add_layer('my_locations')
feature = layer.add_point_feature()
feature.add_points([[10,10],[20,20]])
feature.id = 1
feature.attributes = { 'type': 1, 'name': 'my_points' }

encoded_tile = vt.serialize()

f = open(sys.argv[1], "wb")
f.write(encoded_tile)
f.close()

Decode

There is an example decoding provided in examples and can be used to decode a .mvt file.

python examples/decode.py my.mvt
import vector_tile_base
import sys

f = open(sys.argv[1], "rb")
raw_tile = f.read()
f.close()

vt = vector_tile_base.VectorTile(raw_tile)
for l in vt.layers:
    print(l.name)
    for f in l.features:
        print(f.type)
        print(f.attributes)
        print(f.get_geometry())
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].