Skip to content

Commit 8e6ab21

Browse files
committed
Setup cleanup.
1 parent 0f539e9 commit 8e6ab21

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tyler-urban/setup.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ USER="onyxfish"
77
OGR_PG="host=$HOST dbname=$DATABASE user=$USER"
88
SRID="900913"
99

10+
PSQL="psql -h $HOST -q $DATABASE -U $USER"
11+
1012
ogr2ogr -f "PostgreSQL" PG:"$OGR_PG" -nln sidewalks sidewalk -overwrite -nlt multilinestring -t_srs EPSG:$SRID
1113
ogr2ogr -f "PostgreSQL" PG:"$OGR_PG" -nln bike_routes bike_routes -overwrite -nlt multilinestring -t_srs EPSG:$SRID
1214
ogr2ogr -f "PostgreSQL" PG:"$OGR_PG" -nln structures structures -overwrite -nlt multilinestring -t_srs EPSG:$SRID
@@ -18,9 +20,11 @@ ogr2ogr -f "PostgreSQL" PG:"$OGR_PG" -nln schools schools -overwrite -nlt multip
1820
ogr2ogr -f "PostgreSQL" PG:"$OGR_PG" -nln interact parks -overwrite -nlt geometry -t_srs EPSG:$SRID -sql "select NAME, 'park' as TYPE from Parks"
1921
ogr2ogr -f "PostgreSQL" PG:"$OGR_PG" -nln interact schools -append -nlt geometry -t_srs EPSG:$SRID -sql "select FACILITY as NAME, 'school' as TYPE from Educational"
2022

21-
echo "CREATE TABLE centerline_merged AS SELECT ST_LineMerge(ST_Union(wkb_geometry)) as wkb_geometry, fullname FROM centerline GROUP BY fullname;" | psql -h $HOST -q hacktyler-urban -U onyxfish
23+
$PSQL -c "CREATE TABLE centerline_merged AS SELECT ST_LineMerge(ST_Union(wkb_geometry)) as wkb_geometry, fullname FROM centerline GROUP BY fullname;"
24+
25+
$PSQL -c "CREATE TABLE park_centroids AS SELECT ST_Centroid(ST_Union(wkb_geometry)) as wkb_geometry, name || ' PARK' as name FROM parks GROUP BY name;"
2226

23-
echo "CREATE TABLE park_centroids AS SELECT ST_Centroid(ST_Union(wkb_geometry)) as wkb_geometry, name FROM parks GROUP BY name" | psql -h $HOST -q hacktyler-urban -U onyxfish
27+
$PSQL -c "UPDATE park_centroids SET name='CHILDRENS PARK' WHERE name='CHILDREN PARK';"
2428

25-
echo "CREATE TABLE school_centroids AS SELECT ST_Centroid(ST_Union(wkb_geometry)) as wkb_geometry, facility as name FROM schools GROUP BY facility" | psql -h $HOST -q hacktyler-urban -U onyxfish
29+
$PSQL -c "CREATE TABLE school_centroids AS SELECT ST_Centroid(ST_Union(wkb_geometry)) as wkb_geometry, facility as name FROM schools GROUP BY facility"
2630

0 commit comments

Comments
 (0)