---$Id$\r
--- Tiger is where we're going to create the functions, but we need\r
--- the PostGIS functions/types which are in public.\r
-SET search_path TO tiger,public;\r
-BEGIN;\r
--- Type used to pass around a normalized address between functions\r
-DROP TYPE IF EXISTS norm_addy CASCADE;\r
-CREATE TYPE norm_addy AS (\r
- address INTEGER,\r
- preDirAbbrev VARCHAR,\r
- streetName VARCHAR,\r
- streetTypeAbbrev VARCHAR,\r
- postDirAbbrev VARCHAR,\r
- internal VARCHAR,\r
- location VARCHAR,\r
- stateAbbrev VARCHAR,\r
- zip VARCHAR,\r
- parsed BOOLEAN);\r
-\r
--- System/General helper functions\r
-\i utility/utmzone.sql\r
-\i utility/cull_null.sql\r
-\i utility/nullable_levenshtein.sql\r
-\i utility/levenshtein_ignore_case.sql\r
-\r
----- Address normalizer\r
--- General helpers\r
-\i normalize/end_soundex.sql\r
-\i normalize/count_words.sql\r
-\i normalize/state_extract.sql\r
-\i normalize/get_last_words.sql\r
--- Location extraction/normalization helpers\r
-\i normalize/location_extract_countysub_exact.sql\r
-\i normalize/location_extract_countysub_fuzzy.sql\r
-\i normalize/location_extract_place_exact.sql\r
-\i normalize/location_extract_place_fuzzy.sql\r
-\i normalize/location_extract.sql\r
--- Normalization API, called by geocode mainly.\r
-\i normalize/normalize_address.sql\r
-\i normalize/pprint_addy.sql\r
-\r
----- Geocoder functions\r
--- General helpers\r
-\i geocode/other_helper_functions.sql\r
-\i geocode/rate_attributes.sql\r
-\i geocode/includes_address.sql\r
-\i geocode/interpolate_from_address.sql\r
--- Actual lookups/geocoder helpers\r
-\i geocode/geocode_address.sql\r
-\i geocode/geocode_location.sql\r
--- Geocode API, called by user\r
-\i geocode/geocode.sql\r
-\r
--- Reverse Geocode API, called by user\r
-\i geocode/reverse_geocode.sql\r
+--$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
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
'
' ||
-- 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