+ny_blocks:
+ mkdir -p data/census2000/new_york/block
+ if [ ! -f data/census2000/new_york/block/tl_2009_36_tabblock00.shp ]; \
+ then \
+ wget -O nyblocks.zip $(NY_BLOCKS_URL); \
+ unzip nyblocks.zip -d ./data/census2000/new_york/block; \
+ rm nyblocks.zip; \
+ fi;
+
+
+tiger_lines:
+ bin/download_data
+
+
+# This imports the Tiger data using shp2pgsql. The shapefiles
+# should exist, since this task depends on the "data" task, which
+# downloads said shapefiles.
+#
+# After the TIGER import is done, we use the sf1blocks2sql script to
+# parse and import the geographic header record information.
+#
+db: data newdb tiger_blocks_table tiger_lines_table sf1_blocks_table
+# All Blocks
+#
+# The table already exists, so we can append to it, and we don't have
+# to create the GiST index.
+ for state in data/census2000/*; do \
+ $(PG_BINDIR)/shp2pgsql \
+ -a \
+ -s $(TIGER_SRID) \
+ -D \
+ $$state/block/*.shp \
+ tiger_blocks \
+ | psql -U $(DB_USER) -d $(DB_NAME); \
+ done;
+
+# All Lines
+#
+# Since the table and index already exist, we can utilize -a,
+# 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) \
+ $$shapefile \
+ tiger_lines \
+ | bin/filter-transactions \
+ | psql -U $(DB_USER) -d $(DB_NAME) \
+ > /dev/null; \
+ done; \
+ done;
+
+ bin/sf1blocks2sql src/Tests/Fixtures/SummaryFile1/mdgeo.uf1 sf1_blocks \
+ | psql -U postgres -d $(DB_NAME) \
+ > /dev/null