]> granicus.if.org Git - postgis/commitdiff
#2906: Fix webiste link postgis.net (instead of postgis.org), consolidate censustract...
authorRegina Obe <lr@pcorp.us>
Fri, 5 Jun 2015 21:02:10 +0000 (21:02 +0000)
committerRegina Obe <lr@pcorp.us>
Fri, 5 Jun 2015 21:02:10 +0000 (21:02 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13624 b70326c6-7e19-0410-871a-916f4a2858ee

extensions/postgis_tiger_geocoder/Makefile.in
extras/tiger_geocoder/census_loader.sql
extras/tiger_geocoder/create_geocode.sql
extras/tiger_geocoder/geocode_settings.sql
extras/tiger_geocoder/tiger_loader_2011.sql
extras/tiger_geocoder/tiger_loader_2012.sql
extras/tiger_geocoder/tiger_loader_2013.sql
extras/tiger_geocoder/tiger_loader_2014.sql
extras/tiger_geocoder/upgrade_geocode.sql

index 343659a37614fe31b66c08dcc20460f14f36b030..77cf084a364d58ffb9047236eb500acf05fa4f64 100644 (file)
@@ -85,7 +85,6 @@ sql_bits/tiger_geocoder.sql.in: sql_bits/norm_addy_create.sql.in \
        ../../extras/tiger_geocoder/geocode_settings.sql \
        ../../extras/tiger_geocoder/tables/lookup_tables_2011.sql \
        ../../extras/tiger_geocoder/tiger_loader_2014.sql \
-       ../../extras/tiger_geocoder/census_loader.sql \
        ../../extras/tiger_geocoder/utility/set_search_path.sql \
        ../../extras/tiger_geocoder/utility/utmzone.sql \
        ../../extras/tiger_geocoder/utility/cull_null.sql \
index 4471f85d7d5192d50c3ffdff9d03346c45960e83..c48ba8b3f84213e26985c5654932c1f43b34474e 100644 (file)
@@ -1,6 +1,6 @@
 --
 -- PostGIS - Spatial Types for PostgreSQL
--- http://www.postgis.org
+-- http://postgis.net
 --
 -- Copyright (C) 2010, 2011 Regina Obe and Leo Hsu 
 -- Paragon Corporation
index f5ffd425aa1e28620eb66046a18c92960361cefd..78570d32e7f2bc11b5a8322abe8f604aba028b80 100644 (file)
@@ -1,6 +1,6 @@
 --
 -- PostGIS - Spatial Types for PostgreSQL
--- http://www.postgis.org
+-- http://postgis.net
 --
 -- Copyright (C) 2010, 2011 Regina Obe and Leo Hsu
 -- Copyright (C) 2008 Stephen Frost (et al) 
index f6e4d1ab46eadcbd3d97662d35e00c4a9ea2b26c..2ca7411b6146b48dc7f1e47fc45c359c33241e0b 100644 (file)
@@ -1,6 +1,6 @@
 --
 -- PostGIS - Spatial Types for PostgreSQL
--- http://www.postgis.org
+-- http://postgis.net
 --
 -- Copyright (C) 2010, 2011 Regina Obe and Leo Hsu
 --
index d30a8a31300d2589cc6b5fbee31ba7a3c8a54701..c4daf29f792829a211124cfbf2a4775933dd20ab 100644 (file)
@@ -1,6 +1,6 @@
 --
 -- PostGIS - Spatial Types for PostgreSQL
--- http://www.postgis.org
+-- http://postgis.net
 --
 -- Copyright (C) 2010, 2011, 2012 Regina Obe and Leo Hsu 
 -- Paragon Corporation
index 6921519e4e2a5814cffde93916d23d140af3519c..11f621f61846b1b7d941b0c50a5bcd609c437bb4 100644 (file)
@@ -1,6 +1,6 @@
 --
 -- PostGIS - Spatial Types for PostgreSQL
--- http://www.postgis.org
+-- http://postgis.net
 --
 -- Copyright (C) 2010, 2011, 2012 Regina Obe and Leo Hsu 
 -- Paragon Corporation
index fd10a0013190ba4c0da7e2cb908b2bca432ce2ae..3a5af722d433764e4212bbe72a6a4702ae640a20 100644 (file)
@@ -1,6 +1,6 @@
 --
 -- PostGIS - Spatial Types for PostgreSQL
--- http://www.postgis.org
+-- http://postgis.net
 --
 -- Copyright (C) 2010, 2011, 2012 Regina Obe and Leo Hsu 
 -- Paragon Corporation
index 87fd85591c7338e8626195c4f2a53d995ef078e5..b6d529bf265b1918de0d199b11e2d08e319943a0 100644 (file)
@@ -1,6 +1,6 @@
 --
 -- PostGIS - Spatial Types for PostgreSQL
--- http://www.postgis.org
+-- http://postgis.net
 --
 -- Copyright (C) 2010, 2011, 2012 Regina Obe and Leo Hsu 
 -- Paragon Corporation
@@ -94,7 +94,7 @@ cd ${staging_fold}
 %PSQL% -c "DO language ''plpgsql'' $$ BEGIN IF NOT EXISTS (SELECT * FROM information_schema.schemata WHERE schema_name = ''${data_schema}'' ) THEN CREATE SCHEMA ${data_schema}; END IF;  END $$"
 for /r %%z in (*.zip) do %UNZIPTOOL% e %%z  -o%TMPDIR% 
 cd %TMPDIR%', E'%PSQL%', E'\\', E'%SHP2PGSQL%', 'set ', 
-'for /r %%z in (*${table_name}.dbf) do (${loader} -D -s 4269 -g the_geom -W "latin1" %%z tiger_staging.${state_abbrev}_${table_name} | ${psql} & ${psql} -c "SELECT loader_load_staged_data(lower(''${state_abbrev}_${table_name}''), lower(''${state_abbrev}_${lookup_name}''));")'
+'for /r %%z in (*${table_name}*.dbf) do (${loader} -D -s 4269 -g the_geom -W "latin1" %%z tiger_staging.${state_abbrev}_${table_name} | ${psql} & ${psql} -c "SELECT loader_load_staged_data(lower(''${state_abbrev}_${table_name}''), lower(''${state_abbrev}_${lookup_name}''));")'
 );
 
 
