<div dir="ltr">Thanks for adding it as a ticket and for the strip commas idea.  I will give that a try until the fix for it is implented.  Cheers.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 30, 2013 at 11:01 AM, Stephen Woodbridge [via PostGIS] <span dir="ltr"><<a href="/user/SendEmail.jtp?type=node&node=5004684&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a>></span> wrote:<br>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">

        The underlying code the parses the address string into fields is 
<br>parse_address(string)
<br><br></div>stdaddr=# select * from parse_address('16 Berry Lane, schenectady, ny 
<br>12302');
<br><div class="im">  num |   street   | street2 |   address1    |    city     | state | 
<br>zip  | zipplus | country
<br>-----+------------+---------+---------------+-------------+-------+-------+---------+---------
<br>  16  | Berry Lane |         | 16 Berry Lane | schenectady | NY    | 
<br>12302 |         | US
<br>(1 row)
<br><br></div>stdaddr=# select * from parse_address('16 Berry Lane, skenectady, ny 
<br>12302');
<br><div class="im">  num |         street         | street2 |         address1          | 
<br>city | state |  zip  | zipplus | country
<br>-----+------------------------+---------+---------------------------+------+-------+-------+---------+---------
<br>  16  | Berry Lane, skenectady |         | 16 Berry Lane, skenectady | 
<br>     | NY    | 12302 |         | US
<br>(1 row)
<br><br>This one looks like the problem and I think this is a bug based on the 
<br>intended coding. I thought this would split on the commas if they 
<br>existed, but maybe that was changed.
<br><br>Removing the comma between street and city does work:
<br><br></div>stdaddr=# select * from parse_address('16 Berry Lane skenectady, ny 12302');
<br><div class="im">  num |   street   | street2 |   address1    |    city    | state |  zip 
<br>  | zipplus | country
<br>-----+------------+---------+---------------+------------+-------+-------+---------+---------
<br>  16  | Berry Lane |         | 16 Berry Lane | skenectady | NY    | 
<br>12302 |         | US
<br>(1 row)
<br><br>The simplest solution for now might be to remove the commas like:
<br><br>stdaddr=# select * from parse_address(replace('16 Berry Lane, 
<br>skenectady, ny 12302',',',''));
<br>  num |   street   | street2 |   address1    |    city    | state |  zip 
<br>  | zipplus | country
<br>-----+------------+---------+---------------+------------+-------+-------+---------+---------
<br>  16  | Berry Lane |         | 16 Berry Lane | skenectady | NY    | 
<br>12302 |         | US
<br>(1 row)
<br><br><a href="http://trac.osgeo.org/postgis/ticket/2522" rel="nofollow" link="external" target="_blank">http://trac.osgeo.org/postgis/ticket/2522</a><br><br>-Steve
<br><br>On 10/29/2013 10:27 PM, crowmagnumb wrote:
</div><div><div><div class="h5"><div class='shrinkable-quote'><br>> I have installed the adress_standardizer (version 1.0) into a fresh install
<br>> of postgresql 9.3.1 with postgis 2.1.0 and I am finding an issue with the
<br>> address normalizer.
<br>>
<br>> If I give the following valid address, it works...
<br>>
<br>> db=# select internal, location, stateabbrev from pagc_normalize_address('16
<br>> Berry Lane, schenectady, ny 12302');
<br>>   internal |  location   | stateabbrev
<br>> ----------+-------------+-------------
<br>>            | SCHENECTADY | NY
<br>>
<br>> ... but if I intentionally misspell schenectady (because I'm trying to get a
<br>> function to work using soundex() to allow misspellings), then it doesn't
<br>> work ....
<br>>
<br>> db=# select internal, location, stateabbrev from pagc_normalize_address('16
<br>> Berry Lane, skenectady, ny 12302');
<br>>     internal   | location | stateabbrev
<br>> --------------+----------+-------------
<br>>   # SKENECTADY | NEW YORK |
<br>>
<br>>
<br>> ... the misspelled town is put into the internal field and the location
<br>> becomes New York spelled out.  But then if I get rid of the comma between
<br>> Lane and the town but still misspell it, it parses as I expect...
<br>>
<br>> ksedb=# select internal, location, stateabbrev from
<br>> pagc_normalize_address('16 Berry Lane skenectady, ny 12302');
<br>>   internal |  location  | stateabbrev
<br>> ----------+------------+-------------
<br>>            | SKENECTADY | NY
<br>>
<br>> ... with the location being the incorrectly spelled town name.
<br>>
<br>> Any ideas why this subtle difference occurs?
<br>>
<br>>
<br>>
<br>>
<br>>
<br>> --
<br>> View this message in context: <a href="http://postgis.17.x6.nabble.com/Problem-with-pagc-normalize-address-results-tp5004678.html" rel="nofollow" link="external" target="_blank">http://postgis.17.x6.nabble.com/Problem-with-pagc-normalize-address-results-tp5004678.html</a></div>
> Sent from the PostGIS - User mailing list archive at Nabble.com.
<br>> _______________________________________________
<br>> postgis-users mailing list
<br></div></div>> <a href="http://user/SendEmail.jtp?type=node&node=5004679&i=0" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br>> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" rel="nofollow" link="external" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>>
</div><br>_______________________________________________
<br>postgis-users mailing list
<br><a href="http://user/SendEmail.jtp?type=node&node=5004679&i=1" rel="nofollow" link="external" target="_blank">[hidden email]</a>
<br><a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" rel="nofollow" link="external" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>

        
        
        
        <br>
        <br>
        <hr noshade size="1" color="#cccccc">
        <div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
                <div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
                <a href="http://postgis.17.x6.nabble.com/Problem-with-pagc-normalize-address-results-tp5004678p5004679.html" target="_blank" rel="nofollow" link="external">http://postgis.17.x6.nabble.com/Problem-with-pagc-normalize-address-results-tp5004678p5004679.html</a>
        </div>
        <div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;margin-top:.4em;line-height:1.5em">
                
                To unsubscribe from Problem with pagc_normalize_address() results..., <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br>

                <a href="http://postgis.17.x6.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml" rel="nofollow" style="font:9px serif" target="_blank" link="external">NAML</a>
        </div></blockquote></div><br></div>


        
        
        
<br/><hr align="left" width="300" />
View this message in context: <a href="http://postgis.17.x6.nabble.com/Problem-with-pagc-normalize-address-results-tp5004678p5004684.html">Re: Problem with pagc_normalize_address() results...</a><br/>
Sent from the <a href="http://postgis.17.x6.nabble.com/PostGIS-User-f3516033.html">PostGIS - User mailing list archive</a> at Nabble.com.<br/>