[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgis-users
Subject:    [postgis-users] Geocoding Issues with Route, ##-## house numbers;
From:       Daniel Weitzenfeld <dweitzenfeld () gmail ! com>
Date:       2011-07-27 20:27:10
Message-ID: CALVe9fk_4CTgFeUS2A0_P6dxJTzW27Ceys6SP=_nTPoAE7EhwA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,
I'm using and abusing the geocoder, and I've come across a couple issues:

1)  Routes
example:  '1820  ROUTE 32, MODENA, NY 12548':


 rating |    lon     |    lat    | address | predirabbrev | streetname |
streettypeabbrev | postdirabbrev | internal | location | stateabbrev |  zip
> parsed
--------+------------+-----------+---------+--------------+------------+------------------+---------------+----------+----------+-------------+-------+--------
  22 | -73.9374945714286 | 40.6108123469388 |    1820 | E            |
32nd       | St               |               |          | New York    |
NY          | 11234 | t

which is 85 miles away =)

2) ##-## addresses

example:  '112-31  196 STREET, SAINT ALBANS, NY'

 rating |    lon     |    lat    | address | predirabbrev | streetname |
streettypeabbrev | postdirabbrev | internal | location | stateabbrev |  zip
> parsed
--------+------------+-----------+---------+--------------+------------+------------------+---------------+----------+----------+-------------+-------+--------
  20 | -73.756229 | 40.693842 |         |              | 196th      |
St               |               |          | New York | NY          | 11412
> t

which is only .3 miles away, but note that it just ignored the house number.



Questions:
a.  Is there something I can do to pre-process either of these types of
addresses to help the geocoder?
b.  If I know that the zip code is correct, is there a setting I can adjust
so that the geocoder never looks outside the provided zip code?


According to normalize_address.sql, I'm using this version of the Geocoder:
7616 2011-07-07 12:41:13Z
If this is the version I 'installed' - ie started with - do I still need to
run upgrade_geocoder.sh? what about *Missing_Indexes_Generate_Script*()?

Lastly, a small contribution:  I noticed the geocoder was also having
problems with addresses like '45 3 STREET' and '45 WEST 3 STREET', and I
found that by adding a suffix to the '3' ('3' -> '3RD') gave it a push in
the right direction.  The regular expression I'm using to catch these is:

    foo=re.match(r'([0-9\-]+ +)([0-9]+)( +[a-zA-Z_]+)', street)
    foo2=re.match(r'([0-9\-]+ +)([WESTASOUHNOR]+ )([0-9]+)( +[a-zA-Z_]+)',
street)

Thanks,
Dan


[Attachment #5 (text/html)]

Hi,<br>I&#39;m using and abusing the geocoder, and I&#39;ve come across a couple \
issues:<br><br>1)  Routes<br>example:  &#39;1820  ROUTE 32, MODENA, NY \
12548&#39;:<br><br><br>  rating |    lon     |    lat    | address | predirabbrev | \
streetname |  streettypeabbrev | postdirabbrev | internal | location | stateabbrev | 
 zip  | parsed <br>
--------+------------+-----------+---------+--------------+------------+------------------+---------------+----------+----------+-------------+-------+--------<br> \
22 | -73.9374945714286 | 40.6108123469388 |    1820 | E            | 32nd       | St  \
|               |          | New York    | NY          | 11234 | t<br>

<br>which is 85 miles away =)<br><br>2) ##-## addresses<br><br>example:  &#39;112-31  \
196 STREET, SAINT ALBANS, NY&#39;<br><br> rating |    lon     |    lat    | address | \
predirabbrev | streetname | streettypeabbrev | postdirabbrev | internal | location | \
stateabbrev |  zip  | parsed <br>

--------+------------+-----------+---------+--------------+------------+------------------+---------------+----------+----------+-------------+-------+--------<br> \
20 | -73.756229 | 40.693842 |         |              | 196th      | St               \
|               |          | New York | NY          | 11412 | t<br>

<br>which is only .3 miles away, but note that it just ignored the house number. \
<br><br><br>Questions: <br>a.  Is there something I can do to pre-process either of \
these types of addresses to help the geocoder?  <br>b.  If I know that the zip code \
is correct, is there a setting I can adjust so that the geocoder never looks outside \
the provided zip code?<br>

<br><br>According to normalize_address.sql, I&#39;m using this version of the \
Geocoder:<br>7616 2011-07-07 12:41:13Z<br>If this is the version I \
&#39;installed&#39; - ie started with - do I still need to run upgrade_geocoder.sh? \
what about <code class="funcdef"> <b \
class="fsfunc">Missing_Indexes_Generate_Script</b>(</code><code>)?</code><br>

<br>Lastly, a small contribution:  I noticed the geocoder was also having problems \
with addresses like &#39;45 3 STREET&#39; and &#39;45 WEST 3 STREET&#39;, and I found \
that by adding a suffix to the &#39;3&#39; (&#39;3&#39; -&gt; &#39;3RD&#39;) gave it \
a push in the right direction.  The regular expression I&#39;m using to catch these \
is:<br>

<br>    foo=re.match(r&#39;([0-9\-]+ +)([0-9]+)( +[a-zA-Z_]+)&#39;, street)<br>    \
foo2=re.match(r&#39;([0-9\-]+ +)([WESTASOUHNOR]+ )([0-9]+)( +[a-zA-Z_]+)&#39;, \
street)<br><br>Thanks, <br>Dan<br><br><br><br><br><br><br>



_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic