9

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?

9
  • What happens when you put that URL into the plugin? Jan 9, 2018 at 12:27
  • Returns the following error. "The field ''vector_layers' is required but not found. This is invalid TileJSON. Jan 9, 2018 at 12:53
  • what format are your Map Vector Tiles?
    – nmtoken
    Jan 9, 2018 at 13:19
  • @nmtoken tiles are in pbf format. Jan 10, 2018 at 4:50
  • Wrote my own script to decode and display mapbox vector tiles parsed as pbf in QGIS. Closing... Jan 19, 2018 at 12:36

1 Answer 1

4
    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.

2
  • Great, thank you. I didn't hope that the mapbox_vector_tile module was in qgis's python May 25, 2018 at 13:03
  • @OscarCampo No it was not. You have to load it using Pip. May 26, 2018 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.