QGIS – How to Load MVT Tiles in QGIS

pyqgispythonqgisvector-tiles

I want to load mvt tiles into QGIS through a URL service

https://abc.com:8080/buildings/{z}/{x}/{y}.mvt

But, the menu in the Vector Tile Reader plugin allows TileJSON URL.

Is there any way I can load mvt tiles in QGIS environment?

Best Answer

    r = requests.get(url)

    # ------------------------Decryption------------------------
    response = r.content
    decoded_data = mapbox_vector_tile.decode(response)

Import relevant modules to your sript, parse the URL to your specific tile at specific zoom level for example;

https://abc.com:8080/buildings/16/4059/6568.mvt

Here 16/4059/6568 are zoom level X and Y numbers of your requested tile id. After that you can print decoded data to see the decoded JSON of your tile.

Related Question