[postgis-users] Newbie Geocoding Error

Michael Papet mpapet at yahoo.com
Sat Jul 9 09:55:46 PDT 2011


Hi,

I'm a newbie using postgis from Debian's Testing repos. (v. 1.5)  I used the tiger_loader script to load the data.

Plenty of addresses geocode just fine.   Using the below query, I get an error.

SELECT g.rating,  ST_X(ST_AsEWKT(ST_SnapToGrid(g.geomout,0.00000001))) As lon, ST_Y(ST_AsEWKT(ST_SnapToGrid(g.geomout,0.00000001))) As lat, ST_AsEWKT(ST_SnapToGrid(g.geomout,0.00000001)) As wktlonlat, 
    (addy).address As stno, (addy).streetname As street, 
    (addy).streettypeabbrev As styp, (addy).location As city, (addy).stateabbrev As st,(addy).zip 
    FROM geocode(pprint_addy(normalize_address('3261 South West 160 Avenue, Miramar, FL 33027'))) As g 
    order by g.rating

Error: ERROR: query "SELECT substring(reducedStreet, '(?i)(^' || name
        || ')' || ws) FROM direction_lookup WHERE
         reducedStreet ILIKE '%' || name || '%'  AND texticregexeq(reducedStreet, '(?i)(^' || name || ')' || ws)
        ORDER BY length(name) DESC" returned more than one row
  Where: PL/pgSQL function "normalize_address" line 280 at assignment
PL/pgSQL function "geocode" line 10 at assignment
SQLState:  21000
ErrorCode: 0
The problem is with the street name 'South West 160 Avenue.' Is that a bug?

Also, Southwest 160 Avenue' returns some very low-accuracy results.  What queries can I use to view the tiger data to increase the rating? In my head, I'd like to select all street names in the zip code 33027 using like statements to narrow results to figure out why the g.rating is so bad on this address.  But, that's probably different than how TIGER data is structured.  Can someone post an example of a select to improve the accuracy?  It's also possible the address is slightly wrong, but I get accurate results from google earth.

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20110709/7d8c96a4/attachment.html>


More information about the postgis-users mailing list