3

I am working on Google Maps with AirMap API. AirMap API provides me with vector tile data in pbf-format.

I want to render it into Google Maps. I have researched that to render pbf vector tiles on Google Map, I need to convert it into GeoJSON data. I have a lot researched about it but I haven't found any tool to convert PBF to GeoJson or tutorial. Any suggestions about how to?

  • OSM PBF can be converted to OSM XML. There should be multiple OSM XML to GeoJSON converters available. – scai Sep 20 '17 at 13:35
  • @scai, Thank you for your reply. I have tried many tools like OSMCONVERT, OGR2OGR and OSMOSIS. But my bad luck, it shows me "Invalid file format". – Chintan Panchal Sep 20 '17 at 14:12
  • You can also try osmium. If all tools fail then this is probably not an OSM PBF file. I guess it is a MapBox-specific format. Not sure how to handle this. – scai Sep 20 '17 at 14:13
  • @scai, Yes you are right. It could be mapbox specific format. – Chintan Panchal Sep 21 '17 at 6:44
2

Your data seems to be Mapbox Vector Tiles in pbf format.

GDAL 2.3 can process this data: https://www.gdal.org/drv_mvt.html

Note that MB tiles and OSM pbf files are something completely different.

  • +1 for clarifying the difference between different pbf! I got confused for a long time. The link you provided is also very helpful. – hxd1011 Sep 8 at 10:04
0

You can use tippacanoe-decode to convert PBF files to GeoJSON.

https://github.com/mapbox/tippecanoe#tippecanoe-decode

-1

You can use QGIS to load your .pbf file and once you drag and drop the file on QGIS the data will be displayed as a layer on map, then:

Right click on the layer > Save as > Change format Format: GeoJSON, choose the layer name and set COORDINATE_PRECISION=5 (recommended).

And done! Your pbf file is converted to GeoJSON.

Or you can use ogr2ogr, which is a commandline tool for converting osm to GeoJson.

  • The requested pbf vector tiles format has nothing to do with the osm pbf format. – AndreJ Nov 16 '18 at 9:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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