Opened 13 years ago
Closed 12 years ago
#1600 closed defect (fixed)
normalize_address() confused by whitespace
Reported by: | mikepease | Owned by: | robe |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.1.0 |
Component: | pagc_address_parser | Version: | 1.5.X |
Keywords: | Cc: | woodbri |
Description
If there is a tab or newline at the beginning or end of an address string, normalize_address() incorrectly parses the address components.
select * from normalize_address('212 n 3rd ave, Minneapolis, mn 55401 ')
select * from normalize_address(' 212 n 3rd ave, Minneapolis, mn 55401')
Can your function start off by cleaning up whitespace on the input string? When I don't make sure to send input clean of whitespace, I get poor results.
Something like… trim(regexp_replace(' 212 n 3rd ave, Minneapolis, mn 55401', '\r|\n', ' ', 'g'))
e.g. select normalize_address(trim(raw_address))
Change History (6)
comment:1 by , 13 years ago
Status: | new → assigned |
---|
comment:2 by , 13 years ago
Milestone: | PostGIS 2.0.0 → PostGIS 2.1.0 |
---|
comment:3 by , 12 years ago
Cc: | added |
---|
comment:4 by , 12 years ago
Component: | tiger geocoder → pagc_address_parser |
---|
comment:5 by , 12 years ago
comment:6 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
this works with pagc my other issue is a total unrelated and doesn't really belong here.
This works okay with pagc_normalize
Except instead of 3rd, it returns: 3
Debating if that is okay or not. I'll have to see how geocoder handles it. I don't think it will care.
e.g.
Yields: