Skip to content

🇧🇪 Wallonia, Belgium #108

🇧🇪 Wallonia, Belgium

🇧🇪 Wallonia, Belgium #108

name: 🇧🇪 Wallonia, Belgium
on:
workflow_dispatch:
# Run every Sunday at 12:00 UTC
schedule:
- cron: "0 12 * * 0"
push:
paths:
- ".github/workflows/belgium-wallonia.yml"
- ".github/actions/*/action.yml"
- "script/**/*.ts"
- "data/belgium/wallonia/convert.json"
- "data/belgium/wallonia/filter.sql"
pull_request:
paths:
- ".github/workflows/belgium-wallonia.yml"
- ".github/actions/*/action.yml"
- "script/**/*.ts"
- "data/belgium/wallonia/convert.json"
- "data/belgium/wallonia/filter.sql"
# Allow one concurrent deployment
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
MAPROULETTE_CHALLENGE_ID: 14681
jobs:
diff-bra:
name: Generate difference for Brabant Wallon, Wallonia, Belgium
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GDAL
run: |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt install gdal-bin
- name: Install Tippecanoe
uses: ./.github/actions/install-tippecanoe
- name: Install dependencies
run: npm install
working-directory: script
- name: Build
run: npm run build
working-directory: script
- name: Generate OpenStreetMap buffers
uses: ./.github/actions/openstreetmap-buffers
with:
country: europe/belgium
- name: Download & Unzip PICC data
run: |
wget "https://geoservices.wallonie.be/geotraitement/spwdatadownload/get/b795de68-726c-4bdf-a62a-a42686aa5b6f/PICC_vDIFF_SHAPE_31370_PROV_BRABANT_WALLON.zip"
unzip -j "PICC_vDIFF_SHAPE_31370_PROV_BRABANT_WALLON.zip" "VOIRIE_AXE.*"
- name: Convert (and filter) PICC to GeoJSON
run: |
ogr2ogr -f "GeoJSON" -progress \
-s_srs "EPSG:31370" -t_srs "EPSG:4326" -dim "XY" \
-makevalid \
-sql "@data/belgium/wallonia/filter.sql" \
-lco COORDINATE_PRECISION=6 \
-fieldTypeToString "All" \
"BRA_VOIRIE_AXE.geojson" \
"VOIRIE_AXE.shp"
- name: Convert PICC fields to OpenStreetMap tags
run: node "script/convert-tags.js" -c "data/belgium/wallonia/convert.json" "BRA_VOIRIE_AXE.geojson" "BRA_VOIRIE_AXETagged.geojson"
- name: Generate PICC vector tiles
run: |
tippecanoe --force --no-feature-limit --no-tile-size-limit \
--buffer=0 \
--maximum-zoom=14 --minimum-zoom=14 \
--layer="roads" \
--output="BRA_VOIRIE_AXETagged.mbtiles" "BRA_VOIRIE_AXETagged.geojson"
- name: Generate MapRoulette buffers
uses: ./.github/actions/maproulette-buffers
with:
challenge-id: ${{ env.MAPROULETTE_CHALLENGE_ID }}
- name: Upload MapRoulette false positive
uses: actions/upload-artifact@v3
with:
name: MapRoulette-FalsePositive
path: maproulette.geojson
- name: Merge MapRoulette buffers to OpenStreetMap buffers and generate vector tiles
run: |
tippecanoe --force --no-feature-limit --no-tile-size-limit \
--maximum-zoom=14 --minimum-zoom=14 \
--layer="buffers" \
--output="belgium-buffers.mbtiles" \
"openstreetmap-lines-buffers.geojson" "openstreetmap-polygons-buffers.geojson" "maproulette-buffers.geojson"
- name: Difference
run: node "script/difference.js" --output-dir="data/belgium/wallonia/difference/BRA" "BRA_VOIRIE_AXETagged.mbtiles" "belgium-buffers.mbtiles"
- name: Upload difference
uses: actions/upload-artifact@v3
with:
name: BrabantWallon-Difference
path: data/belgium/wallonia/difference/BRA/diff.geojson
- name: Upload statistics
uses: actions/upload-artifact@v3
with:
name: BrabantWallon-Statistics
path: data/belgium/wallonia/difference/BRA/stats.json
diff-hai:
name: Generate difference for Hainaut, Wallonia, Belgium
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GDAL
run: |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt install gdal-bin
- name: Install Tippecanoe
uses: ./.github/actions/install-tippecanoe
- name: Install dependencies
run: npm install
working-directory: script
- name: Build
run: npm run build
working-directory: script
- name: Generate OpenStreetMap buffers
uses: ./.github/actions/openstreetmap-buffers
with:
country: europe/belgium
- name: Download & Unzip PICC data
run: |
wget "https://geoservices.wallonie.be/geotraitement/spwdatadownload/get/b795de68-726c-4bdf-a62a-a42686aa5b6f/PICC_vDIFF_SHAPE_31370_PROV_HAINAUT.zip"
unzip -j "PICC_vDIFF_SHAPE_31370_PROV_HAINAUT.zip" "VOIRIE_AXE.*"
- name: Convert (and filter) PICC to GeoJSON
run: |
ogr2ogr -f "GeoJSON" -progress \
-s_srs "EPSG:31370" -t_srs "EPSG:4326" -dim "XY" \
-makevalid \
-sql "@data/belgium/wallonia/filter.sql" \
-lco COORDINATE_PRECISION=6 \
-fieldTypeToString "All" \
"HAI_VOIRIE_AXE.geojson" \
"VOIRIE_AXE.shp"
- name: Convert PICC fields to OpenStreetMap tags
run: node "script/convert-tags.js" -c "data/belgium/wallonia/convert.json" "HAI_VOIRIE_AXE.geojson" "HAI_VOIRIE_AXETagged.geojson"
- name: Generate PICC vector tiles
run: |
tippecanoe --force --no-feature-limit --no-tile-size-limit \
--buffer=0 \
--maximum-zoom=14 --minimum-zoom=14 \
--layer="roads" \
--output="HAI_VOIRIE_AXETagged.mbtiles" "HAI_VOIRIE_AXETagged.geojson"
- name: Generate MapRoulette buffers
uses: ./.github/actions/maproulette-buffers
with:
challenge-id: ${{ env.MAPROULETTE_CHALLENGE_ID }}
# - name: Upload MapRoulette false positive
# uses: actions/upload-artifact@v3
# with:
# name: MapRoulette-FalsePositive
# path: maproulette.geojson
- name: Merge MapRoulette buffers to OpenStreetMap buffers and generate vector tiles
run: |
tippecanoe --force --no-feature-limit --no-tile-size-limit \
--maximum-zoom=14 --minimum-zoom=14 \
--layer="buffers" \
--output="belgium-buffers.mbtiles" \
"openstreetmap-lines-buffers.geojson" "openstreetmap-polygons-buffers.geojson" "maproulette-buffers.geojson"
- name: Difference
run: node "script/difference.js" --output-dir="data/belgium/wallonia/difference/HAI" "HAI_VOIRIE_AXETagged.mbtiles" "belgium-buffers.mbtiles"
- name: Upload difference
uses: actions/upload-artifact@v3
with:
name: Hainaut-Difference
path: data/belgium/wallonia/difference/HAI/diff.geojson
- name: Upload statistics
uses: actions/upload-artifact@v3
with:
name: Hainaut-Statistics
path: data/belgium/wallonia/difference/HAI/stats.json
diff-lie:
name: Generate difference for Liège, Wallonia, Belgium
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GDAL
run: |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt install gdal-bin
- name: Install Tippecanoe
uses: ./.github/actions/install-tippecanoe
- name: Install dependencies
run: npm install
working-directory: script
- name: Build
run: npm run build
working-directory: script
- name: Generate OpenStreetMap buffers
uses: ./.github/actions/openstreetmap-buffers
with:
country: europe/belgium
- name: Download & Unzip PICC data
run: |
wget "https://geoservices.wallonie.be/geotraitement/spwdatadownload/get/b795de68-726c-4bdf-a62a-a42686aa5b6f/PICC_vDIFF_SHAPE_31370_PROV_LIEGE.zip"
unzip -j "PICC_vDIFF_SHAPE_31370_PROV_LIEGE.zip" "VOIRIE_AXE.*"
- name: Convert (and filter) PICC to GeoJSON
run: |
ogr2ogr -f "GeoJSON" -progress \
-s_srs "EPSG:31370" -t_srs "EPSG:4326" -dim "XY" \
-makevalid \
-sql "@data/belgium/wallonia/filter.sql" \
-lco COORDINATE_PRECISION=6 \
-fieldTypeToString "All" \
"LIE_VOIRIE_AXE.geojson" \
"VOIRIE_AXE.shp"
- name: Convert PICC fields to OpenStreetMap tags
run: node "script/convert-tags.js" -c "data/belgium/wallonia/convert.json" "LIE_VOIRIE_AXE.geojson" "LIE_VOIRIE_AXETagged.geojson"
- name: Generate PICC vector tiles
run: |
tippecanoe --force --no-feature-limit --no-tile-size-limit \
--buffer=0 \
--maximum-zoom=14 --minimum-zoom=14 \
--layer="roads" \
--output="LIE_VOIRIE_AXETagged.mbtiles" "LIE_VOIRIE_AXETagged.geojson"
- name: Generate MapRoulette buffers
uses: ./.github/actions/maproulette-buffers
with:
challenge-id: ${{ env.MAPROULETTE_CHALLENGE_ID }}
# - name: Upload MapRoulette false positive
# uses: actions/upload-artifact@v3
# with:
# name: MapRoulette-FalsePositive
# path: maproulette.geojson
- name: Merge MapRoulette buffers to OpenStreetMap buffers and generate vector tiles
run: |
tippecanoe --force --no-feature-limit --no-tile-size-limit \
--maximum-zoom=14 --minimum-zoom=14 \
--layer="buffers" \
--output="belgium-buffers.mbtiles" \
"openstreetmap-lines-buffers.geojson" "openstreetmap-polygons-buffers.geojson" "maproulette-buffers.geojson"
- name: Difference
run: node "script/difference.js" --output-dir="data/belgium/wallonia/difference/LIE" "LIE_VOIRIE_AXETagged.mbtiles" "belgium-buffers.mbtiles"
- name: Upload difference
uses: actions/upload-artifact@v3
with:
name: Liege-Difference
path: data/belgium/wallonia/difference/LIE/diff.geojson
- name: Upload statistics
uses: actions/upload-artifact@v3
with:
name: Liege-Statistics
path: data/belgium/wallonia/difference/LIE/stats.json
diff-lux:
name: Generate difference for Luxembourg, Wallonia, Belgium
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GDAL
run: |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt install gdal-bin
- name: Install Tippecanoe
uses: ./.github/actions/install-tippecanoe
- name: Install dependencies
run: npm install
working-directory: script
- name: Build
run: npm run build
working-directory: script
- name: Generate OpenStreetMap buffers
uses: ./.github/actions/openstreetmap-buffers
with:
country: europe/belgium
- name: Download & Unzip PICC data
run: |
wget "https://geoservices.wallonie.be/geotraitement/spwdatadownload/get/b795de68-726c-4bdf-a62a-a42686aa5b6f/PICC_vDIFF_SHAPE_31370_PROV_LUXEMBOURG.zip"
unzip -j "PICC_vDIFF_SHAPE_31370_PROV_LUXEMBOURG.zip" "VOIRIE_AXE.*"
- name: Convert (and filter) PICC to GeoJSON
run: |
ogr2ogr -f "GeoJSON" -progress \
-s_srs "EPSG:31370" -t_srs "EPSG:4326" -dim "XY" \
-makevalid \
-sql "@data/belgium/wallonia/filter.sql" \
-lco COORDINATE_PRECISION=6 \
-fieldTypeToString "All" \
"LUX_VOIRIE_AXE.geojson" \
"VOIRIE_AXE.shp"
- name: Convert PICC fields to OpenStreetMap tags
run: node "script/convert-tags.js" -c "data/belgium/wallonia/convert.json" "LUX_VOIRIE_AXE.geojson" "LUX_VOIRIE_AXETagged.geojson"
- name: Generate PICC vector tiles
run: |
tippecanoe --force --no-feature-limit --no-tile-size-limit \
--buffer=0 \
--maximum-zoom=14 --minimum-zoom=14 \
--layer="roads" \
--output="LUX_VOIRIE_AXETagged.mbtiles" "LUX_VOIRIE_AXETagged.geojson"
- name: Generate MapRoulette buffers
uses: ./.github/actions/maproulette-buffers
with:
challenge-id: ${{ env.MAPROULETTE_CHALLENGE_ID }}
# - name: Upload MapRoulette false positive
# uses: actions/upload-artifact@v3
# with:
# name: MapRoulette-FalsePositive
# path: maproulette.geojson
- name: Merge MapRoulette buffers to OpenStreetMap buffers and generate vector tiles
run: |
tippecanoe --force --no-feature-limit --no-tile-size-limit \
--maximum-zoom=14 --minimum-zoom=14 \
--layer="buffers" \
--output="belgium-buffers.mbtiles" \
"openstreetmap-lines-buffers.geojson" "openstreetmap-polygons-buffers.geojson" "maproulette-buffers.geojson"
- name: Difference
run: node "script/difference.js" --output-dir="data/belgium/wallonia/difference/LUX" "LUX_VOIRIE_AXETagged.mbtiles" "belgium-buffers.mbtiles"
- name: Upload difference
uses: actions/upload-artifact@v3
with:
name: Luxembourg-Difference
path: data/belgium/wallonia/difference/LUX/diff.geojson
- name: Upload statistics
uses: actions/upload-artifact@v3
with:
name: Luxembourg-Statistics
path: data/belgium/wallonia/difference/LUX/stats.json
diff-nam:
name: Generate difference for Namur, Wallonia, Belgium
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install GDAL
run: |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt install gdal-bin
- name: Install Tippecanoe
uses: ./.github/actions/install-tippecanoe
- name: Install dependencies
run: npm install
working-directory: script
- name: Build
run: npm run build
working-directory: script
- name: Generate OpenStreetMap buffers
uses: ./.github/actions/openstreetmap-buffers
with:
country: europe/belgium
- name: Download & Unzip PICC data
run: |
wget "https://geoservices.wallonie.be/geotraitement/spwdatadownload/get/b795de68-726c-4bdf-a62a-a42686aa5b6f/PICC_vDIFF_SHAPE_31370_PROV_NAMUR.zip"
unzip -j "PICC_vDIFF_SHAPE_31370_PROV_NAMUR.zip" "VOIRIE_AXE.*"
- name: Convert (and filter) PICC to GeoJSON
run: |
ogr2ogr -f "GeoJSON" -progress \
-s_srs "EPSG:31370" -t_srs "EPSG:4326" -dim "XY" \
-makevalid \
-sql "@data/belgium/wallonia/filter.sql" \
-lco COORDINATE_PRECISION=6 \
-fieldTypeToString "All" \
"NAM_VOIRIE_AXE.geojson" \
"VOIRIE_AXE.shp"
- name: Convert PICC fields to OpenStreetMap tags
run: node "script/convert-tags.js" -c "data/belgium/wallonia/convert.json" "NAM_VOIRIE_AXE.geojson" "NAM_VOIRIE_AXETagged.geojson"
- name: Generate PICC vector tiles
run: |
tippecanoe --force --no-feature-limit --no-tile-size-limit \
--buffer=0 \
--maximum-zoom=14 --minimum-zoom=14 \
--layer="roads" \
--output="NAM_VOIRIE_AXETagged.mbtiles" "NAM_VOIRIE_AXETagged.geojson"
- name: Generate MapRoulette buffers
uses: ./.github/actions/maproulette-buffers
with:
challenge-id: ${{ env.MAPROULETTE_CHALLENGE_ID }}
# - name: Upload MapRoulette false positive
# uses: actions/upload-artifact@v3
# with:
# name: MapRoulette-FalsePositive
# path: maproulette.geojson
- name: Merge MapRoulette buffers to OpenStreetMap buffers and generate vector tiles
run: |
tippecanoe --force --no-feature-limit --no-tile-size-limit \
--maximum-zoom=14 --minimum-zoom=14 \
--layer="buffers" \
--output="belgium-buffers.mbtiles" \
"openstreetmap-lines-buffers.geojson" "openstreetmap-polygons-buffers.geojson" "maproulette-buffers.geojson"
- name: Difference
run: node "script/difference.js" --output-dir="data/belgium/wallonia/difference/NAM" "NAM_VOIRIE_AXETagged.mbtiles" "belgium-buffers.mbtiles"
- name: Upload difference
uses: actions/upload-artifact@v3
with:
name: Namur-Difference
path: data/belgium/wallonia/difference/NAM/diff.geojson
- name: Upload statistics
uses: actions/upload-artifact@v3
with:
name: Namur-Statistics
path: data/belgium/wallonia/difference/NAM/stats.json
merge:
name: Generate difference for Wallonia, Belgium (merge)
runs-on: ubuntu-latest
needs: [diff-bra, diff-hai, diff-lie, diff-lux, diff-nam]
steps:
- uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Install GDAL
run: |
sudo apt-add-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt update
sudo apt install gdal-bin
- name: Clean
run: |
if [ -f "data/belgium/wallonia/difference/BRA/diff.geojson" ]; then rm "data/belgium/wallonia/difference/BRA/diff.geojson"; fi
if [ -f "data/belgium/wallonia/difference/HAI/diff.geojson" ]; then rm "data/belgium/wallonia/difference/HAI/diff.geojson"; fi
if [ -f "data/belgium/wallonia/difference/LIE/diff.geojson" ]; then rm "data/belgium/wallonia/difference/LIE/diff.geojson"; fi
if [ -f "data/belgium/wallonia/difference/LUX/diff.geojson" ]; then rm "data/belgium/wallonia/difference/LUX/diff.geojson"; fi
if [ -f "data/belgium/wallonia/difference/NAM/diff.geojson" ]; then rm "data/belgium/wallonia/difference/NAM/diff.geojson"; fi
if [ -f "data/belgium/wallonia/difference/BRA/stats.json" ]; then rm "data/belgium/wallonia/difference/BRA/stats.json"; fi
if [ -f "data/belgium/wallonia/difference/HAI/stats.json" ]; then rm "data/belgium/wallonia/difference/HAI/stats.json"; fi
if [ -f "data/belgium/wallonia/difference/LIE/stats.json" ]; then rm "data/belgium/wallonia/difference/LIE/stats.json"; fi
if [ -f "data/belgium/wallonia/difference/LUX/stats.json" ]; then rm "data/belgium/wallonia/difference/LUX/stats.json"; fi
if [ -f "data/belgium/wallonia/difference/NAM/stats.json" ]; then rm "data/belgium/wallonia/difference/NAM/stats.json"; fi
- name: Download difference for Brabant Wallon, Wallonia, Belgium
uses: actions/download-artifact@v3
with:
name: BrabantWallon-Difference
path: data/belgium/wallonia/difference/BRA
- name: Download difference for Hainaut, Wallonia, Belgium
uses: actions/download-artifact@v3
with:
name: Hainaut-Difference
path: data/belgium/wallonia/difference/HAI
- name: Download difference for Liège, Wallonia, Belgium
uses: actions/download-artifact@v3
with:
name: Liege-Difference
path: data/belgium/wallonia/difference/LIE
- name: Download difference for Luxembourg, Wallonia, Belgium
uses: actions/download-artifact@v3
with:
name: Luxembourg-Difference
path: data/belgium/wallonia/difference/LUX
- name: Download difference for Namur, Wallonia, Belgium
uses: actions/download-artifact@v3
with:
name: Namur-Difference
path: data/belgium/wallonia/difference/NAM
- name: Merge differences
run: |
if [ -f "data/belgium/wallonia/difference/diff.geojson" ]; then rm "data/belgium/wallonia/difference/diff.geojson"; fi
ogr2ogr -f "GeoJSON" -progress "data/belgium/wallonia/difference/diff.geojson" "data/belgium/wallonia/difference/BRA/diff.geojson"
ogr2ogr -f "GeoJSON" -progress -append "data/belgium/wallonia/difference/diff.geojson" "data/belgium/wallonia/difference/HAI/diff.geojson"
ogr2ogr -f "GeoJSON" -progress -append "data/belgium/wallonia/difference/diff.geojson" "data/belgium/wallonia/difference/LIE/diff.geojson"
ogr2ogr -f "GeoJSON" -progress -append "data/belgium/wallonia/difference/diff.geojson" "data/belgium/wallonia/difference/NAM/diff.geojson"
ogr2ogr -f "GeoJSON" -progress -append "data/belgium/wallonia/difference/diff.geojson" "data/belgium/wallonia/difference/LUX/diff.geojson"
- name: Upload difference
uses: actions/upload-artifact@v3
with:
name: Wallonia-Difference
path: data/belgium/wallonia/difference/diff.geojson
commit:
name: Commit & Push changes
needs: merge
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: BrabantWallon-Difference
path: data/belgium/wallonia/difference/BRA
- uses: actions/download-artifact@v3
with:
name: BrabantWallon-Statistics
path: data/belgium/wallonia/difference/BRA
- uses: actions/download-artifact@v3
with:
name: Hainaut-Difference
path: data/belgium/wallonia/difference/HAI
- uses: actions/download-artifact@v3
with:
name: Hainaut-Statistics
path: data/belgium/wallonia/difference/HAI
- uses: actions/download-artifact@v3
with:
name: Liege-Difference
path: data/belgium/wallonia/difference/LIE
- uses: actions/download-artifact@v3
with:
name: Liege-Statistics
path: data/belgium/wallonia/difference/LIE
- uses: actions/download-artifact@v3
with:
name: Luxembourg-Difference
path: data/belgium/wallonia/difference/LUX
- uses: actions/download-artifact@v3
with:
name: Luxembourg-Statistics
path: data/belgium/wallonia/difference/LUX
- uses: actions/download-artifact@v3
with:
name: Namur-Difference
path: data/belgium/wallonia/difference/NAM
- uses: actions/download-artifact@v3
with:
name: Namur-Statistics
path: data/belgium/wallonia/difference/NAM
- uses: actions/download-artifact@v3
with:
name: Wallonia-Difference
path: data/belgium/wallonia/difference
- name: Commit & Push
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git pull
git add data/belgium/wallonia/difference/*/diff.geojson
git add data/belgium/wallonia/difference/*/stats.json
git add data/belgium/wallonia/difference/diff.geojson
git commit -m "🗃 Update difference for Wallonia, Belgium"
git push
mr-rebuild:
name: Rebuild MapRoulette challenge
needs: commit
runs-on: ubuntu-latest
steps:
- name: Call MapRoulette API
run: |
curl -X "PUT" "https://maproulette.org/api/v2/challenge/${{ env.MAPROULETTE_CHALLENGE_ID }}/rebuild?removeUnmatched=true&skipSnapshot=false" \
-H "Accept: application/json" \
-H "apiKey: ${{ secrets.MAPROULETTE_API_KEY }}"