<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PostalCode"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="City"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
code
        {font-family:"Courier New";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:2128810252;
        mso-list-type:hybrid;
        mso-list-template-ids:-1809004222 67698699 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:\F0D8;
        mso-level-tab-stop:.5in;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;
        mso-fareast-font-family:"Times New Roman";
        mso-bidi-font-family:"Times New Roman";}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Dan,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3 color=navy
face="Times New Roman"><span style='font-size:12.0pt;color:navy'>> </span></font>Hi,<br>
<font color=navy><span style='color:navy'>> </span></font>I'm using and
abusing the geocoder, and I've come across a couple issues:<br>
<br>
<font color=navy><span style='color:navy'>> </span></font>1)  Routes<br>
<font color=navy><span style='color:navy'>> </span></font>example: 
'1820  ROUTE 32, <st1:place w:st="on"><st1:City w:st="on">MODENA</st1:City>,
 <st1:State w:st="on">NY</st1:State> <st1:PostalCode w:st="on">12548</st1:PostalCode></st1:place>':<br>
<br>
<br>
<font color=navy><span style='color:navy'>> </span></font> rating
|    lon     |   
lat    | address | predirabbrev | streetname | streettypeabbrev
| postdirabbrev | internal | location | stateabbrev |  zip  | parsed <br>
--------+------------+-----------+---------+--------------+------------+------------------+---------------+----------+----------+-------------+-------+--------<br>
 <font color=navy><span style='color:navy'>></span></font>   
22 | -73.9374945714286 | 40.6108123469388 |    1820 |
E            |
32nd       |
St              
|              
|          | <st1:State w:st="on"><st1:place
 w:st="on">New York</st1:place></st1:State>    |
NY          | 11234 | t<br>
<br>
<font color=navy><span style='color:navy'>> </span></font>which is 85 miles
away =)<font color=navy><span style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I think item 1 I fixed already.  I
forget if I committed my fix for it though.  I think I did, but I haven’t
committed anything for a while since<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I’m working on speeding up things,
and sadly if things work faster in one version of PostgreSQL, they work slower
in another and so forth.  So I’m working on a comfortable
balance.  Mostly fiddling with index selectivity.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
<font color=navy><span style='color:navy'>> </span></font>2) ##-## addresses<br>
<br>
<font color=navy><span style='color:navy'>> </span></font>example: 
'112-31  196 STREET, <st1:place w:st="on">SAINT ALBANS</st1:place>, NY'<br>
<br>
 rating |    lon    
|    lat    | address | predirabbrev | streetname
| streettypeabbrev | postdirabbrev | internal | location | stateabbrev | 
zip  | parsed <br>
--------+------------+-----------+---------+--------------+------------+------------------+---------------+----------+----------+-------------+-------+--------<br>
  <font color=navy><span style='color:navy'>> </span></font>  
20 | -73.756229 | 40.693842 |        
|             
| 196th      | St              
|              
|          | <st1:State w:st="on"><st1:place
 w:st="on">New York</st1:place></st1:State> |
