Skip to content

Instantly share code, notes, and snippets.

View vineeshgeo's full-sized avatar
🎯
Doing Geography

Vineesh V vineeshgeo

🎯
Doing Geography
View GitHub Profile
@answerquest
answerquest / extract_vector_data.py
Last active February 7, 2024 04:58
Extract data from a vector tile layer for a given area
"""
Program by Nikhil VJ, https://nikhilvj.co.in
Based on solution worked out at https://gis.stackexchange.com/questions/475398/extract-features-in-lat-long-co-ordinates-from-vector-tile-layer-pbf-file-pytho
License: Creative Commons Zero v1.0 Universal, ref: https://choosealicense.com/licenses/cc0-1.0/
What this does:
- Given any vector tile layer in .pbf format, and a poylgon or similar shape,
- Extracts all the data from the vector tile layer falling over that shape,
- And save it to local disk as a .gpkg shapefile which you can further use
- If the vector tile layer had multiple layers, then .gpkg will have all those layers