File tree Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 31
31
pip install beautifulsoup4==4.4.0
32
32
pip install requests==2.7.0
33
33
34
- echo " Cityscrape setup complete!"
34
+ # echo "Cityscrape setup complete!"
35
+
36
+ sudo -u postgres psql
Original file line number Diff line number Diff line change @@ -10,24 +10,31 @@ pushd $OUTPUT_DIR
10
10
echo " Unzipping files..."
11
11
unzip -f " *.zip"
12
12
13
- for f in * .shp
14
- do
15
- echo " Loading " $f
16
-
17
- ogr2ogr -overwrite -progress -skipfailures -f " PostgreSQL" PG:" host=localhost user=postgres dbname=city" $f #
13
+ if [ -z " $( ls * .shp) " ]
14
+ then
15
+ echo " No *.shp files found, exiting..."
16
+ break
17
+ else
18
+ for f in * .shp
19
+ do
20
+ echo " Loading " $f
18
21
19
- done
22
+ ogr2ogr -overwrite -progress -skipfailures -f " PostgreSQL " PG: " host=localhost user=postgres dbname=city " $f #
20
23
24
+ done
25
+ fi
21
26
22
27
for f in * .mdb
23
- do
24
- echo " Extracting tables from $f "
25
28
26
- mdb-schema $f postgres | sed ' s/Char/Varchar/g' | sed ' s/Postgres_Unknown 0x0c/text/g' | psql -h localhost -U postgres -d city
29
+ do
30
+ echo " Extracting tables from $f "
31
+
32
+ mdb-schema $f postgres | sed ' s/Char/Varchar/g' | sed ' s/Postgres_Unknown 0x0c/text/g' | psql -h localhost -U postgres -d city
27
33
28
- tables=$( echo -en $( mdb-schema $f postgres | grep " CREATE TABLE" | awk ' { print $3 }' | sed -e ' s/"//g' ) ; )
34
+ tables=$( echo -en $( mdb-schema $f postgres | grep " CREATE TABLE" | awk ' { print $3 }' | sed -e ' s/"//g' ) ; )
29
35
30
36
for i in $tables
37
+
31
38
do
32
39
echo " [File: " $f " ] [Table - " $i " ]"
33
40
37
44
38
45
done
39
46
40
- # return to project root $BASEDIR
47
+ # # return to project root $BASEDIR
41
48
popd
42
49
You can’t perform that action at this time.
0 commit comments