[postgis-users] Newbie Geocoding Error

Michael Papet mpapet at yahoo.com
Sun Jul 10 06:58:48 PDT 2011


Thanks for your help.  I updated postgis install to the later SVN as linked on the site and had a couple of observations,

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?
2. My original error went away.

So, now onto another address that does not geocode.  The results don't even include the street in the query.
477 Camino del Rio South, San Diego, CA 94115

SELECT * from normalize_address returns 
address    predirabbrev    streetname    streettypeabbrev    postdirabbrev    internal    location    stateabbrev    zip    parsed
477    <null>    Camino del Rio    <null>    S    <null>    San Diego    CA    94115    true

I don't have enough knowledge of postGIS right now to know if it's a bug or operator error.

Thanks again.


Message: 10
Date: Sat, 9 Jul 2011 14:23:09 -0400
From: "Paragon Corporation" <lr at pcorp.us>
Subject: Re: [postgis-users] Newbie Geocoding Error
To: "'PostGIS Users Discussion'"
    <postgis-users at postgis.refractions.net>
Message-ID: <20AE3B391EAA4F1A8CBE0347002383E2 at J>
Content-Type: text/plain; charset="us-ascii"


Which version are you running with?  For the newer ones -- if you look at
the normalize_address function , you should see a stamp in the beginning of
the code that has

--$Id: normalize_address.sql 7616 2011-07-07 12:41:13Z robe $-

That is the latest version stamp. Really old versions don't even have a
stamp.   If you are running something older than a week or 2 ago, that is
probably why you are having these issues.
The easiest way to upgrade to the latest is:
1) Download the PostGIS 2.0  tar ball from here --
http://www.postgis.org/download/  (the tiger_geocoder is in
-- (This new version requires PostGIS 1.5+ and PostgreSQL 8.4+)

2) Edit the  upgrade_geocoder.sh file with your postgres settings and then
run it.

3) Run the Missing_indexes_Generate_Script() to get the commands to build
indexes you may be missing.

and then execute that generated script

I think this is a bug I might have fixed.  When I run normalize on this I
don't get an error, and yours seems to be breaking in the normalize step.

When I run
SELECT * FROM normalize_address('3261 South West 160 Avenue, Miramar, FL

I get the below

address | predirabbrev | streetname | streettypeabbrev | postdirabbrev |
internal | location | stateabbrev |  zip  | parsed
    3261 | SW              | 160            | Ave              |
| Miramar  | FL          | 33027 | t

Unfortunately I don't have Florida data loaded so can't tell if it will
geocode right or not. 

Regarding bad rating results, the issue is often what the address gets
normalized to and  a bad normalization is often the cause of bad geocoding
results.  So probably the
best check to do is do a simple

SELECT  * FROM normalize_address(...);

and see what it comes with and if that normalized addess makes sense.

There are many cases where it doesn't that I have fixed recently and some
more that are known bugs I am working on.  Check out the list of issues and
closed ones for details:

The other issue I see with your code -- which perhaps it was for testing, is
that you are normalizing twice.

You should just be doing a:
geocode('3261 South West 160 Avenue, Miramar, FL 33027')

No need for those extra steps.

You might want to take a look at the manual for recent improvements made too
and examples:

Hope that helps,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110710/b601a5c1/attachment.html>

More information about the postgis-users mailing list