python-vt2geojson 
Dump vector tiles to GeoJSON from remote URLs or local system files.
Inspired from https://github.com/mapbox/vt2geojson.
Installation
pip install python-vt2geojson
Usage
Using the CLI:
vt2geojson --help
Making a GeoDataframe from a PBF vector tile file:
import geopandas as gpd
import requests
from vt2geojson.tools import vt_bytes_to_geojson
MAPBOX_ACCESS_TOKEN = "*****"
x = 150
y = 194
z = 9
url = f"https://api.mapbox.com/v4/mapbox.mapbox-streets-v6/{z}/{x}/{z}.vector.pbf?access_token={MAPBOX_ACCESS_TOKEN}"
r = requests.get(url)
assert r.status_code == 200, r.content
vt_content = r.content
features = vt_bytes_to_geojson(vt_content, x, y, z)
gdf = gpd.GeoDataFrame.from_features(features)
Notes
This library has only been tested against Python 3.6.
Feel free to submit your issues.
Metadata
Release files for vt2geojson 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| vt2geojson-0.1.4.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| vt2geojson-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.8 kB
Release files / vt2geojson-0.1.4.tar.gz
| Download URL | vt2geojson-0.1.4.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3608d5f696a7124de21fa32354902a3fada39fddf945e18e1d729c36592a39bf
|
|
BLAKE2b-256 checksum How to use checksums |
bbe612f2ef718cc94af6ab3b3699b124e5544670c21b36e06e3b8526ebf11fbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.2
|
Release files / vt2geojson-0.1.4-py3-none-any.whl
| Download URL | vt2geojson-0.1.4-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2e7e9e1a29d145ffdfc8494528f9a02ca02ec53cc87015ba71f0d7f206789bae
|
|
BLAKE2b-256 checksum How to use checksums |
5e868419f77d8dd15642f2e139d5b39be0aa931f06fa5ca8fc8f2496d2f95c90
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.2
|