Skip to content

Instantly share code, notes, and snippets.

@palmerj
Last active February 20, 2018 02:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save palmerj/a52bc8357acee0cb1ddc622c2dab1e63 to your computer and use it in GitHub Desktop.
Save palmerj/a52bc8357acee0cb1ddc622c2dab1e63 to your computer and use it in GitHub Desktop.
View Vector Tiles in QGIS using GDAL/OGR 2.3

Create mapbox vectors using OGR

Get NZ parcels data over Auckland region in SHP: https://data.linz.govt.nz/x/CLzEZU

Generate vector tiles

ogr2ogr -f MBTILES parcels.mbtiles nz-primary-parcels.shp -dsco MAXZOOM=14

Create VRT for viewing in QGIS 3.0/GDAL 2.3

ogr2vrt.py parcels.mbtiles parcels.vrt -oo ZOOM_LEVEL_AUTO=YES -relative

See screenshots below of simpilication in the MVT and the original.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment