<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt">Regina,<br><br>Thanks for your help.  I updated postgis install to the later SVN as linked on the site and had a couple of observations,<br><br>1. the upgrade_geocoder script ran with most of the sql returning 'already exists' errors.  Do I need to modify the script to drop before recreating?<br>2. My original error went away.<br><br>So, now onto another address that does not geocode.  The results don't even include the street in the query.<br>477 Camino del Rio South, San Diego, CA 94115<br><br>SELECT * from normalize_address returns <br>address    predirabbrev    streetname    streettypeabbrev    postdirabbrev    internal    location    stateabbrev    zip   
 parsed<br>477    <null>    Camino del Rio    <null>    S    <null>    San Diego    CA    94115    true<br><br>I don't have enough knowledge of postGIS right now to know if it's a bug or operator error.<br><br>Thanks again.<br><br>Michael<br><br><br><br><br>Message: 10<br>Date: Sat, 9 Jul 2011 14:23:09 -0400<br>From: "Paragon Corporation" <<a href="mailto:lr@pcorp.us">lr@pcorp.us</a>><br>Subject: Re: [postgis-users] Newbie Geocoding Error<br>To: "'PostGIS Users Discussion'"<br>    <<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>><br>Message-ID: <20AE3B391EAA4F1A8CBE0347002383E2@J><br>Content-Type: text/plain; charset="us-ascii"<br><br>Mike,<br> <br>Which version are you running with?  For the newer ones -- if you look
 at<br>the normalize_address function , you should see a stamp in the beginning of<br>the code that has<br> <br>--$Id: normalize_address.sql 7616 2011-07-07 12:41:13Z robe $-<br> <br>That is the latest version stamp. Really old versions don't even have a<br>stamp.   If you are running something older than a week or 2 ago, that is<br>probably why you are having these issues.<br>The easiest way to upgrade to the latest is:<br>1) Download the PostGIS 2.0  tar ball from here --<br><a href="http://www.postgis.org/download/" target="_blank">http://www.postgis.org/download/</a>  (the tiger_geocoder is in<br>extras/tiger_geocoder/tiger_2010)  <br>-- (This new version requires PostGIS 1.5+ and PostgreSQL 8.4+)<br> <br>2) Edit the  upgrade_geocoder.sh file with your postgres settings and then<br>run it.<br> <br>3) Run the Missing_indexes_Generate_Script() to get the commands to build<br>indexes you may be missing.<br> <br><a
 href="http://www.postgis.org/documentation/manual-svn/Missing_Indexes_Generate_Scr" target="_blank">http://www.postgis.org/documentation/manual-svn/Missing_Indexes_Generate_Scr</a><br>ipt.html<br> and then execute that generated script<br> <br>----------------------------------------------------------------------------<br>--------------<br>I think this is a bug I might have fixed.  When I run normalize on this I<br>don't get an error, and yours seems to be breaking in the normalize step.<br> <br>When I run<br>SELECT * FROM normalize_address('3261 South West 160 Avenue, Miramar, FL<br>33027')<br> <br>I get the below<br> <br> <br> <br> address | predirabbrev | streetname | streettypeabbrev | postdirabbrev |<br>internal | location | stateabbrev |  zip  | parsed<br>---------+--------------+------+------------------+---------------+---------<br>-+----------+-------------+-------+--------<br>    3261 | SW       
       | 160            | Ave              |<br>| Miramar  | FL          | 33027 | t<br> <br> <br>Unfortunately I don't have Florida data loaded so can't tell if it will<br>geocode right or not. <br> <br>Regarding bad rating results, the issue is often what the address gets<br>normalized to and  a bad normalization is often the cause of bad geocoding<br>results.  So probably the<br>best check to do is do a simple<br> <br>SELECT  * FROM normalize_address(...);<br> <br>and see what it comes with and if that normalized addess makes sense.<br> <br>There are many cases where it doesn't that I have fixed recently and some<br>more that are known bugs I am working on.  Check out the list of issues and<br>closed ones for details:<br><a href="http://trac.osgeo.org/postgis/query?component=tiger+geocoder"
 target="_blank">http://trac.osgeo.org/postgis/query?component=tiger+geocoder</a><br> <br> <br>The other issue I see with your code -- which perhaps it was for testing, is<br>that you are normalizing twice.<br> <br>You should just be doing a:<br>geocode('3261 South West 160 Avenue, Miramar, FL 33027')<br> <br>No need for those extra steps.<br> <br>You might want to take a look at the manual for recent improvements made too<br>and examples:<br><a href="http://www.postgis.org/documentation/manual-svn/Geocode.html" target="_blank">http://www.postgis.org/documentation/manual-svn/Geocode.html</a><br> <br>Hope that helps,<br>Regina<br><a href="http://www.postgis.us/" target="_blank">http://www.postgis.us</a></div></body></html>