X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=makefile;h=bfccc236762944d8830f6b51eb797b3de351b124;hb=717a5d47751909c5b2e0d9e984c340cb2e50be82;hp=b7ef3c24eea0b7dae47d776351dd2e0fd3527e25;hpb=730af6c2b7cc3b82a45fe8cdff720c13892316cb;p=dead%2Fcensus-tools.git diff --git a/makefile b/makefile index b7ef3c2..bfccc23 100644 --- a/makefile +++ b/makefile @@ -129,13 +129,15 @@ db: data newdb tiger_blocks_table tiger_lines_table sf1_blocks_table # and leave -I out. for state in data/census2000/*; do \ for shapefile in $$state/lines/*.shp; do \ + echo "Importing $$shapefile."; \ $(PG_BINDIR)/shp2pgsql \ -a \ -s $(TIGER_SRID) \ - -D \ $$shapefile \ tiger_lines \ - | psql -U $(DB_USER) -d $(DB_NAME); \ + | bin/filter-transactions \ + | psql -U $(DB_USER) -d $(DB_NAME) \ + > /dev/null; \ done; \ done; @@ -203,3 +205,8 @@ tiger_lines_table: tiger_lines \ | psql -U postgres -d $(DB_NAME) \ > /dev/null + +# Add a unique index on the "tlid" column. + psql -U postgres \ + -d census \ + -f sql/create_tlid_unique_index.sql