]> granicus.if.org Git - postgis/commitdiff
#2483 patch from Kashif Rasul (get rid of deprecated calls, update to use faster...
authorRegina Obe <lr@pcorp.us>
Sun, 22 Sep 2013 21:43:06 +0000 (21:43 +0000)
committerRegina Obe <lr@pcorp.us>
Sun, 22 Sep 2013 21:43:06 +0000 (21:43 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11968 b70326c6-7e19-0410-871a-916f4a2858ee

extras/tiger_geocoder/tiger_2011/create_geocode.bat
extras/tiger_geocoder/tiger_2011/create_geocode.sh
extras/tiger_geocoder/tiger_2011/geocode/interpolate_from_address.sql
extras/tiger_geocoder/tiger_2011/tiger_loader_2011.sql
extras/tiger_geocoder/tiger_2011/tiger_loader_2012.sql
extras/tiger_geocoder/tiger_2011/tiger_loader_2013.sql
extras/tiger_geocoder/tiger_2011/upgrade_geocoder.bat
extras/tiger_geocoder/tiger_2011/upgrade_geocoder.sh

index ecc0a5caf20af142a793d3c0c27173f819e9ca3d..f273c6da51593a1098ea7972236aa08e0684abeb 100755 (executable)
@@ -15,7 +15,7 @@ REM "%PGBIN%\psql" -d "%THEDB%" -c "ALTER DATABASE %THEDB% SET search_path=publi
 "%PGBIN%\psql"  -d "%THEDB%" -f "create_geocode.sql"\r
 REM "%PGBIN%\psql"  -d "%THEDB%" -f "tables\lookup_tables_2011.sql"\r
 "%PGBIN%\psql"  -d "%THEDB%" -c "CREATE SCHEMA tiger_data;"\r
-"%PGBIN%\psql"  -d "%THEDB%" -f "tiger_loader_2012.sql;"\r
+"%PGBIN%\psql"  -d "%THEDB%" -f "tiger_loader_2013.sql;"\r
 "%PGBIN%\psql"  -d "%THEDB%" -f "census_loader.sql;"\r
 "%PGBIN%\psql"  -d "%THEDB%" -c "SELECT tiger.create_census_base_tables();"\r
 "%PGBIN%\psql"  -d "%THEDB%" -c "CREATE INDEX idx_tiger_addr_least_address ON addr USING btree (least_hn(fromhn,tohn));"\r
index b5ce7724b002eb0b2bc748be2711fbd3bdae0b75..dd0027761506bb474d2680c6ffc2715777002755 100755 (executable)
@@ -16,7 +16,7 @@ ${PSQL_CMD} -d "${THEDB}" -c "CREATE SCHEMA tiger"
 #${PSQL_CMD} -d "${THEDB}" -f "tables/lookup_tables_2010.sql"
 ${PSQL_CMD} -d "${THEDB}" -c "CREATE SCHEMA tiger_data"
 ${PSQL_CMD} -d "${THEDB}" -f "create_geocode.sql"
-${PSQL_CMD} -d "${THEDB}" -f "tiger_loader_2012.sql"
+${PSQL_CMD} -d "${THEDB}" -f "tiger_loader_2013.sql"
 ${PSQL_CMD}  -d "${THEDB}" -f "census_loader.sql"
 ${PSQL_CMD}  -d "${THEDB}" -c "SELECT tiger.create_census_base_tables();"
 ${PSQL_CMD} -d "${THEDB}" -c "CREATE INDEX idx_tiger_addr_least_address ON addr USING btree (least_hn(fromhn,tohn));"
\ No newline at end of file
index daf63979ead76cc243bdf3382c7db36845da030b..8a7efe144661e2fb4ac28c357b482d93103b16f9 100644 (file)
@@ -52,7 +52,7 @@ BEGIN
         part := 0.5;
     END IF;
 
-    center_pt = ST_Line_Interpolate_Point(road, part);
+    center_pt = ST_LineInterpolatePoint(road, part);
     IF in_side > '' AND in_offset_m > 0 THEN
     /** Compute point the point to the in_side of the geometry **/
     /**Take into consideration non-straight so we consider azimuth 
@@ -66,7 +66,7 @@ BEGIN
                        This will be the start of our azimuth calc **/
                SELECT i INTO npos
                        FROM generate_series(1,ST_NPoints(road)) As i 
-                                       WHERE part > ST_Line_Locate_Point(road,ST_PointN(road,i)) 
+                                       WHERE part > ST_LineLocatePoint(road,ST_PointN(road,i)) 
                                        ORDER BY i DESC;
                IF npos < ST_NPoints(road) THEN                         
                        az := ST_Azimuth (ST_PointN(road,npos), ST_PointN(road, npos + 1));
index 3eb7539d7ad1e745ad560fd3f56671e726f6d5e7..41442147db8bd675b46ced09561a87b98e20146d 100644 (file)
@@ -80,7 +80,7 @@ cd ${staging_fold}
 %PSQL% -c "CREATE SCHEMA ${staging_schema};"
 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}  -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}''));")'
 );
 
 
