I downloaded a mbtiles file from this location:
https://openmaptiles.com/downloads/europe/netherlands/
I can serve this file in PHP with this library : https://github.com/klokantech/tileserver-php
This returns a compressed PBF, which Mapbox GL JS can use, but I'm not able in PHP to decode this data to get information out of it.
Has anybody ever extracted data from PBF using PHP ?
I know that this thread is a little bit old right now, but I will answer this anyway in case someone bumps into this issue.
You can use package named osm-pbf, for reading PBF files using PHP. As far as I know, it is currently the only option if you want to use PHP.
Link to package: https://github.com/franksierra/osm-pbf
Installation is fairly easy, you can just use composer.
The library itself is pretty slow, it takes around 8 minutes to read 300MB PBF file, but for smaller files it works like a charm.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With