@@ -118,7 +118,7 @@ ${PSQL} -c "CREATE SCHEMA ${staging_schema};"
 for z in *.zip; do $UNZIPTOOL -o -d $TMPDIR $z; done
 for z in */*.zip; do $UNZIPTOOL -o -d $TMPDIR $z; done
 cd $TMPDIR;\n', '${PSQL}', '/', '${SHP2PGSQL}', 'export ',
-'for z in *${table_name}.dbf; do 
+'for z in *${table_name}*.dbf; do 
 ${loader} -D -s 4269 -g the_geom -W "latin1" $z ${staging_schema}.${state_abbrev}_${table_name} | ${psql} 
 ${PSQL} -c "SELECT loader_load_staged_data(lower(''${state_abbrev}_${table_name}''), lower(''${state_abbrev}_${lookup_name}''));"
 done');
@@ -167,6 +167,31 @@ COMMENT ON COLUMN loader_lookuptables.load IS 'Whether or not to load the table.
 COMMENT ON COLUMN loader_lookuptables.columns_exclude IS 'List of columns to exclude as an array. This is excluded from both input table and output table and rest of columns remaining are assumed to be in same order in both tables. gid, geoid,cpi,suffix1ce are excluded if no columns are specified.';
 COMMENT ON COLUMN loader_lookuptables.website_root_override IS 'Path to use for wget instead of that specified in year table.  Needed currently for zcta where they release that only for 2000 and 2010';
 
+INSERT INTO loader_lookuptables(process_order, lookup_name, table_name, load, level_county, level_state, single_geom_mode, insert_mode, pre_load_process, post_load_process, columns_exclude )
+VALUES(10, 'tract', 'tract', true, false, true,false, 'c', 
+'${psql} -c "CREATE TABLE ${data_schema}.${state_abbrev}_${lookup_name}(CONSTRAINT pk_${state_abbrev}_${lookup_name} PRIMARY KEY (tract_id) ) INHERITS(tiger.${lookup_name}); " ',
+       '${psql} -c "ALTER TABLE ${staging_schema}.${state_abbrev}_${table_name} RENAME geoid TO tract_id;  SELECT loader_load_staged_data(lower(''${state_abbrev}_${table_name}''), lower(''${state_abbrev}_${lookup_name}'')); "
+       ${psql} -c "CREATE INDEX ${data_schema}_${state_abbrev}_${lookup_name}_the_geom_gist ON ${data_schema}.${state_abbrev}_${lookup_name} USING gist(the_geom);"
+       ${psql} -c "VACUUM ANALYZE ${data_schema}.${state_abbrev}_${lookup_name};"
+       ${psql} -c "ALTER TABLE ${data_schema}.${state_abbrev}_${lookup_name} ADD CONSTRAINT chk_statefp CHECK (statefp = ''${state_fips}'');"', ARRAY['gid']);
+
+INSERT INTO loader_lookuptables(process_order, lookup_name, table_name, load, level_county, level_state, single_geom_mode, insert_mode, pre_load_process, post_load_process, columns_exclude )
+VALUES(11, 'tabblock', 'tabblock', true, true, false,false, 'c', 
+'${psql} -c "CREATE TABLE ${data_schema}.${state_abbrev}_${lookup_name}(CONSTRAINT pk_${state_abbrev}_${lookup_name} PRIMARY KEY (tabblock_id)) INHERITS(tiger.${lookup_name});" ',
+'${psql} -c "ALTER TABLE ${staging_schema}.${state_abbrev}_${lookup_name} RENAME geoid10 TO tabblock_id;"
+${psql} -c "ALTER TABLE ${data_schema}.${state_abbrev}_${lookup_name} ADD CONSTRAINT chk_statefp CHECK (statefp = ''${state_fips}'');"
+${psql} -c "CREATE INDEX ${data_schema}_${state_abbrev}_${lookup_name}_the_geom_gist ON ${data_schema}.${state_abbrev}_${lookup_name} USING gist(the_geom);"
+${psql} -c "vacuum analyze ${data_schema}.${state_abbrev}_${lookup_name};"', '{gid, uatyp10, tractce10, blockce10,suffix1ce,blockce,tractce}'::text[]);
+
+
+INSERT INTO loader_lookuptables(process_order, lookup_name, table_name, load, level_county, level_state, single_geom_mode, insert_mode, pre_load_process, post_load_process, columns_exclude )
+VALUES(12, 'bg', 'bg', true,false, true,false, 'c', 
+'${psql} -c "CREATE TABLE ${data_schema}.${state_abbrev}_${lookup_name}(CONSTRAINT pk_${state_abbrev}_${lookup_name} PRIMARY KEY (bg_id)) INHERITS(tiger.${lookup_name});" ',
+'${psql} -c "ALTER TABLE ${staging_schema}.${state_abbrev}_${table_name} RENAME geoid TO bg_id;  SELECT loader_load_staged_data(lower(''${state_abbrev}_${table_name}''), lower(''${state_abbrev}_${lookup_name}'')); "
+${psql} -c "ALTER TABLE ${data_schema}.${state_abbrev}_${lookup_name} ADD CONSTRAINT chk_statefp CHECK (statefp = ''${state_fips}'');"
+${psql} -c "CREATE INDEX ${data_schema}_${state_abbrev}_${lookup_name}_the_geom_gist ON ${data_schema}.${state_abbrev}_${lookup_name} USING gist(the_geom);"
+${psql} -c "vacuum analyze ${data_schema}.${state_abbrev}_${lookup_name};"', ARRAY['gid']);
+
 INSERT INTO loader_lookuptables(process_order, lookup_name, table_name, load, level_county, level_state,  level_nation, single_geom_mode, pre_load_process, post_load_process)
 VALUES(2, 'county_all', 'county', true, false, false, true,
        false, '${psql} -c "CREATE TABLE ${data_schema}.${lookup_name}(CONSTRAINT pk_${data_schema}_${lookup_name} PRIMARY KEY (cntyidfp),CONSTRAINT uidx_${data_schema}_${lookup_name}_gid UNIQUE (gid)  ) INHERITS(county); " ',
@@ -287,7 +312,7 @@ SELECT
 '
 || 'cd ' ||  replace(variables.staging_fold,'/', platform.path_sep) || '/' || replace(replace(variables.website_root, 'http://', ''),'ftp://','')  || '/' || upper(table_name)  || '
 ' || replace(platform.unzip_command, '*.zip', 'tl_*' || table_name || '.zip ') || '
-' || COALESCE(lu.pre_load_process || E'\n', '') || platform.loader || ' -' ||  lu.insert_mode || ' -s 4269 -g the_geom ' 
+' || COALESCE(lu.pre_load_process || E'\n', '') || platform.loader || ' -D -' ||  lu.insert_mode || ' -s 4269 -g the_geom ' 
                || CASE WHEN lu.single_geom_mode THEN ' -S ' ELSE ' ' END::text || ' -W "latin1" tl_' || variables.tiger_year 
        || '_us_' || lu.table_name || '.dbf tiger_staging.' || lu.table_name || ' | '::text || platform.psql 
                || COALESCE(E'\n' || 
@@ -322,7 +347,7 @@ SELECT
 '
 || 'cd ' ||  replace(variables.staging_fold,'/', platform.path_sep) || '/' || replace(replace(COALESCE(lu.website_root_override,variables.website_root || '/' || upper(table_name) ), 'http://', ''),'ftp://','')    || '
 ' || replace(platform.unzip_command, '*.zip', 'tl_*_' || s.state_fips || '*_' || table_name || '.zip ') || '
-' ||loader_macro_replace(COALESCE(lu.pre_load_process || E'\n', '') || platform.loader || ' -' ||  lu.insert_mode || ' -s 4269 -g the_geom ' 
+' ||loader_macro_replace(COALESCE(lu.pre_load_process || E'\n', '') || platform.loader || ' -D -' ||  lu.insert_mode || ' -s 4269 -g the_geom ' 
                || CASE WHEN lu.single_geom_mode THEN ' -S ' ELSE ' ' END::text || ' -W "latin1" tl_' || variables.tiger_year || '_' || s.state_fips 
        || '_' || lu.table_name || '.dbf tiger_staging.' || lower(s.state_abbrev) || '_' || lu.table_name || ' | '::text || platform.psql 
                || COALESCE(E'\n' || 
@@ -336,9 +361,9 @@ SELECT
 ' || platform.wget || ' ' || COALESCE(lu.website_root_override,variables.website_root || '/' || upper(table_name)  ) || '/*_' || s.state_fips || '* --no-parent --relative --recursive --level=2 --accept=zip --mirror --reject=html 
 '
 || 'cd ' ||  replace(variables.staging_fold,'/', platform.path_sep) || '/' || replace(replace(COALESCE(lu.website_root_override,variables.website_root || '/' || upper(table_name)  || '/'), 'http://', ''),'ftp://','')  || '
-' || replace(platform.unzip_command, '*.zip', 'tl_*_' || s.state_fips || '*_' || table_name || '.zip ') || '
+' || replace(platform.unzip_command, '*.zip', 'tl_*_' || s.state_fips || '*_' || table_name || '*.zip ') || '
 ' || loader_macro_replace(COALESCE(lu.pre_load_process || E'\n', '') || COALESCE(county_process_command || E'\n','')
-                               || COALESCE(E'\n' ||lu.post_load_process , '') , ARRAY['loader','table_name','lookup_name'], ARRAY[platform.loader  || CASE WHEN lu.single_geom_mode THEN ' -S' ELSE ' ' END::text, lu.table_name, lu.lookup_name ]) 
+                               || COALESCE(E'\n' ||lu.post_load_process , '') , ARRAY['loader','table_name','lookup_name'], ARRAY[platform.loader  || ' -D ' || CASE WHEN lu.single_geom_mode THEN ' -S' ELSE ' ' END::text, lu.table_name, lu.lookup_name ]) 
                                FROM loader_lookuptables AS lu
                                WHERE level_county = true AND load = true
                                ORDER BY process_order, lookup_name), E'\n') ::text 
index 1eccf481c5bc405a099d3c3f2d0c9542748dcee1..a6cd65d9c867b55411ab78f93fee32c7e5c49559 100644 (file)
@@ -1,6 +1,6 @@
 --
 -- PostGIS - Spatial Types for PostgreSQL
--- http://www.postgis.org
+-- http://postgis.net
 --
 -- Copyright (C) 2010, 2011 Regina Obe and Leo Hsu
 --