update install to note that we now support loading tiger 2012 data and it is the default and upgrade instructions to get the new loader behavior

git-svn-id: http://svn.osgeo.org/postgis/trunk@10657 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Regina Obe 2012-11-08 05:48:47 +00:00
parent 227e7f14b8
commit a3f801b0ca
2 changed files with 42 additions and 35 deletions

View file

@ -3,9 +3,8 @@
<sect1 id="Tiger_Geocoder">
<sect1info>
<abstract>
<para>A plpgsql based geocoder written to work with the <ulink url="http://www.census.gov/geo/www/tiger/">TIGER (Topologically Integrated Geographic Encoding and Referencing system ) / Line and Master Address database export</ulink> released by the US Census Bureau. In versions prior to 2008 the TIGER files were
released in ASCII format. The older geocoder used to work with that format and is available in PostGIS source 1.5 and below in <varname>extras/tiger_geocoder/tiger_2006andbefore</varname>. </para>
<para>There are four components to the geocoder: the data loader functions, the address normalizer, the address geocoder, and the reverse geocoder. The latest version updated to use the TIGER 2011 census data is located in the <varname>extras/tiger_geocoder/tiger_2011</varname> folder.</para>
<para>A plpgsql based geocoder written to work with the <ulink url="http://www.census.gov/geo/www/tiger/">TIGER (Topologically Integrated Geographic Encoding and Referencing system ) / Line and Master Address database export</ulink> released by the US Census Bureau. </para>
<para>There are four components to the geocoder: the data loader functions, the address normalizer, the address geocoder, and the reverse geocoder. The latest version updated to use the TIGER 2011 and 2012 census data is located in the <varname>extras/tiger_geocoder/tiger_2011</varname> folder. It defaults to downloading and installing TIGER 2012 files. </para>
<para>Although it is designed specifically for the US, a lot of the concepts and functions are applicable and can be adapted to work with other country address and road networks.</para>
<para>The script builds a schema called <varname>tiger</varname> to house all the tiger related functions, reusable lookup data such as road type prefixes, suffixes, states, various control tables for managing data load, and skeleton base tables from which all the tiger loaded tables inherit from.</para>
<para>Another schema called <varname>tiger_data</varname> is also created which houses all the census data for each state that the loader downloads from Census site and loads into the database. In the current model, each set of state tables is
@ -17,8 +16,8 @@
<note><para>
If you are using tiger geocoder (tiger_2010),
you can upgrade the scripts using the accompanying upgrade_geocoder.bat
/ .sh scripts in tiger_2011. One major change between <varname>tiger_2010</varname> and <varname>tiger_2011</varname> is that the county and <varname>county</varname> and <varname>state</varname> tables are no longer broken out by state. We'll be refining the upgrade scripts
until release. If you have data from tiger_2010 and want replace with tiger_2011 refer to <xref linkend="upgrade_tiger_geocoder" />
/ .sh scripts in tiger_2011. One major change between <varname>tiger_2010</varname> and <varname>tiger_2011/tiger_2012</varname> is that the county and <varname>county</varname> and <varname>state</varname> tables are no longer broken out by state. We'll be refining the upgrade scripts
until release. If you have data from tiger_2010 and want replace with tiger_2012 refer to <xref linkend="upgrade_tiger_geocoder" />
</para></note>
</para>
<para>Design:</para>

View file

