[postgis-devel] Updates to address standardizer
Stephen Woodbridge
woodbri at swoodbridge.com
Fri Apr 26 14:57:25 PDT 2013
Hi Brian,
Sorry, I'm way behind on my email today. So this is how I do it:
create table stdstreets (
id integer not null primary key,
building varchar,
house_num varchar,
predir varchar,
qual varchar,
pretype varchar,
name varchar,
suftype varchar,
sufdir varchar,
ruralroute varchar,
extra varchar,
city varchar,
state varchar,
country varchar,
postcode varchar,
box varchar,
unit varchar,
name_dmeta varchar
);
insert into stdstreets
(id,building,house_num,predir,qual,pretype,name,suftype,sufdir,ruralroute,extra,city,state,country,postcode,box,unit,name_dmeta)
select id, (std).*, coalesce(nullif(dmetaphone((std).name),''),
(std).name)
from (
select gid as id, standardize_address(
'lex'::text, 'gaz'::text, 'rules'::text,
address,
city||'', CA ''||zip ) as std
from cc_s_h_03_13 order by gid
) as foo;
ignore sew-refactor2 it will get deleted.
On 4/26/2013 1:07 PM, maplabs at light42.com wrote:
> does this call look right to you Steve?
>
> create table cc_s_03_13_std_addr as
> select (f).* from ( select c.pkey,
> standardize_address(
> 'select * from lex'::text,
> 'select * from gaz'::text,
> 'select * from rules'::text,
> 'select 1::integer as id, address as micro, city||'', CA ''||zip as
> macro
> from cc_s_h_03_13'::text
> ) as f
> from cc_s_h_03_13 c offset 0)
> s;
>
> On Thu, 25 Apr 2013 21:11:22 -0400, Stephen Woodbridge
> <woodbri at swoodbridge.com> wrote:
> Hi all,
>>
>> There have been a bunch of small updates to the pagc address
>> standardizer today.
>> * relaxed sanitizing lex, gaz and rules table names and allowed schemas
>> * added "order by id" to the internal queries to select the records
>> from these tables, because changes in order can potentially impact
>> results. * cleanup some compile time warnings
>> * added some missing error checks so we exit nicely
>>
>> So if you are tracking this, it would be good to pull the current copy
>> (Rev: 357).
>> If you have questions on how to use this or how it works, I'll be
>> happy to answer them if I can.
>> Thanks,
>> -Steve
>> _______________________________________________
>> postgis-devel mailing list
>> postgis-devel at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-devel
>>
>>
>
>
More information about the postgis-devel
mailing list