NY          | 11412 | t<br>
<br>
<font color=navy><span style='color:navy'>> </span></font>which is only .3
miles away, but note that it just ignored the house number. <br>
<font color=navy><span style='color:navy'>This one I have listed as a bug
already on my todo –<o:p></o:p></span></font></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3 color=navy
face="Times New Roman"><span style='font-size:12.0pt;color:navy'><a
href="http://trac.osgeo.org/postgis/ticket/886">http://trac.osgeo.org/postgis/ticket/886</a>
 (although your above looks like a slightly different issue which I may
have already fixed)</span></font><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>
<font color=navy><span style='color:navy'>> </span></font>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?<font color=navy><span
style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><a
href="http://www.postgis.org/documentation/manual-svn/Geocode.html">http://www.postgis.org/documentation/manual-svn/Geocode.html</a>
 (Give the geometry filter option a try.  I haven’t really
stress tested it)<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>I’ve
also got on todo to revamp the rating so that you can better control the
weighting scores, but that won’t happen until I’ve tackled the
speed<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Listed
here: <a href="http://trac.osgeo.org/postgis/ticket/1111">http://trac.osgeo.org/postgis/ticket/1111</a><o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>You can
add yourself to the cc of these tickets if you want to be notified when they
are amended/closed<o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><font
size=3 color=navy face=Wingdings><span style='font-size:12.0pt;font-family:
Wingdings;color:navy'><span style='mso-list:Ignore'>Ø<font size=1
face="Times New Roman"><span style='font:7.0pt "Times New Roman"'>     
</span></font></span></span></font><![endif]>According to
normalize_address.sql, I'm using this version of the Geocoder:<br>
<font color=navy><span style='color:navy'>> </span></font>7616 2011-07-07
12:41:13Z<br>
<font color=navy><span style='color:navy'>> </span></font>If this is the
version I 'installed' - ie started with - do I still need to run
upgrade_geocoder.sh? what about <font color=navy><span style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:.25in'><font size=3 color=navy face="Times New Roman"><span
style='font-size:12.0pt;color:navy'>Yes – latest version is: 7632
2011-07-12  (so you are already behind </span></font><font color=navy
face=Wingdings><span style='font-family:Wingdings;color:navy'>J</span></font><font
color=navy><span style='color:navy'> ) </span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:.25in'><font size=3 face="Times New Roman"><span
style='font-size:12.0pt'><o:p> </o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:0in;margin-right:0in;margin-bottom:
12.0pt;margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><code><font
size=3 face=Wingdings><span style='font-size:12.0pt;font-family:Wingdings'><span
style='mso-list:Ignore'>Ø<font size=1 face="Times New Roman"><span
style='font:7.0pt "Times New Roman"'>      </span></font></span></span></font></code><![endif]><code><b><font
size=2 face="Courier New"><span style='font-size:10.0pt;font-weight:bold'>Missing_Indexes_Generate_Script</span></font></b></code><code><font
size=2 face="Courier New"><span style='font-size:10.0pt'>()?</span></font></code><code><font
face="Times New Roman"><span style='font-family:"Times New Roman"'><o:p></o:p></span></font></code></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>I have
that now as part of the update script to install missing indexes.  It runs
pretty fast if you have all the key indexes in place already.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>So
basically runs this command now -- <a
href="http://www.postgis.org/documentation/manual-svn/Install_Missing_Indexes.html">http://www.postgis.org/documentation/manual-svn/Install_Missing_Indexes.html</a></span></font><br>
<br>
<font color=navy><span style='color:navy'>> </span></font>Lastly, a small
contribution:  I noticed the geocoder was also having problems with
addresses like '45 3 STREET' and '45 WEST 3 <font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>          
</span></font><font color=navy><span style='color:navy'>> </span></font>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:<br>
<br>
    <font color=navy><span style='color:navy'>> </span></font>foo=re.match(r'([0-9\-]+
+)([0-9]+)( +[a-zA-Z_]+)', street)<br>
    <font color=navy><span style='color:navy'>> </span></font>foo2=re.match(r'([0-9\-]+
+)([WESTASOUHNOR]+ )([0-9]+)( +[a-zA-Z_]+)', street)<font color=navy><span
style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'>Thanks –
I’ll check that out.<o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><st1:City w:st="on"><st1:place
 w:st="on"><font size=3 color=navy face="Times New Roman"><span
  style='font-size:12.0pt;color:navy'>Regina</span></font></st1:place></st1:City><font
color=navy><span style='color:navy'><o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3 color=navy
face="Times New Roman"><span style='font-size:12.0pt;color:navy'><a
href="http://www.postgis.us/">http://www.postgis.us</a><o:p></o:p></span></font></p>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
<br>
<br>
<br>
<br>
<o:p></o:p></span></font></p>

</div>

</body>

</html>