ciatph / ciatph.github.io

AMIA-CIAT demo output website (version 2.0)
https://ciatph.github.io
2 stars 0 forks source link

Upload the livelihood zones shapefiles to mapbox #33

Closed ciatph closed 3 years ago

ciatph commented 3 years ago
ciatph commented 3 years ago

The raw livelihood zones shapefiles needs to be processed to avail mapbox's free tier map loads, api and tilesets hosting. The target is to not exceed mapbox's 20 max Tileset upload per month, and to reduce the shapefiles into a smaller but comprehensible resolution so as not to exceed mapbox's now billed hosting. The following steps were done to process the shapefiles:

Shapefile Preparation for Mapbox Tileset Upload

  1. Combine (merge) the province shapefiles into their respective island group in a QGIS layer (i.e., luzon, visayas, mindanao layers).
  2. Check that each merged island group layer is error-free. Run QGIS Toolbox Processing -> Vector Grometry -> Check Validity on each of the merged layers.
  3. Fix errors if there are any reported from step no. 2. Run QGIS Toolbox Processing -> Vector Grometry -> Fix Geometry on the merged layers.
  4. Remove the columns that will not be used on the web map from the Attributes Table . Retain only: ADM2_EN, ADM3_EN, Legend_v2 and layer
  5. Simplify the merged layers to reduce the file size and avail mapbox's free tier. Use the mapshaper cli to simplify the geometries. shapefile-simplify, a nodejs script built on top of mapshaper cli can also be used.
  6. The shapefile output from step no. 5, packaged in a zipped file can now be uploaded as Tilesets to mapbox.