5 Commits
Author SHA1 Message Date
julienfastreandClaude Opus 5.5 ee0db7699c Upload converted files to the generic package registry
Convert BeST addresses / convert (push) Failing after 6m8s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqsmB8BBnudp4djsjWpk11
2026-10-14 18:51:39 +02:00
julienfastreandClaude Opus 5.5 17cbbb8145 Use cth-ubuntu-latest runner image
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqsmB8BBnudp4djsjWpk11
2026-10-14 18:35:03 +02:00
julienfastre 51df67442a explain cronjob in the readme file
Convert BeST addresses / convert (push) Successful in 5m13s
2026-10-14 18:32:51 +02:00
julienfastreandClaude Opus 5.5 10b86483b4 Migrate CI from Drone to Gitea Actions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XqsmB8BBnudp4djsjWpk11
2026-10-14 17:53:17 +02:00
julienfastre 54f0d0a6a2 append housenumber and boxnumber to result
continuous-integration/drone/push Build is failing
continuous-integration/drone/tag Build is passing
2024-05-30 15:33:26 +02:00
3 changed files with 71 additions and 1 deletions

No files matched your search

+1 -1
View File
@@ -13,7 +13,7 @@ steps:
- name: convert
image: osgeo/gdal:alpine-normal-3.6.3
environment:
SELECT: SELECT shape AS geom, id, best_id, coalesce(streetname_fr, streetname_nl, streetname_de) AS streetname, postal_info_objectid, municipality_objectid, COALESCE(municipality_fr, municipality_nl, municipality_de) AS municipality
SELECT: SELECT shape AS geom, id, best_id, coalesce(streetname_fr, streetname_nl, streetname_de) AS streetname, postal_info_objectid, municipality_objectid, COALESCE(municipality_fr, municipality_nl, municipality_de) AS municipality, housenumber, boxnumber
commands:
- unzip -o bestaddresses.zip
- ogrinfo ca0fd5c0-8146-11e9-9012-482ae30f98d9_geopackage+sqlite3_3812.gpkg -sql "CREATE INDEX idx_postal_code ON addresses_complete (postal_info_objectid) WHERE status NOT LIKE 'retired'"
+69
View File
@@ -0,0 +1,69 @@
name: Convert BeST addresses
run-name: Convert BeST addresses to csv (${{ gitea.ref_name }})
on:
push:
branches:
- '**'
tags:
- '**'
workflow_dispatch:
env:
GPKG: ca0fd5c0-8146-11e9-9012-482ae30f98d9_geopackage+sqlite3_3812.gpkg
SOURCE_URL: https://ac.ngi.be/remoteclient-open/GeoBePartners-open/BOSA/ca0fd5c0-8146-11e9-9012-482ae30f98d9_geopackage+sqlite3_3812.zip
SELECT: SELECT shape AS geom, id, best_id, coalesce(streetname_fr, streetname_nl, streetname_de) AS streetname, postal_info_objectid, municipality_objectid, COALESCE(municipality_fr, municipality_nl, municipality_de) AS municipality, housenumber, boxnumber
jobs:
convert:
runs-on: cth-ubuntu-latest
steps:
- name: install dependencies
run: |
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gdal-bin unzip curl ca-certificates
ogr2ogr --version
- name: download
run: curl --fail --location --silent --show-error --output bestaddresses.zip "$SOURCE_URL"
- name: convert
run: |
set -eu
unzip -o bestaddresses.zip
rm bestaddresses.zip
ogrinfo "$GPKG" -sql "CREATE INDEX idx_postal_code ON addresses_complete (postal_info_objectid) WHERE status NOT LIKE 'retired'"
ogr2ogr -sql "select St_Centroid(St_Envelope(St_Collect(shape))) AS center, COALESCE(municipality_fr, municipality_nl, municipality_de) AS municipality_name, postal_info_objectid, municipality_objectid FROM addresses_complete where fid % 10 = 1 AND status NOT LIKE 'retired' GROUP BY COALESCE(municipality_fr, municipality_nl, municipality_de), postal_info_objectid, municipality_objectid" -lco GEOMETRY=AS_XY postals.fr.csv "$GPKG"
ogr2ogr -sql "$SELECT FROM addresses_complete WHERE status NOT LIKE 'retired' LIMIT 10000" -lco GEOMETRY=AS_XY addresses-extract.fr.csv "$GPKG"
ogr2ogr -sql "$SELECT FROM addresses_complete WHERE status NOT LIKE 'retired'" -lco GEOMETRY=AS_XY addresses-full.fr.csv "$GPKG"
for i in 1 2 3 4 5 6 7 8 9; do
ogr2ogr -sql "$SELECT FROM addresses_complete WHERE postal_info_objectid LIKE '${i}%' AND status NOT LIKE 'retired'" -lco GEOMETRY=AS_XY "addresses-${i}xxx.fr.csv" "$GPKG"
done
rm "$GPKG"
gzip -9 *.csv
ls -lh *.fr.csv.gz
- name: upload to generic package registry
env:
TOKEN: ${{ secrets.GITEA_TOKEN }}
PACKAGE_URL: ${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/generic/addresses/v1.1.1
run: |
set -eu
for f in *.fr.csv.gz; do
# gitea refuses to overwrite an existing file (409): delete it first, ignore 404
status=$(curl --silent --output /dev/null --write-out '%{http_code}' -X DELETE -H "Authorization: token $TOKEN" "$PACKAGE_URL/$f")
echo "DELETE $f: $status"
curl --fail-with-body --silent --show-error -H "Authorization: token $TOKEN" --upload-file "$f" "$PACKAGE_URL/$f"
echo "PUT $f: ok"
done
- name: gitea release
if: gitea.ref_type == 'tag'
uses: https://github.com/akkuman/gitea-release-action@v1
with:
server_url: https://gitea.champs-libres.be
token: ${{ secrets.GITEA_TOKEN }}
name: ${{ gitea.ref_name }}
tag_name: ${{ gitea.ref_name }}
files: |-
*.fr.csv.gz
+1
View File
@@ -2,6 +2,7 @@
Ce dépôt convertit les données d'adresses mises à disposition dans le cadre de [Best Address](https://www.geo.be/catalog/details/ca0fd5c0-8146-11e9-9012-482ae30f98d9?l=fr) en un format csv, utilisable par le logiciel Chill.
Ce dépôt compile mensuellement les adresses.
## Liste des codes postaux