1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
-- 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;
-- 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 INTEGER,
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/rate_attributes.sql
\i geocode/includes_address.sql
\i geocode/interpolate_from_address.sql
-- Actual lookups/geocoder helpers
\i geocode/geocode_address_countysub_exact.sql
\i geocode/geocode_address_countysub_fuzzy.sql
\i geocode/geocode_address_place_exact.sql
\i geocode/geocode_address_place_fuzzy.sql
\i geocode/geocode_address.sql
\i geocode/geocode_address_state.sql
\i geocode/geocode_address_zip.sql
\i geocode/geocode_zip.sql
\i geocode/geocode_location.sql
-- Geocode API, called by user
\i geocode/geocode_get_point.sql
\i geocode/geocode.sql
|