7

We are currently hosting OSM vector tiles on our mapping server (courtesy osm2vectortiles and tilesever-gl). Now I'm trying to convert our own shapefiles into the same Mapbox Vector Tile format so we can add them as an overlay to our maps.

I believe one way this can be accomplished is by importing the shapefile to PostGIS and then creating vector tiles from that, but I'd like to avoid having to use PostGIS as a middleman if I can, and instead go directly from Shapefile->Mapbox Vector Tiles (which will be stored in an MBTiles container). These will then be served via tileserver-gl.

Does any such tool exist that can convert shapefiles (1-2GB) directly to vector tiles, and ideally perform simplification while it does so?

2 Answers 2

5

mapbox-tile-copy will convert shapefiles (and a bunch of other formats) to Mapbox Vector Tiles on Amazon S3.

There is also tippecanoe to create an mbtiles of vector tiles from your shapefile.

2
  • FYI getting tippcanoe to work with Red hat or Ubutnu is difficult as the supported install method is on MacOS via Hombrew. Commented Nov 9, 2017 at 22:59
  • There are install instructions for Ubuntu at github.com/mapbox/tippecanoe/blob/master/README.md#development you just need to apt install some dependencies and then make; make install, should be straightforward. Commented Nov 10, 2017 at 4:46
3

With the release of QGIS 3.8 there is new feature to generate raster MBTiles layers. Once the layer you want to convert is setup, you can open up the Toolbox by either selecting the gear icon or by going into the processing tab on the menu bar and selecting toolbox. Then in the Processing Toolbox, drill-down into the Raster Tools section. Within this section, select the Generate XYZ tile (MBTiles) option.

Here is a reference to this with a straight forward and well illustrated example on how to use this new QGIS feature.

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.