.PHONY: process_data SHELL := /bin/bash pbfs/hamburg-latest.osm.pbf: cd pbfs && wget https://download.geofabrik.de/europe/germany/hamburg-latest.osm.pbf pbfs/denmark-latest.osm.pbf: 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;" denmark: # 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";' count_per_country: sudo -u postgres psql -d map.node5.net -c "select country, count(*) from poi group by country;" db_shell: sudo -u postgres psql -d map.node5.net notify_desktop: notify-send "OSM processing" "done" process_data: denmark hamburg count_per_country notify_desktop .DEFAULT_GOAL := process_data