[postgis-users] Problem with pagc_normalize_address() results...

crowmagnumb southerland at samsix.com
Wed Oct 30 01:13:33 PDT 2013


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.


On Wed, Oct 30, 2013 at 11:01 AM, Stephen Woodbridge [via PostGIS] <
ml-node+s17n5004679h81 at n6.nabble.com> wrote:

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




--
View this message in context: http://postgis.17.x6.nabble.com/Problem-with-pagc-normalize-address-results-tp5004678p5004684.html
Sent from the PostGIS - User mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20131030/16c3cf42/attachment.html>


More information about the postgis-users mailing list