From 21fad93a90057966c4355c70a71f25136cc06e9f Mon Sep 17 00:00:00 2001 From: Regina Obe Date: Tue, 10 Jan 2012 06:53:12 +0000 Subject: [PATCH] #1442: Add sections on installing, upgrading and loading data into tiger geocoder. Got at least 2 people who seem confused about how to upgrade their tiger installs and assume it follows the same steps as the rest of PostGIS. git-svn-id: http://svn.osgeo.org/postgis/trunk@8734 b70326c6-7e19-0410-871a-916f4a2858ee --- doc/installation.xml | 84 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/doc/installation.xml b/doc/installation.xml index fa0db0327..6155e4cf7 100644 --- a/doc/installation.xml +++ b/doc/installation.xml @@ -913,6 +913,90 @@ Failed: 0 psql -d [yourdatabase] -c "CREATE EXTENSION postgis_topology;" + + + Installing Tiger Geocoder + + 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 extras/tiger_geocoder/tiger_2010/README + If you are on Windows and you don't have tar installed, you can use http://www.7-zip.org/ to unzip the PostGIS tarball. + + Tiger Geocode Enabling your PostGIS database + + First install PostGIS using the prior instructions. + + + + If you don't have an extras folder, download http://www.postgis.org/download/postgis-&last_release_version;.tar.gz + + + + tar xvfz postgis-&last_release_version;.tar.gz + + + + cd postgis-&last_release_version;/extras/tiger_geocoder/tiger_2010 + + + Edit the tiger_loader.sql to the paths of your executables server etc. + If you are installing Tiger geocoder for the first time edit either the create_geocode.bat script If you are on windows + or the create_geocode.sh 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 command. + + Verify that you now have a tiger 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: ALTER DATABASE geocoder SET search_path=public, tiger; + The normalizing address functionality works more or less without any data except for tricky addresses. Run this test and verify things look like this: + SELECT pprint_addy(normalize_address('202 East Fremont Street, Las Vegas, Nevada 89101')) As pretty_address; +pretty_address +--------------------------------------- +202 E Fremont St, Las Vegas, NV 89101 + + + + + Upgrading your Tiger Geocoder Install + + If you have Tiger Geocoder packaged with 2.0 already installed, you can upgrade the functions at any time even from an interim tar ball if there are fixes you badly need. + + + + If you don't have an extras folder, download http://www.postgis.org/download/postgis-&last_release_version;.tar.gz + + + + tar xvfz postgis-&last_release_version;.tar.gz + + + + cd postgis-&last_release_version;/extras/tiger_geocoder/tiger_2010 + + + Locate the upgrade_geocoder.bat script If you are on windows + or the upgrade_geocoder.sh 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. + + + + + The instructions for loading data are available in a more detailed form in the extras/tiger_geocoder/tiger_2010/README. This just includes the general steps. + The load process downloads data from the census website for the respective 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 tiger 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 if you need to reload a state or just don't need a state anymore. + In order to be able to load data you'll need the following tools: + + A tool to unzip the zip files from census website. + For Unix like systems: unzip executable which is usually already installed on most Unix like platforms. + For Windows, 7-zip which is a free compress/uncompress tool you can download from http://www.7-zip.org/ + + shp2pgsql commandline which is installed by default when you install PostGIS. + wget which is a web grabber tool usually installed on most Unix/Linux systems. + If you are on windows, you can get pre-compiled binaries from http://gnuwin32.sourceforge.net/packages/wget.htm + + + To load data refer to 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. + + After the states you desire have been loaded, make sure to run the: + SELECT install_missing_indexes(); as described in . + To test that things are working as they should, try to run a geocode on an address in your state using + + Create a spatially-enabled database from a template -- 2.40.0