@ -987,7 +987,7 @@ Failed: 0
<title>Installing, Upgrading Tiger Geocoder and loading data</title>
<para>The Tiger geocoder does not get installed / upgraded with the core PostGIS scripts because it is only of regional use. In fact nothing located
in the extras folder is installed by default with the regular PostGIS install / upgrade. Extras like Tiger geocoder may also not be packaged in your PostGIS distribution, but will always be available in the postgis-&last_release_version;.tar.gz file. The instructions provided here are also available in the <filename>extras/tiger_geocoder/tiger_2010/README</filename> </para>
in the extras folder is installed by default with the regular PostGIS install / upgrade. Extras like Tiger geocoder may also not be packaged in your PostGIS distribution, but will always be available in the postgis-&last_release_version;.tar.gz file. The instructions provided here are also available in the <filename>extras/tiger_geocoder/tiger_2011/README</filename> </para>
<para>If you are on Windows and you don't have tar installed, you can use <ulink url="http://www.7-zip.org/">http://www.7-zip.org/</ulink> to unzip the PostGIS tarball.</para>
<sect2 id="install_tiger_geocoder">
<title>Tiger Geocoder Enabling your PostGIS database</title>
@ -1007,10 +1007,12 @@ Failed: 0
<command>cd postgis-&last_release_version;/extras/tiger_geocoder/tiger_2011</command>
</para>
<para>Edit the <filename>tiger_loader.sql</filename> to the paths of your executables server etc.</para>
<para>If you are installing Tiger geocoder for the first time edit either the <filename>create_geocode.bat</filename> script If you are on windows
or the <filename>create_geocode.sh</filename> if you are on Linux/Unix/Mac OSX with your PostgreSQL specific settings and run the corresponding script from the commandline. If you don't edit this file, it will just contain common case locations of items. You can edit the generated script after the fact when you run the <xref linkend="Loader_Generate_Script" /> command.
<para>Edit the <filename>tiger_loader_2012.sql</filename> to the paths of your executables server etc or alternatively you can update the <varname>loader_platform</varname> table once installed. If you don't edit this file or the <varname>loader_platform</varname> table, it will just contain common case locations of items and you'll have to edit the generated script after the fact when you run the <xref linkend="Loader_Generate_Nation_Script" /> and <xref linkend="Loader_Generate_Script" /> SQL functions.
</para>
<para>If you are installing Tiger geocoder for the first time edit either the <filename>create_geocode.bat</filename> script If you are on windows
or the <filename>create_geocode.sh</filename> if you are on Linux/Unix/Mac OSX with your PostgreSQL specific settings and run the corresponding script from the commandline. </para>
<para>Verify that you now have a <varname>tiger</varname> schema in your database and that it is part of your database search_path. If it is not, add it with a command something along the line of: <programlisting>ALTER DATABASE geocoder SET search_path=public, tiger;</programlisting></para>
<para>The normalizing address functionality works more or less without any data except for tricky addresses. Run this test and verify things look like this:
<programlisting>SELECT pprint_addy(normalize_address('202 East Fremont Street, Las Vegas, Nevada 89101')) As pretty_address;
@ -1020,6 +1022,31 @@ pretty_address
</programlisting>
</para>
</sect2>
<sect2 id="tiger_geocoder_loading_data">
<title>Loading Tiger Data</title>
<para>The instructions for loading data are available in a more detailed form in the <filename>extras/tiger_geocoder/tiger_2011/README</filename>. This just includes the general steps.</para>
<para>The load process downloads data from the census website for the respective nation files, states requested, extracts the files, and then loads each state into its own separate
set of state tables. Each state table inherits from the tables defined in <varname>tiger</varname> schema so that its sufficient to just query those tables to access all the data and drop a set of state tables at any time using the <xref linkend="Drop_State_Tables_Generate_Script" /> if you need to reload a state or just don't need a state anymore.</para>
<para>In order to be able to load data you'll need the following tools:</para>
<itemizedlist>
<listitem><para>A tool to unzip the zip files from census website.</para>
<para>For Unix like systems: <varname>unzip</varname> executable which is usually already installed on most Unix like platforms.</para>
<para>For Windows, 7-zip which is a free compress/uncompress tool you can download from <ulink url="http://www.7-zip.org/">http://www.7-zip.org/</ulink> </para>
</listitem>
<listitem><para><filename>shp2pgsql</filename> commandline which is installed by default when you install PostGIS.</para></listitem>
<listitem><para><filename>wget</filename> which is a web grabber tool usually installed on most Unix/Linux systems.</para>
<para>If you are on windows, you can get pre-compiled binaries from <ulink url="http://gnuwin32.sourceforge.net/packages/wget.htm">http://gnuwin32.sourceforge.net/packages/wget.htm</ulink> </para>
</listitem>
</itemizedlist>
<para>If you are upgrading from tiger_2010, you'll need to first generate and run <xref linkend="Drop_Nation_Tables_Generate_Script" />. Before you load any state data, you need to load the nation wide data which you do with <xref linkend="Loader_Generate_Nation_Script" />. Which will
generate a loader script for you. <xref linkend="Loader_Generate_Nation_Script" /> is a one-time step that should be done for upgrading (from 2010) and for new installs.</para>
<para>To load state data refer to <xref linkend="Loader_Generate_Script" /> to generate a data load script for your platform for the states you desire.
Note that you can install these piecemeal. You don't have to load all the states you want all at once. You can load them as you need them.</para>
<para>After the states you desire have been loaded, make sure to run the:
<programlisting>SELECT install_missing_indexes();</programlisting> as described in <xref linkend="Install_Missing_Indexes" />.</para>
<para>To test that things are working as they should, try to run a geocode on an address in your state using <xref linkend="Geocode" /> </para>
</sect2>
<sect2 id="upgrade_tiger_geocoder">
<title>Upgrading your Tiger Geocoder Install</title>
<para>
@ -1039,8 +1066,13 @@ pretty_address
</para>
<para>Locate the <filename>upgrade_geocoder.bat</filename> script If you are on windows
or the <filename>upgrade_geocoder.sh</filename> if you are on Linux/Unix/Mac OSX. Edit the file to have your postgis database credientials and run then corresponding script from the commandline.
or the <filename>upgrade_geocoder.sh</filename> if you are on Linux/Unix/Mac OSX. Edit the file to have your postgis database credentials.</para>
<para>If you are upgrading from 2010 or 2011, make sure to unremark out the loader script line so you get the latest script for loading 2012 data.</para>
<para>
Then run th corresponding script from the commandline.
</para>
<para>Next drop all nation tables and load up the new ones. Generate a drop script with this SQL statement as detailed in <xref linkend="Drop_Nation_Tables_Generate_Script" /></para>
<programlisting>SELECT drop_nation_tables_generate_script();</programlisting>
<para>Run the generated drop SQL statements.</para>
@ -1052,31 +1084,7 @@ pretty_address
<para>Refer to <xref linkend="tiger_geocoder_loading_data" /> for instructions on how to run the generate script. This only needs to be done once.</para>
<note><para>You can have a mix of 2010/2011 state tables and can upgrade each state separately. Before you upgrade a state to 2011, you first need to drop the 2010 tables for that state using <xref linkend="Drop_State_Tables_Generate_Script" />.</para></note>
</sect2>
<sect2 id="tiger_geocoder_loading_data">
<title>Loading Tiger Data</title>
<para>The instructions for loading data are available in a more detailed form in the <filename>extras/tiger_geocoder/tiger_2011/README</filename>. This just includes the general steps.</para>
<para>The load process downloads data from the census website for the respective nation files, states requested, extracts the files, and then loads each state into its own separate
set of state tables. Each state table inherits from the tables defined in <varname>tiger</varname> schema so that its sufficient to just query those tables to access all the data and drop a set of state tables at any time using the <xref linkend="Drop_State_Tables_Generate_Script" /> if you need to reload a state or just don't need a state anymore.</para>
<para>In order to be able to load data you'll need the following tools:</para>
<itemizedlist>
<listitem><para>A tool to unzip the zip files from census website.</para>
<para>For Unix like systems: <varname>unzip</varname> executable which is usually already installed on most Unix like platforms.</para>
<para>For Windows, 7-zip which is a free compress/uncompress tool you can download from <ulink url="http://www.7-zip.org/">http://www.7-zip.org/</ulink> </para>
</listitem>
<listitem><para><filename>shp2pgsql</filename> commandline which is installed by default when you install PostGIS.</para></listitem>
<listitem><para><filename>wget</filename> which is a web grabber tool usually installed on most Unix/Linux systems.</para>
<para>If you are on windows, you can get pre-compiled binaries from <ulink url="http://gnuwin32.sourceforge.net/packages/wget.htm">http://gnuwin32.sourceforge.net/packages/wget.htm</ulink> </para>
</listitem>
</itemizedlist>
<para>If you are upgrading from tiger_2010, you'll need to first generate and run <xref linkend="Drop_Nation_Tables_Generate_Script" />. Before you load any state data, you need to load the nation wide data which you do with <xref linkend="Loader_Generate_Nation_Script" />. Which will
generate a loader script for you. </para>
<para>To load data refer to <xref linkend="Loader_Generate_Script" /> to generate a data load script for your platform for the states you desire.
Note that you can install these piecemeal. You don't have to load all the states you want all at once. You can load them as you need them.</para>
<para>After the states you desire have been loaded, make sure to run the:
<programlisting>SELECT install_missing_indexes();</programlisting> as described in <xref linkend="Install_Missing_Indexes" />.</para>
<para>To test that things are working as they should, try to run a geocode on an address in your state using <xref linkend="Geocode" /> </para>
</sect2>
</sect1>
<sect1 id="templatepostgis">