From: Regina Obe Date: Fri, 15 Apr 2011 11:15:59 +0000 (+0000) Subject: more patch corrections to support sh X-Git-Tag: 2.0.0alpha1~1767 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=bfd04ba489cf97ede42dd0cfaf0b2419e66a5b31;p=postgis more patch corrections to support sh git-svn-id: http://svn.osgeo.org/postgis/trunk@7035 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/extras/tiger_geocoder/tiger_2010/create_geocode.sh b/extras/tiger_geocoder/tiger_2010/create_geocode.sh index e76a05d44..43ca96abb 100644 --- a/extras/tiger_geocoder/tiger_2010/create_geocode.sh +++ b/extras/tiger_geocoder/tiger_2010/create_geocode.sh @@ -1,3 +1,4 @@ +#!/bin/bash # $Id$ PGPORT=5432 PGHOST=localhost diff --git a/extras/tiger_geocoder/tiger_2010/create_geocode.sql b/extras/tiger_geocoder/tiger_2010/create_geocode.sql index 448a3ce4a..cfc2cfcd1 100644 --- a/extras/tiger_geocoder/tiger_2010/create_geocode.sql +++ b/extras/tiger_geocoder/tiger_2010/create_geocode.sql @@ -1,56 +1,56 @@ ---$Id$ --- Tiger is where we're going to create the functions, but we need --- the PostGIS functions/types which are in public. -SET search_path TO tiger,public; -BEGIN; --- Type used to pass around a normalized address between functions -DROP TYPE IF EXISTS norm_addy CASCADE; -CREATE TYPE norm_addy AS ( - address INTEGER, - preDirAbbrev VARCHAR, - streetName VARCHAR, - streetTypeAbbrev VARCHAR, - postDirAbbrev VARCHAR, - internal VARCHAR, - location VARCHAR, - stateAbbrev VARCHAR, - zip VARCHAR, - parsed BOOLEAN); - --- System/General helper functions -\i utility/utmzone.sql -\i utility/cull_null.sql -\i utility/nullable_levenshtein.sql -\i utility/levenshtein_ignore_case.sql - ----- Address normalizer --- General helpers -\i normalize/end_soundex.sql -\i normalize/count_words.sql -\i normalize/state_extract.sql -\i normalize/get_last_words.sql --- Location extraction/normalization helpers -\i normalize/location_extract_countysub_exact.sql -\i normalize/location_extract_countysub_fuzzy.sql -\i normalize/location_extract_place_exact.sql -\i normalize/location_extract_place_fuzzy.sql -\i normalize/location_extract.sql --- Normalization API, called by geocode mainly. -\i normalize/normalize_address.sql -\i normalize/pprint_addy.sql - ----- Geocoder functions --- General helpers -\i geocode/other_helper_functions.sql -\i geocode/rate_attributes.sql -\i geocode/includes_address.sql -\i geocode/interpolate_from_address.sql --- Actual lookups/geocoder helpers -\i geocode/geocode_address.sql -\i geocode/geocode_location.sql --- Geocode API, called by user -\i geocode/geocode.sql - --- Reverse Geocode API, called by user -\i geocode/reverse_geocode.sql +--$Id$ +-- Tiger is where we're going to create the functions, but we need +-- the PostGIS functions/types which are in public. +SET search_path TO tiger,public; +BEGIN; +-- Type used to pass around a normalized address between functions +DROP TYPE IF EXISTS norm_addy CASCADE; +CREATE TYPE norm_addy AS ( + address INTEGER, + preDirAbbrev VARCHAR, + streetName VARCHAR, + streetTypeAbbrev VARCHAR, + postDirAbbrev VARCHAR, + internal VARCHAR, + location VARCHAR, + stateAbbrev VARCHAR, + zip VARCHAR, + parsed BOOLEAN); + +-- System/General helper functions +\i utility/utmzone.sql +\i utility/cull_null.sql +\i utility/nullable_levenshtein.sql +\i utility/levenshtein_ignore_case.sql + +---- Address normalizer +-- General helpers +\i normalize/end_soundex.sql +\i normalize/count_words.sql +\i normalize/state_extract.sql +\i normalize/get_last_words.sql +-- Location extraction/normalization helpers +\i normalize/location_extract_countysub_exact.sql +\i normalize/location_extract_countysub_fuzzy.sql +\i normalize/location_extract_place_exact.sql +\i normalize/location_extract_place_fuzzy.sql +\i normalize/location_extract.sql +-- Normalization API, called by geocode mainly. +\i normalize/normalize_address.sql +\i normalize/pprint_addy.sql + +---- Geocoder functions +-- General helpers +\i geocode/other_helper_functions.sql +\i geocode/rate_attributes.sql +\i geocode/includes_address.sql +\i geocode/interpolate_from_address.sql +-- Actual lookups/geocoder helpers +\i geocode/geocode_address.sql +\i geocode/geocode_location.sql +-- Geocode API, called by user +\i geocode/geocode.sql + +-- Reverse Geocode API, called by user +\i geocode/reverse_geocode.sql COMMIT; \ No newline at end of file diff --git a/extras/tiger_geocoder/tiger_2010/tiger_loader.sql b/extras/tiger_geocoder/tiger_2010/tiger_loader.sql index 44962687c..5212e18aa 100644 --- a/extras/tiger_geocoder/tiger_2010/tiger_loader.sql +++ b/extras/tiger_geocoder/tiger_2010/tiger_loader.sql @@ -50,9 +50,12 @@ cd %TMPDIR%', E'%PSQL%', E'\\', E'%SHP2PGSQL%', 'set ', INSERT INTO loader_platform(os, wget, pgbin, declare_sect, unzip_command, psql, path_sep, loader, environ_set_command, county_process_command) VALUES('sh', 'wget', '', -E'STATEDIR="${staging_fold}/${website_root}/${state_fold}" +E'#!/bin/bash +STATEDIR="${staging_fold}/${website_root}/${state_fold}" TMPDIR="${staging_fold}/temp/" UNZIPTOOL=unzip +WGETTOOL="/usr/bin/wget" +PGBIN="/usr/bin" PGPORT=5432 PGHOST=localhost PGUSER=postgres @@ -192,21 +195,21 @@ SELECT ' ' || -- State level files - array_to_string( ARRAY(SELECT loader_macro_replace(COALESCE(lu.pre_load_process || E'\r', '') || platform.loader || ' -' || lu.insert_mode || ' -s 4269 -g the_geom ' + array_to_string( ARRAY(SELECT loader_macro_replace(COALESCE(lu.pre_load_process || E'\n', '') || platform.loader || ' -' || 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'\r' || + || COALESCE(E'\n' || lu.post_load_process , '') , ARRAY['loader','table_name', 'lookup_name'], ARRAY[platform.loader, lu.table_name, lu.lookup_name ]) FROM loader_lookuptables AS lu WHERE level_state = true AND load = true - ORDER BY process_order, lookup_name), E'\r') ::text + ORDER BY process_order, lookup_name), E'\n') ::text -- County Level files - || E'\r' || - array_to_string( ARRAY(SELECT loader_macro_replace(COALESCE(lu.pre_load_process || E'\r', '') || COALESCE(county_process_command || E'\r','') - || COALESCE(E'\r' ||lu.post_load_process , '') , ARRAY['loader','table_name','lookup_name'], ARRAY[platform.loader, lu.table_name, lu.lookup_name ]) + || E'\n' || + array_to_string( ARRAY(SELECT 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, 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'\r') ::text + ORDER BY process_order, lookup_name), E'\n') ::text , ARRAY['psql', 'data_schema','staging_schema', 'staging_fold', 'state_fold', 'website_root', 'state_abbrev','state_fips'], ARRAY[platform.psql, variables.data_schema, variables.staging_schema, variables.staging_fold, s.state_fold,variables.website_root, s.state_abbrev, s.state_fips::text]) AS shell_code