1

I would like to convert geojson into mbtiles either in the client or server side to be loaded in leaflet. I have data that will be inserted into postgesql everyday and I want to turn that into mbtiles when a user views the map. I have used tippecanoe and mbutils to convert it into the format that I need but I need it to have most up to date data.

I have also tried to use the mapbox dataset API but I couldn't get that to work the way I need it to.

My problem is that I have dynamic data that will be updated regularly and I want to convert that to mbtiles, then to vector tiles. One possible solution is to have the server run this every morning to convert the geojson to have fresh tiles everyday. I just cannot find a way to do this properly.

EDIT:

geojsonvt looks like something that could work for me but I can not figure out how to draw this into leaflet 1.0.3.

BStill
  • 894
  • 1
  • 9
  • 33
  • 2
    Maybe you should have a look at [Leaflet.VectorGrid](https://github.com/Leaflet/Leaflet.VectorGrid) - it leverages `geojsonvt` to load big GeoJSON files into Leaflet. – IvanSanchez Jan 19 '18 at 08:40
  • @IvanSanchez Thank you for the suggestion. I have implemented this and it has helped with the speed when it is drawn. Is there any other way to create pbf tiles automatically on the server so that the data can be updated? I like this solution but it still takes a while to load a 25 MB geojson file on mobile before it gets drawn by vectorGrid. – BStill Jan 19 '18 at 22:07

0 Answers0