-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·22 lines (22 loc) · 1.08 KB
/
run.sh
File metadata and controls
executable file
·22 lines (22 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# TODO https://stackoverflow.com/questions/41696675/how-to-copy-a-csv-file-from-a-url-to-postgresql
#source venv/bin/activate
echo "Addresses..."
python3 csventrifuge.py luxembourg_addresses luxembourg-addresses.csv
echo "Streets..."
python3 ./csventrifuge.py luxembourg-caclr-dicacolo_local luxembourg-streets.csv
echo "CACLR..."
python3 ./csventrifuge.py luxembourg-caclr-commuall_local luxembourg-communes.csv
if command -v psql &> /dev/null
then
# TODO https://stackoverflow.com/questions/41696675/how-to-copy-a-csv-file-from-a-url-to-postgresql
echo "Importing addresses into postgres..."
psql -d osmlu -f ../import_addresses.sql
psql -d osmlu -f ../import_cadastre.sql
fi
cp luxembourg-addresses.csv ../public_html/csventrifuge/.
cp luxembourg-streets.csv ../public_html/csventrifuge/.
echo "Converting for JOSM"
#echo addr:street,addr:housenumber,addr:city,addr:postcode,ref:caclr,lat_wgs84,lon_wgs84,commune > "$(date +%Y-%m-%d)-addresses.csv"
#cut -d , -f 3-6,8-10 luxembourg-addresses.csv | tail -n +2 >> "$(date +%Y-%m-%d)-addresses.csv"
python3 process_addresses.py