4

I'm looking for a way to transform geoJson (obtained from a query to potsgis) to mapbox vector format, serverside in nodejs, without using mapnik (I dont have access to the server and therefore cannot use mapnik, as it needs certain specific versions as seen here https://github.com/mapnik/node-mapnik/wiki/Troubleshooting)

Is there any libraries allowing to do that ?

3

2 Answers 2

6

I ended up using those two packages : https://github.com/mapbox/geojson-vt (for getting a tile from geojson) and https://github.com/mapbox/vt-pbf (for transforming this tile into pbf)

I made a quick module from that (maybe not ready for production use, but hey, it is a good start) : https://github.com/philippeauriach/vector-tiles-generator

2

With PostGIS >2.4.0, you can also convert your geometries to mapbox vector tiles directly. For more information, see http://postgis.net/docs//ST_AsMVT.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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