@@ -106,7 +106,7 @@ 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 
-${loader} -s 4269 -g the_geom -W "latin1" $z ${staging_schema}.${state_abbrev}_${table_name} | ${psql} 
+${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');
 
@@ -179,7 +179,7 @@ VALUES(4, 'zcta5', 'zcta510', true,true, false,false, false, 'a',
        '${psql} -c "CREATE TABLE ${data_schema}.${state_abbrev}_${lookup_name}(CONSTRAINT pk_${state_abbrev}_${lookup_name} PRIMARY KEY (zcta5ce,statefp), CONSTRAINT uidx_${state_abbrev}_${lookup_name}_gid UNIQUE (gid)) INHERITS(${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);"'
-, ARRAY['gid','geoid','geoid10'], 'ftp://ftp2.census.gov/geo/tiger/TIGER2010/ZCTA5/2010');
+, ARRAY['gid','geoid','geoid10'], 'ftp://ftp2.census.gov/geo/tiger/TIGER2011/ZCTA5/2011');
 
 
 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 )
index d232ef4dc9a0cf375a6b0ec9fb92c8b093dd6881..eebd1aa88a3c11562c3b7c5a47194c42ab4db7c6 100644 (file)
@@ -12,6 +12,7 @@
 -- Author: Regina Obe and Leo Hsu <lr@pcorp.us>
 --  
 -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 SELECT tiger.SetSearchPathForInstall('tiger');
 BEGIN;
 CREATE OR REPLACE FUNCTION loader_macro_replace(param_input text, param_keys text[],param_values text[]) 
@@ -95,7 +96,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}  -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}''));")'
 );
 
 
@@ -120,7 +121,7 @@ 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 
-${loader} -s 4269 -g the_geom -W "latin1" $z ${staging_schema}.${state_abbrev}_${table_name} | ${psql} 
+${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');
 
@@ -208,7 +209,7 @@ VALUES(4, 'zcta5', 'zcta510', true,true, false,false, false, 'a',
        '${psql} -c "CREATE TABLE ${data_schema}.${state_abbrev}_${lookup_name}(CONSTRAINT pk_${state_abbrev}_${lookup_name} PRIMARY KEY (zcta5ce,statefp), CONSTRAINT uidx_${state_abbrev}_${lookup_name}_gid UNIQUE (gid)) INHERITS(${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);"'
-, ARRAY['gid','geoid','geoid10'], 'ftp://ftp2.census.gov/geo/tiger/TIGER2010/ZCTA5/2010');
+, ARRAY['gid','geoid','geoid10'], 'ftp://ftp2.census.gov/geo/tiger/TIGER2012/ZCTA5/2012');
 
 
 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 )
index 263d515da6e887e9ad4411bf743659bb088b2509..b72256a5a71d655d150c49177e546b0391696e63 100644 (file)
@@ -95,7 +95,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}  -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}''));")'
 );
 
 
@@ -120,7 +120,7 @@ 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 
-${loader} -s 4269 -g the_geom -W "latin1" $z ${staging_schema}.${state_abbrev}_${table_name} | ${psql} 
+${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');
 
@@ -208,7 +208,7 @@ VALUES(4, 'zcta5', 'zcta510', true,true, false,false, false, 'a',
        '${psql} -c "CREATE TABLE ${data_schema}.${state_abbrev}_${lookup_name}(CONSTRAINT pk_${state_abbrev}_${lookup_name} PRIMARY KEY (zcta5ce,statefp), CONSTRAINT uidx_${state_abbrev}_${lookup_name}_gid UNIQUE (gid)) INHERITS(${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);"'
-, ARRAY['gid','geoid','geoid10'], 'ftp://ftp2.census.gov/geo/tiger/TIGER2010/ZCTA5/2010');
+, ARRAY['gid','geoid','geoid10'], 'ftp://ftp2.census.gov/geo/tiger/TIGER2013/ZCTA5/2013');
 
 
 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 )
index 2fd4418b8922cad388c32f48faf887055afb6bf6..ed668fe6db616a5bcea33d6daf5f6532a8c5ab3a 100755 (executable)
@@ -10,7 +10,7 @@ set PGCONTRIB=C:\Program Files\PostgreSQL\8.4\share\contrib
 \r
 REM unremark the loader line to update your loader scripts\r
 REM note this wipes out your custom settings in loader_* tables\r
-REM "%PGBIN%\psql"  -d "%THEDB%" -f "tiger_loader_2012.sql"\r
+REM "%PGBIN%\psql"  -d "%THEDB%" -f "tiger_loader_2013.sql"\r
 cd regress\r
 REM "%PGBIN%\psql"  -d "%THEDB%" -t -f regress.sql\r
 pause\r
index 288aff104d407f3276c688953e97d30f06e0abf2..6c9a41f2176d4999215e4ba0ad196a46b6bff96b 100755 (executable)
@@ -11,4 +11,4 @@ ${PSQL_CMD} -d "${THEDB}" -f "upgrade_geocode.sql"
 
 #unremark the loader line to update your loader scripts
 #note this wipes out your custom settings in loader_* tables
-#${PSQL_CMD} -d "${THEDB}" -f "tiger_loader_2012.sql"
\ No newline at end of file
+#${PSQL_CMD} -d "${THEDB}" -f "tiger_loader_2013.sql"
\ No newline at end of file