Skip to content

What is the difference between *.mvt and *.vector.pbf formats? #69

Closed

Description

  1. At this page, it use *.vector.pbf format.

http://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/14/4823/6160.vector.pbf?access_token=

  1. But, this page said the vector tile format is *.mvt files.

The filename extension for Vector Tile files SHOULD be mvt. For example, a file might be named vector.mvt.

3.How can I parse the *.vector.pbf files?

So, I'm confused about them...
I want to show own vector map data in Android devices by Mapbox, the other formats files needs to be converted to *.mvt or *.vector.pbffiles?

Activity

  1. jingsam commented on Mar 16, 2016

    @jingsam
    Contributor

    It is SHOULD, not MUST. mvt and vector.pbf have the same format, just with different names.

  2. flippmoke commented on Mar 16, 2016

    @flippmoke
    Member

    @zhangzhuowh

    1. We have not yet updated our service to use and serve vector tile 2 specification tiles, we are currently serving just v1 tiles. Our intent is to do so soon, but we want to make sure that all our endpoints can serve them properly at the same time so this is a big upgrade for us. We released the specification prior to doing our upgrade. Once we release the new specification we will be supporting the .mvt extension and encouraging people to use it. This will change the documentation pages you have linked.
    2. vector.pbf was the legacy way to represent vector tiles as an extension.
    3. After our upgrade the .vector.pbf extension will still work and will serve v2 tiles going forward from Mapbox.

    If you have further questions feel free to hit up Mapbox Support.

  3. fosskers commented on Jun 13, 2016

    @fosskers

    @flippmoke Has that happened yet?

  4. mapsam commented on Jun 13, 2016

    @mapsam
    Contributor

    @fosskers it has!

    Mapbox tilesets (streets & terrain, current and previous versions) are now v2 compliant, as well as any custom datasets uploaded to Mapbox after mid-April. Any existing custom tilesets (uploaded before mid-April) can be converted by re-uploading as new tilesets.

    The .vector.pbf and .mvt file extensions both work currently in order to preserve many existing applications - but any of the above tilesets served as .vector.pbf will be v2 compliant. This is a bit confusing for now - apologies! Mapbox GL JS and GL Native continue to request .vector.pbf until that change is made in those libraries separately.

    Also, please point any further Mapbox-platform-specific questions towards support if you can!

  5. fosskers commented on Jun 13, 2016

    @fosskers

    Thanks, that's good to hear. I'm trying to find a v2 .mvt to test my decoder on.

  6. mapsam commented on Jun 13, 2016

    @mapsam
    Contributor
    http://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v6/14/4823/6160.mvt?access_token=<your access token>
    

    @fosskers the above will get you a single tile that is v2 compliant. You'll just need a Mapbox access token to get that.

  7. fosskers commented on Jun 13, 2016

    @fosskers

    Grabbed it, thanks!

  8. mapsam commented on Jun 13, 2016

    @mapsam
    Contributor

    Ah, @fosskers worth noting that you can increase the mapbox-streets tileset to v7 for the most recent geometries.

    http://a.tiles.mapbox.com/v4/mapbox.mapbox-streets-v7/14/4823/6160.mvt?access_token=<your access token>
    
  9. fosskers commented on Jun 13, 2016

    @fosskers

    Corrected, thanks.

  10. fosskers commented on Jun 14, 2016

    @fosskers

    @mapsam Forgive me for bothering you in this thread on this, but I thought it best to maintain continuity.

    Three codecs I've tried to decode that tile with have failed. Two are my own, one is 3rd party. Here's the output from the Python library mapbox-vector-tile:

    Traceback (most recent call last):
      File "vt2.py", line 6, in <module>
        decoded = mapbox_vector_tile.decode(data, y_coord_down=True)
      File "/usr/lib/python3.5/site-packages/mapbox_vector_tile/__init__.py", line 7, in decode
        message = vector_tile.getMessage(tile, y_coord_down)
      File "/usr/lib/python3.5/site-packages/mapbox_vector_tile/decoder.py", line 31, in getMessage
        self.tile.ParseFromString(pbf_data)
      File "/usr/lib/python3.5/site-packages/google/protobuf/message.py", line 185, in ParseFromString
        self.MergeFromString(serialized)
      File "/usr/lib/python3.5/site-packages/google/protobuf/internal/python_message.py", line 1091, in MergeFromString
        if self._InternalParse(serialized, 0, length) != length:
      File "/usr/lib/python3.5/site-packages/google/protobuf/internal/python_message.py", line 1117, in InternalParse
        new_pos = local_SkipField(buffer, new_pos, end, tag_bytes)
      File "/usr/lib/python3.5/site-packages/google/protobuf/internal/decoder.py", line 850, in SkipField
        return WIRETYPE_TO_SKIPPER[wire_type](buffer, pos, end)
      File "/usr/lib/python3.5/site-packages/google/protobuf/internal/decoder.py", line 820, in _RaiseInvalidWireType
        raise _DecodeError('Tag had invalid wire type.')
    google.protobuf.message.DecodeError: Tag had invalid wire type.
  11. flippmoke commented on Jun 14, 2016

    @flippmoke
    Member

    @fosskers is the tile compressed in gzip format? I node mapnik we automatically detect and ungzip tiles (even if they do not end in .mvt.gz)

  12. fosskers commented on Jun 15, 2016

    @fosskers

    Success! It was compressed. Everything's golden now, thanks much.

  13. mapsam commented on Jun 15, 2016

    @mapsam
    Contributor

    \o/

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions