+ psql -d $(DB_NAME) \
+ -U $(DB_USER) \
+ -f $(POSTGIS_SQL) \
+ > /dev/null
+
+ psql -d $(DB_NAME) \
+ -U $(DB_USER) \
+ -f $(SPATIAL_REF_SYS_SQL) \
+ > /dev/null
+
+
+# This just runs the SQL script to create the sf1_blocks table.
+sf1_blocks_table:
+ psql -d $(DB_NAME) \
+ -U $(DB_USER) \
+ -f sql/create-sf1_blocks-table.sql \
+ > /dev/null
+
+
+# Create the tiger_blocks table, and create its GiST index. Having the
+# table already exist makes importing via shp2pgsql much easier.
+# Any blocks file will work as an argument.
+tiger_blocks_table:
+ $(SHP2PGSQL) \
+ -p \
+ -I \
+ -s $(TIGER_SRID) \
+ data/census2000/maryland/blocks/tl_2009_24_tabblock00.shp \
+ tiger_blocks \
+ | psql -U $(DB_USER) -d $(DB_NAME) \
+ > /dev/null
+
+# Create the "blocks" table, which is the result of joining
+# the tiger_blocks and sf1_blocks tables.
+blocks_table: tiger_blocks_table sf1_blocks_table
+ psql -U $(DB_USER) \
+ -d $(DB_NAME) \
+ -f sql/create-blocks-table.sql
+
+
+# Prepare the tiger_lines table, and create the GiST index on its
+# geometry column. Any lines shapefile will do here.
+tiger_lines_table:
+ $(SHP2PGSQL) \
+ -p \
+ -I \
+ -s $(TIGER_SRID) \
+ data/census2000/maryland/lines/tl_2009_24510_edges.shp \
+ tiger_lines \
+ | psql -U $(DB_USER) -d $(DB_NAME) \
+ > /dev/null
+
+# Add a unique index on the "tlid" column.
+ psql -U $(DB_USER) \
+ -d $(DB_NAME) \
+ -f sql/create_tlid_unique_index.sql