diff --git a/scripts/ca_statcan_open_database_of_buildings_2025-04-15/02_process.sh b/scripts/ca_statcan_open_database_of_buildings_2025-04-15/02_process.sh index 6d0102b..f033b13 100644 --- a/scripts/ca_statcan_open_database_of_buildings_2025-04-15/02_process.sh +++ b/scripts/ca_statcan_open_database_of_buildings_2025-04-15/02_process.sh @@ -9,6 +9,7 @@ DATASET_ID="ca_statcan_open_database_of_buildings_2025-04-15" OUTPUT_GEOPACKAGE="${SCRATCH_FOLDER}/${DATASET_ID}/${DATASET_ID}.gpkg" OUTPUT_FLATGEOBUF="${SCRATCH_FOLDER}/${DATASET_ID}/${DATASET_ID}.fgb" +# Merge all of the GeoPackages into one FIRST=true for FILE in ${SCRATCH_FOLDER}/${DATASET_ID}/ODB*.gpkg; do if [ "${FILE}" == "${OUTPUT_GEOPACKAGE}" ]; then @@ -24,13 +25,14 @@ for FILE in ${SCRATCH_FOLDER}/${DATASET_ID}/ODB*.gpkg; do fi done +# Create a FlatGeoBuf from the GeoPackage echo "Creating ${OUTPUT_FLATGEOBUF} from ${OUTPUT_GEOPACKAGE}" ogr2ogr -f FlatGeobuf \ -progress \ -t_srs EPSG:4326 \ -nlt "MULTIPOLYGON2D" \ - -lco "TITLE=Open Database of Buildings (ODB) - Statistics Canada / Base de données ouverte sur les bâtiments (BDOB) - Statistique Canada" \ - -lco "DESCRIPTION=Harmonized building footprints and attributes across Canada, optimized for cloud-native GIS workflows. / Empreintes et attributs de bâtiments harmonisés à l'échelle du Canada, optimisés pour les flux de travail SIG infonuagiques" \ + -lco "TITLE=Open Database of Buildings (ODB) from Statistics Canada for 2025-04-15 / Base de données ouverte sur les bâtiments (BDOB) de Statistique Canada pour le 2025-04-15" \ + -lco "DESCRIPTION=Harmonized building footprints and attributes across Canada / Empreintes et attributs de bâtiments harmonisés à l'échelle du Canada" \ "${OUTPUT_FLATGEOBUF}" \ "${OUTPUT_GEOPACKAGE}" diff --git a/scripts/ca_statcan_open_database_of_buildings_2025-04-15/03_generate_tiles.sh b/scripts/ca_statcan_open_database_of_buildings_2025-04-15/03_generate_tiles.sh new file mode 100644 index 0000000..85f85c4 --- /dev/null +++ b/scripts/ca_statcan_open_database_of_buildings_2025-04-15/03_generate_tiles.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +SCRATCH_FOLDER="${HOME}/tmp/dataforcanada/process-foundation-dev" +DATASET_ID="ca_statcan_open_database_of_buildings_2025-04-15" +INPUT_FILE="${SCRATCH_FOLDER}/${DATASET_ID}/${DATASET_ID}.fgb" + +ARGS=( + -progress + -name "Open Database of Buildings (ODB) from Statistics Canada for 2025-04-15 / Base de données ouverte sur les bâtiments (BDOB) de Statistique Canada pour le 2025-04-15" + -description "Harmonized building footprints and attributes across Canada / Empreintes et attributs de bâtiments harmonisés à l'échelle du Canada" + -attribution "Source: https://www150.statcan.gc.ca/n1/en/catalogue/34260001 / Source: https://www150.statcan.gc.ca/n1/en/catalogue/34260001" + -mbtiles_compatible + -srs_epsg + -vector_compress + -work_dir ~/tmp/maptiler_engine + -o "${SCRATCH_FOLDER}/${DATASET_ID}/${DATASET_ID}.mbtiles" + "${INPUT_FILE}" +) + +maptiler-engine "${ARGS[@]}"