Download Radverkehrsdaten #652
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Download Radverkehrsdaten | |
on: | |
schedule: | |
- cron: '30 5 * * *' # 5:30 UTC | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set current date as env variable | |
run: echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Install ogr2ogr | |
run: sudo apt-get update && sudo apt-get install -y gdal-bin | |
- uses: actions/checkout@v3 | |
- name: Download | |
run: wget -O HH_WFS_DB_Rad_Plus.gml "https://geodienste.hamburg.de/HH_WFS_DB_Rad_Plus?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&typename=de.hh.up:aktuelles_jahr,de.hh.up:letzte_woche" | |
- name: Convert 2024 | |
run: ogr2ogr -f "GeoJSON" data/dbrad/dbrad_jahr_2024.json -s_srs EPSG:25832 -t_srs WGS84 -skipfailures HH_WFS_DB_Rad_Plus.gml aktuelles_jahr | |
- name: Convert Letzte Woche | |
run: ogr2ogr -f "GeoJSON" data/dbrad/dbrad_woche_$TODAY.json -s_srs EPSG:25832 -t_srs WGS84 -skipfailures HH_WFS_DB_Rad_Plus.gml letzte_woche | |
- name: Create/Refresh Symlink | |
run: ln -fs dbrad_woche_$TODAY.json data/dbrad/dbrad_letzte_woche.json | |
- name: Archive GeoJSON | |
uses: actions/upload-artifact@v3 | |
with: | |
name: dist-json | |
path: | | |
data/dbrad/*.json | |
- uses: EndBug/add-and-commit@v9 | |
with: | |
add: 'data/dbrad/*.json' | |
message: 'Fetched current data from Geoportal Hamburg' |