<para>Given a textual street address, returns a composite <varname>norm_addy</varname> type that has road suffix, prefix and type standardized, street, streetname etc. broken into separate fields. This is the first step in the geocoding process to
get all addresses into normalized postal form. No other data is required aside from what is packaged with the geocoder.</para>
+ <para>It uses various control lookup tables located in <varname>tiger</varname> schema to normalize the input address.</para>
<para>Fields in the <varname>norm_addy</varname> type object returned by this function in this order where () indicates a field required by the geocoder, [] indicates an optional field:</para>
<para>(address) [dirPrefix] (streetName) [streetType] [dirSuffix][internal] [location] [state] [zipCode]</para>
<orderedlist>
<para><varname>location</varname> varchar usually a city or governing province.</para>
</listitem>
<listitem>
- <para><varname>state</varname> varchar two character US State. e.g MA, NY, MI</para>
+ <para><varname>state</varname> varchar two character US State. e.g MA, NY, MI. These are controlled by the <varname>state_lookup</varname> table.</para>
</listitem>
<listitem>
<para><varname>zip</varname> varchar 5-digit zipcode. e.g. 02109.</para>
+$Id$\r
TIGER Geocoder\r
\r
2011/01/23\r
+$Id: README 6731 2011-01-25 18:08:57Z robe $\r
TIGER Geocoder\r
\r
2004/10/28\r
-INSTALLING THE Tiger Geocoder\r
+$Id$\r
+INSTALLING The Tiger Geocoder\r
This is a customized version of Steve Frost's tiger geocoder revisions (http://www.snowman.net/git/tiger_geocoder/). \r
This version includes a loader that is portable between Linux and Windows but loads a full state of data. The loader helper tables\r
and functions are prefixed with loader and stored in the tiger schema. If you only want to load a county, then\r
-revise the wget call that is generated for the state to just download the state wide and specific counties. The loader will only\r
-process files that exists.\r
+revise the wget call that is generated for the state to just download the state wide and specific counties or just download them by hand. The loader will only\r
+process files that exist.\r
\r
If you are on windows -- you will need 7zip and wget.\r
7zip you can get from http://www.7-zip.org/ and wget you can get from http://gnuwin32.sourceforge.net/packages/wget.htm\r
+--$Id$\r
CREATE OR REPLACE FUNCTION geocode(\r
input VARCHAR,\r
OUT ADDY NORM_ADDY,\r
+--$Id$\r
CREATE OR REPLACE FUNCTION geocode_address(IN parsed norm_addy, OUT addy norm_addy, OUT geomout geometry, OUT rating integer)\r
RETURNS SETOF record AS\r
$$\r
+--$Id$\r
CREATE OR REPLACE FUNCTION geocode_location(\r
parsed NORM_ADDY,\r
OUT ADDY NORM_ADDY,\r
+--$Id$\r
-- Note we are wrapping this in a function so we can make it immutable and those useable in an index\r
-- It also allows us to shorten and possibly better cache the repetitive pattern in the code \r
-- greatest(to_number(b.fromhn,''99999999''),to_number(b.tohn,''99999999'')) \r
COST 1;\r
\r
-- Note we are wrapping this in a function so we can make it immutable (for some reason least and greatest aren't considered immutable)\r
--- and those useable in an index\r
+-- and thu useable in an index or cacheable for multiple calls\r
CREATE OR REPLACE FUNCTION greatest_hn(fromhn varchar, tohn varchar)\r
RETURNS integer AS\r
$$ SELECT greatest(to_number($1,'99999999'),to_number($2,'99999999') )::integer; $$\r
+--$Id$\r
-- rate_attributes(dirpA, dirpB, streetNameA, streetNameB, streetTypeA,\r
-- streetTypeB, dirsA, dirsB, locationA, locationB)\r
-- Rates the street based on the given attributes. The locations must be\r
+--$Id$\r
SET search_path TO tiger, public;\r
-- Create direction lookup table\r
DROP TABLE IF EXISTS direction_lookup;\r