]> granicus.if.org Git - postgis/commitdiff
#2816: Might have missed some commits on last go round, also add some updated doco
authorRegina Obe <lr@pcorp.us>
Sat, 27 Jun 2015 14:50:32 +0000 (14:50 +0000)
committerRegina Obe <lr@pcorp.us>
Sat, 27 Jun 2015 14:50:32 +0000 (14:50 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@13719 b70326c6-7e19-0410-871a-916f4a2858ee

doc/extras_address_standardizer.xml
extensions/address_standardizer/Makefile.in

index d5972a2ddfc72962b24a292b9b0446ae7fe1f541..bb0a1eb695d0b9a875b794712e99778b49c3f1c3 100644 (file)
@@ -3,7 +3,7 @@
        <title>Address Standardizer</title>
        <para>This is a fork of the <ulink url="http://www.pagcgeo.org/docs/html/pagc-11.html">PAGC standardizer</ulink> (original code for this portion was  <ulink url="http://sourceforge.net/p/pagc/code/360/tree/branches/sew-refactor/postgresql">PAGC PostgreSQL Address Standardizer</ulink>). </para>
        <para>The address standardizer is a single line address parser that takes an input address and normalizes it based on a set of rules stored in a table and helper lex and gaz tables.</para>
-       <para>The code is built into a single postgresql extension library called <code>address_standardizer</code> which can be installed with <code>CREATE EXTENSION address_standardizer;</code>.</para>
+       <para>The code is built into a single postgresql extension library called <code>address_standardizer</code> which can be installed with <code>CREATE EXTENSION address_standardizer;</code>. In addition to the address_standardizer extension, a sample data extension called <code>address_standardizer_data_us</code> extensions is built, which contains gaz, lex, and rules tables for US data.  This extensions can be installed via: <code>CREATE EXTENSION address_standardizer_data_us;</code></para>
         <para>The code for this extension can be found in the PostGIS <filename>extensions/address_standardizer</filename> and is currently self-contained.</para>
         <para>For installation instructions refer to: <xref linkend="installing_pagc_address_standardizer" />.</para>
   <sect1 id="Address_Standardizer_Basics"><title>How the Parser Works</title>
@@ -568,7 +568,12 @@ into includes in the future for easier maintenance.</para></listitem>
        
                <refsection>
                        <title>Examples</title>
-       
+                       <para>Using address_standardizer_data_us extension</para>
+                       <programlisting>CREATE EXTENSION address_standardizer_data_us; -- only needs to be done once
+SELECT *  FROM standardize_address('us_lex', 
+                          'us_gaz', 'us_rules', 'One Devonshire Place, PH 301, Boston, MA 02109-1234');</programlisting>
+
+                       <para>Using tables packaged with tiger geocoder. This example only works if you installec postgis_tiger_geocoder.</para>
                        <programlisting>SELECT *  FROM standardize_address('tiger.pagc_lex', 
                           'tiger.pagc_gaz', 'tiger.pagc_rules', 'One Devonshire Place, PH 301, Boston, MA 02109-1234');</programlisting>
                           
index 364dc854397dca035683f085514fdef97eda453d..69271d300e71a8140ba384e59cf4ab2013a2545f 100644 (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 address_standardizer_data_us.control address_standardizer_data_us--@POSTGIS_LIB_VERSION@.sql us_lex.sql us_gaz.sql us_rules.sql
+DATA_built = address_standardizer.sql sql/address_standardizer--@POSTGIS_LIB_VERSION@.sql address_standardizer_data_us.control sql/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
 
@@ -50,16 +50,24 @@ PERL=@PERL@
 
 # Borrow the $libdir substitution from PGXS but customise by running the preprocessor
 # and adding the version number
-%.sql: %.sql.in
+sql/%.sql: %.sql.in
        $(SQLPP) -I../libpgcommon $< | grep -v '^#' | \
        $(PERL) -lpe "s'MODULE_PATHNAME'\$$libdir/address_standardizer-@POSTGIS_MAJOR_VERSION@.@POSTGIS_MINOR_VERSION@'g" > $@
+
+sql/address_standardizer.sql: address_standardizer.sql
+       mkdir -p sql
+       cat $^ > $@
        
-address_standardizer--@POSTGIS_LIB_VERSION@.sql: address_standardizer.sql
-       $(PERL) mk-sql.pl '$(PGVER)' address_standardizer.sql > address_standardizer--@POSTGIS_LIB_VERSION@.sql
+sql/address_standardizer--@POSTGIS_LIB_VERSION@.sql: sql/address_standardizer.sql
+       cat $^ > $@
 
 # build us data extension
-address_standardizer_data_us--@POSTGIS_LIB_VERSION@.sql: us_lex.sql us_gaz.sql us_rules.sql
-       cat $^ >> $@
+sql/address_standardizer_data_us--@POSTGIS_LIB_VERSION@.sql: us_lex.sql us_gaz.sql us_rules.sql
+       mkdir -p sql
+       cat $^ > $@
+       
+sql/$(EXTENSION)--$(EXTVERSION)next--$(EXTVERSION).sql: sql/$(EXTENSION)--$(EXTVERSION)--$(EXTVERSION)next.sql
+       cat $^ > $@
        
 mk-st-regexp: mk-st-regexp.pl
        $(PERL) -c mk-st-regexp.pl