#2816: Rest of logic needed to build data us extension and install and remove old logic used to build old sql files

git-svn-id: http://svn.osgeo.org/postgis/trunk@13718 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
Regina Obe 2015-06-27 13:43:21 +00:00
parent cdfa82018d
commit 0d0a3e29ff
7 changed files with 11 additions and 8462 deletions

View file

@ -1270,7 +1270,8 @@ AC_OUTPUT([GNUmakefile
extensions/postgis_tiger_geocoder/Makefile
extensions/postgis_tiger_geocoder/postgis_tiger_geocoder.control
extensions/address_standardizer/Makefile
extensions/address_standardizer/address_standardizer.control
extensions/address_standardizer/address_standardizer.control
extensions/address_standardizer/address_standardizer_data_us.control
liblwgeom/Makefile
liblwgeom/cunit/Makefile
liblwgeom/liblwgeom.h

View file

@ -30,7 +30,7 @@ POSTGIS_PGSQL_VERSION=@POSTGIS_PGSQL_VERSION@
SQLPP = @SQLPP@
MODULE_big = address_standardizer-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@
EXTENSION = address_standardizer
DATA_built = address_standardizer--@POSTGIS_LIB_VERSION@.sql us-lex.sql us-gaz.sql us-rules.sql
DATA_built = address_standardizer--@POSTGIS_LIB_VERSION@.sql address_standardizer_data_us.control address_standardizer_data_us--@POSTGIS_LIB_VERSION@.sql us_lex.sql us_gaz.sql us_rules.sql
DOCS = README.address_standardizer
PG_CPPFLAGS = @CPPFLAGS@ -g -O0
@ -57,15 +57,10 @@ PERL=@PERL@
address_standardizer--@POSTGIS_LIB_VERSION@.sql: address_standardizer.sql
$(PERL) mk-sql.pl '$(PGVER)' address_standardizer.sql > address_standardizer--@POSTGIS_LIB_VERSION@.sql
us-lex.sql: lexicon.csv
$(PERL) pagc-data-psql lex lexicon.csv > us-lex.sql
us-gaz.sql: gazeteer.csv
$(PERL) pagc-data-psql gaz gazeteer.csv > us-gaz.sql
us-rules.sql: rules.txt
$(PERL) pagc-data-psql rules rules.txt > us-rules.sql
# build us data extension
address_standardizer_data_us--@POSTGIS_LIB_VERSION@.sql: us_lex.sql us_gaz.sql us_rules.sql
cat $^ >> $@
mk-st-regexp: mk-st-regexp.pl
$(PERL) -c mk-st-regexp.pl
rm -f mk-st-regexp

View file

@ -0,0 +1,4 @@
# address standardizer us dataset
comment = 'Address Standardizer US dataset example'
default_version = '@POSTGIS_LIB_VERSION@'
relocatable = true

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,71 +0,0 @@
#!/usr/bin/perl -w
use strict;
sub Usage {
die "Usage: pagc-data-psql [lex|gaz|rules] file\n";
}
my $mode = shift @ARGV || Usage();
my $file = shift @ARGV || Usage();
my $x;
open(IN, $file) || die "Failed to open '$file' : $!\n";
if ($mode eq 'lex') {
print <<EOF;
drop table if exists lex cascade;
create table lex (
id serial not null primary key,
seq integer,
word text,
stdword text,
token integer
);
copy lex (seq, word, token, stdword) from stdin;
EOF
while ($x = <IN>) {
$x =~ s/["\r\n]//g;
$x =~ s/,/\t/g;
print "$x\n";
}
print "\\.\n";
}
elsif ($mode eq 'gaz') {
print <<EOF;
drop table if exists gaz cascade;
create table gaz (
id serial not null primary key,
seq integer,
word text,
stdword text,
token integer
);
copy gaz (seq, word, token, stdword) from stdin;
EOF
while ($x = <IN>) {
$x =~ s/["\r\n]//g;
$x =~ s/,/\t/g;
print "$x\n";
}
print "\\.\n";
}
elsif ($mode eq 'rules') {
print <<EOF;
drop table if exists rules cascade;
create table rules (
id serial not null primary key,
rule text
);
copy rules (rule) from stdin;
EOF
while ($x = <IN>) {
$x =~ s/["\r\n]//g;
print "$x\n";
}
print "\\.\n";
}
else {
Usage();
}

File diff suppressed because it is too large Load diff