[postgis-tickets] [PostGIS] #5408: regression failure on tiger geocoder pagc_normalize_address

PostGIS trac at osgeo.org
Thu Jun 22 19:41:08 PDT 2023


#5408: regression failure on tiger geocoder pagc_normalize_address
----------------------------------+---------------------------
  Reporter:  robe                 |      Owner:  robe
      Type:  defect               |     Status:  new
  Priority:  medium               |  Milestone:  PostGIS 3.3.4
 Component:  pagc_address_parser  |    Version:  master
Resolution:                       |   Keywords:
----------------------------------+---------------------------
Comment (by robe):

 Okay maybe this is just a case of too ambiguous.

 The 2 arg standardizer works fine:


 {{{
 SELECT *
 FROM standardize_address('us_lex',  'us_gaz', 'us_rules','212 3rd Ave N',
 'Minneapolis, MN 55401');
 }}}


 {{{
 building | house_num | predir | qual | pretype | name | suftype | sufdir |
 ruralroute | extra |    city     |   state   | country | postcode | box |
 unit
 ----------+-----------+--------+------+---------+------+---------+--------+------------+-------+-------------+-----------+---------+----------+-----+------
           | 212       |        |      |         | 3    | AVENUE  | NORTH
 |            |       | MINNEAPOLIS | MINNESOTA |         | 55401    |
 |
 (1 row)
 }}}


 and if I put the comma in the right spot, it works fine too:


 {{{
 SELECT *
 FROM standardize_address('us_lex',  'us_gaz', 'us_rules','212 3rd Ave N,
 Minneapolis, MN 55401');
 }}}



 {{{
  building | house_num | predir | qual | pretype | name | suftype | sufdir
 | ruralroute | extra |    city     |   state   | country | postcode | box
 | unit
 ----------+-----------+--------+------+---------+------+---------+--------+------------+-------+-------------+-----------+---------+----------+-----+------
           | 212       |        |      |         | 3    | AVENUE  | NORTH
 |            |       | MINNEAPOLIS | MINNESOTA | USA     | 55401    |
 |
 (1 row)
 }}}


 The debug_normalize_address shows the primary issue is at the
 parse_address level as how it separates the single line into a micro,
 macro and not with the rules.


 {{{
 SELECT d->>'micro' AS micro, d->>'macro' AS macro
 FROM jsonb(debug_standardize_address('us_lex',  'us_gaz', 'us_rules','212
 3rd Ave N Minneapolis, MN 55401')) AS d;
 }}}



 {{{
    micro    |           macro
 -------------+----------------------------
  212 3rd Ave | N Minneapolis,MN,55401,US,
 (1 row)

 }}}

 Which actually is not bad, I mean it should resolve to North Minneapolis,
 but I guess since there is no such thing in the gaz table, it doesn't know
 what to do with that N.  Why it shoves that in the zip field is a little
 concerning.

 But testing with the parse address though, the zip is picked up correctly,
 so something is a bit haywire here


 {{{
 SELECT *
 FROM parse_address('212 3rd Ave N Minneapolis, MN 55401');
 }}}



 {{{
 num | street  | street2 |  address1   |     city      | state |  zip  |
 zipplus | country
 -----+---------+---------+-------------+---------------+-------+-------+---------+---------
  212 | 3rd Ave |         | 212 3rd Ave | N Minneapolis | MN    | 55401 |
 | US
 (1 row)

 }}}
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5408#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list