diff options
| author | user@node5.net <user@node5.net> | 2026-06-18 22:41:33 +0200 |
|---|---|---|
| committer | user@node5.net <user@node5.net> | 2026-06-18 23:10:33 +0200 |
| commit | 84f6db9d7b5070c2101cd0fb3971471df70e13f9 (patch) | |
| tree | 7ed03e161b0f1115f3315b5b54ae1b8f149cc8fc /data_extractor/Makefile | |
| parent | 52c5f75f80136bd5017abc88cb4b176b6aae9cda (diff) | |
nixify running
needs databse, this is handled separately
Diffstat (limited to 'data_extractor/Makefile')
| -rw-r--r-- | data_extractor/Makefile | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/data_extractor/Makefile b/data_extractor/Makefile index b9bbb1d..3506e68 100644 --- a/data_extractor/Makefile +++ b/data_extractor/Makefile @@ -1,35 +1,33 @@ -.PHONY: process_data -SHELL := /bin/bash +.PHONY: process_data hamburt denmark permission count_per_country db_shell notify_desktop process_data -pbfs/hamburg-latest.osm.pbf: +pbfs: + mkdir pbfs + +pbfs/hamburg-latest.osm.pbf: pbfs cd pbfs && wget https://download.geofabrik.de/europe/germany/hamburg-latest.osm.pbf -pbfs/denmark-latest.osm.pbf: +pbfs/denmark-latest.osm.pbf: pbfs cd pbfs && wget https://download.geofabrik.de/europe/denmark-latest.osm.pbf hamburg: pbfs/hamburg-latest.osm.pbf # Load Hamburg - # sudo -u postgres osm2pgsql -d map.node5.net -O flex -S data_extractor.lua pbfs/hamburg-latest.osm.pbf --slim --append - sudo -u postgres psql -d map.node5.net -c "update poi set region = 'Hamburg' where region IS NULL;" - sudo -u postgres psql -d map.node5.net -c "update poi set country = 'Germany' where country IS NULL;" + # sudo -u postgres osm2pgsql -d map -O flex -S data_extractor.lua pbfs/hamburg-latest.osm.pbf --slim --append + sudo -u postgres psql -d map -c "update poi set region = 'Hamburg' where region IS NULL;" + sudo -u postgres psql -d map -c "update poi set country = 'Germany' where country IS NULL;" -denmark: +denmark: pbfs/denmark-latest.osm.pbf # Load Denmark, this resets DB - sudo -u postgres osm2pgsql -d map.node5.net -O flex -S data_extractor.lua pbfs/denmark-latest.osm.pbf --slim - sudo -u postgres psql -d map.node5.net -c "update poi set country = 'Denmark' where country IS NULL;" - -permission: - # Set code user permission - sudo -u postgres psql -d map.node5.net -c 'grant select on table poi to "map.node5.net";' + sudo -u postgres osm2pgsql -d map -O flex -S data_extractor.lua pbfs/denmark-latest.osm.pbf --slim + sudo -u postgres psql -d map -c "update poi set country = 'Denmark' where country IS NULL;" count_per_country: - sudo -u postgres psql -d map.node5.net -c "select country, count(*) from poi group by country;" + sudo -u postgres psql -d map -c "select country, count(*) from poi group by country;" db_shell: - sudo -u postgres psql -d map.node5.net + sudo -u postgres psql -d map notify_desktop: - notify-send "OSM processing" "done" + notify-send "OSM processing" "done" || true process_data: denmark hamburg count_per_country notify_desktop |
