]> gitweb.michael.orlitzky.com - dead/census-tools.git/commitdiff
Fixed the "all lines" shapefile importing.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 11 Oct 2009 18:01:52 +0000 (14:01 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 11 Oct 2009 18:01:52 +0000 (14:01 -0400)
makefile

index 30e876aba03cc57a1f7fa69e426425cd8dc87620..b7ef3c24eea0b7dae47d776351dd2e0fd3527e25 100644 (file)
--- a/makefile
+++ b/makefile
@@ -52,11 +52,11 @@ data: tiger_blocks tiger_lines
 tiger_blocks: dc_blocks md_blocks va_blocks pa_blocks ny_blocks
 
 dc_blocks:
-       mkdir -p data/census2000/dc/block
-       if [ ! -f data/census2000/dc/block/tl_2009_11_tabblock00.shp ]; \
+       mkdir -p data/census2000/district_of_columbia/block
+       if [ ! -f data/census2000/district_of_columbia/block/tl_2009_11_tabblock00.shp ]; \
        then                                                            \
                wget -O dcblocks.zip $(DC_BLOCKS_URL);                  \
-               unzip dcblocks.zip -d ./data/census2000/dc/block;       \
+               unzip dcblocks.zip -d ./data/census2000/district_of_columbia/block;     \
                rm dcblocks.zip;                                        \
        fi;
 
@@ -123,18 +123,20 @@ db: data newdb tiger_blocks_table tiger_lines_table sf1_blocks_table
                        | psql -U $(DB_USER) -d $(DB_NAME); \
        done;
 
-# MD Lines
+# All Lines
 #
 # Since the table and index already exist, we can utilize -a,
 # and leave -I out.
-       for x in data/census2000/maryland/lines/*.shp; do   \
-               $(PG_BINDIR)/shp2pgsql                      \
-                       -a                                  \
-                       -s $(TIGER_SRID)                    \
-                       -D                                  \
-                       $$x                                 \
-                       tiger_lines                         \
-                       | psql -U $(DB_USER) -d $(DB_NAME); \
+       for state in data/census2000/*; do                          \
+               for shapefile in $$state/lines/*.shp; do            \
+                       $(PG_BINDIR)/shp2pgsql                      \
+                               -a                                  \
+                               -s $(TIGER_SRID)                    \
+                               -D                                  \
+                               $$shapefile                         \
+                               tiger_lines                         \
+                               | psql -U $(DB_USER) -d $(DB_NAME); \
+               done;                                               \
        done;
 
        bin/sf1blocks2sql src/Tests/Fixtures/SummaryFile1/mdgeo.uf1 sf1_blocks \