Decoding Vector Tile pbf to geoJson

Muhammad Abdul Moeed 61 Reputation points
2021-12-05T20:56:21.05+00:00
  1. is there a way to decode vector tiles coming through the following api in pbf format into geojson?

https://learn.microsoft.com/en-us/rest/api/maps/render/get-map-tile?

  1. also, after a pbf is decoded into geojson does it contain road data such as coordinates of specific road or any kind of other coordinate information?
  2. is the vector tile data coming through the api is similar to what i can get for example by using the function getRenderedShapes() on my azure maps through map.layers.getRenderedShapes()?
Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
664 questions
0 comments No comments
{count} votes

Accepted answer
  1. rbrundritt 16,551 Reputation points Microsoft Employee
    2021-12-06T21:24:37.877+00:00

    Yes, it's possible to decode the vector tiles and convert the data to GeoJSON. I've done this a few times in the past in C#. One way to do this in .NET is as follows:

    Key information you will need to parse the tiles is the source layers within the tiles. You can find these in the TomTom docs (the data provider for Azure Maps) here: https://developer.tomtom.com/map-display-api/map-display-api-documentation-vector/content#tile_layers

    If using a different programming language, there are many great tools for vector tiles listed here: https://github.com/mapbox/awesome-vector-tiles

    Road data coordinates are in the tiles, however, note that when zoomed out, some road geometries may be multi-linestrings that represent several roads of the same type but the name isn't in the tile at that zoom level. If you want the name for each road segment, you will likely need to retrieve tiles from a closer zoom level (~16).

    The vector tile data is very similar to what you get from getRenderedShapes. Main difference is that there would be no style properties coming from the data in the tiles.

    0 comments No comments

0 additional answers

Sort by: Most helpful