Delete load_tables.sh
Browse files- load_tables.sh +0 -24
load_tables.sh
DELETED
@@ -1,24 +0,0 @@
|
|
1 |
-
# Set some variables
|
2 |
-
SHP_FILES_DIRECTORY = "" # absolute path of downloaded .zip files along with dataset.
|
3 |
-
UNZIP_DEST_DIRECTORY = "" # destination folder to unzip into .shp files
|
4 |
-
HOST_NAME = "" # postgres hostname
|
5 |
-
DB_NAME = "" # postgres database
|
6 |
-
PG_USER = "" # postgres user
|
7 |
-
|
8 |
-
# Unzip all the shapefiles
|
9 |
-
unzip $(SHP_FILES_DIRECTORY)/tl_2023_us_state -d $(UNZIP_DEST_DIRECTORY)/state
|
10 |
-
unzip $(SHP_FILES_DIRECTORY)/tl_2023_us_county -d $(UNZIP_DEST_DIRECTORY)/county
|
11 |
-
unzip $(SHP_FILES_DIRECTORY)/tl_2023_us_coastline -d $(UNZIP_DEST_DIRECTORY)/coastline
|
12 |
-
unzip $(SHP_FILES_DIRECTORY)/tl_2023_us_cbsa -d $(UNZIP_DEST_DIRECTORY)/cbsa
|
13 |
-
unzip $(SHP_FILES_DIRECTORY)/tl_2023_us_mil -d $(UNZIP_DEST_DIRECTORY)/mil
|
14 |
-
unzip $(SHP_FILES_DIRECTORY)/tl_2023_us_primaryroads -d $(UNZIP_DEST_DIRECTORY)/roads
|
15 |
-
unzip $(SHP_FILES_DIRECTORY)/tl_2023_us_rails -d $(UNZIP_DEST_DIRECTORY)/rails
|
16 |
-
|
17 |
-
# Load all these shapefiles into your postgres database with postgis extension enabled.
|
18 |
-
shp2pgsql -D -I -s 4269 $(UNZIP_DEST_DIRECTORY)/state/tl_2023_us_state.shp public.tl_2023_us_state | psql -d $DB_NAME -h $HOST_NAME -U $PG_USER
|
19 |
-
shp2pgsql -D -I -s 4269 $(UNZIP_DEST_DIRECTORY)/county/tl_2023_us_county.shp public.tl_2023_us_county | psql -d $DB_NAME -h $HOST_NAME -U $PG_USER
|
20 |
-
shp2pgsql -D -I -s 4269 $(UNZIP_DEST_DIRECTORY)/coastline/tl_2023_us_coastline.shp public.tl_2023_us_coastline | psql -d $DB_NAME -h $HOST_NAME -U $PG_USER
|
21 |
-
shp2pgsql -D -I -s 4269 $(UNZIP_DEST_DIRECTORY)/cbsa/tl_2023_us_cbsa.shp public.tl_2023_us_cbsa | psql -d $DB_NAME -h $HOST_NAME -U $PG_USER
|
22 |
-
shp2pgsql -D -I -s 4269 $(UNZIP_DEST_DIRECTORY)/mil/tl_2023_us_mil.shp public.tl_2023_us_mil | psql -d $DB_NAME -h $HOST_NAME -U $PG_USER
|
23 |
-
shp2pgsql -D -I -s 4269 $(UNZIP_DEST_DIRECTORY)/roads/tl_2023_us_primaryroads.shp public.tl_2023_us_primaryroads | psql -d $DB_NAME -h $HOST_NAME -U $PG_USER
|
24 |
-
shp2pgsql -D -I -s 4269 $(UNZIP_DEST_DIRECTORY)/rails/tl_2023_us_rails.shp public.tl_2023_us_rails | psql -d $DB_NAME -h $HOST_NAME -U $PG_USER
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|