[SCM] PostGIS branch stable-3.4 updated. 3.4.2-21-gad75e78be

git at osgeo.org git at osgeo.org
Fri Mar 15 19:02:00 PDT 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, stable-3.4 has been updated
       via  ad75e78be74037d2c37e2c05fc7a0dd40831035e (commit)
      from  77bc5c2f96dfc42b4be6d19f524acd476f54c249 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit ad75e78be74037d2c37e2c05fc7a0dd40831035e
Author: Regina Obe <lr at pcorp.us>
Date:   Fri Mar 15 22:00:52 2024 -0400

    address_standardizer_data_us incorrect handling
    of directionals
    References #5695 for PostGIS 3.4.3

diff --git a/NEWS b/NEWS
index 98cc60b7b..f4328da1a 100644
--- a/NEWS
+++ b/NEWS
@@ -21,7 +21,8 @@ To take advantage of all SFCGAL featurs, SFCGAL 1.4.1+ is needed.
           (Paul Ramsey, Regina Obe)
  - #5687, Don't rely on search_path to determine postgis schema
            Fix for PG17 security change (Regina Obe)
-
+ - #5695, [address_standardizer_data_us] standardize_address
+          incorrect handling of directionals (Regina Obe)
 
 PostGIS 3.4.2
 2024/02/08
diff --git a/extensions/address_standardizer/expected/test-debug_standardize_address.out b/extensions/address_standardizer/expected/test-debug_standardize_address.out
index 70b2dfb40..3c3f004bb 100644
--- a/extensions/address_standardizer/expected/test-debug_standardize_address.out
+++ b/extensions/address_standardizer/expected/test-debug_standardize_address.out
@@ -31,7 +31,8 @@ SELECT '#5299b' AS ticket, jsonb_array_length(d->'rules') AS num_rules, jsonb_ar
 (1 row)
 
 SELECT '#5299bt' AS ticket, it->>'pos' AS pos, it->>'word' AS word,  it->>'token' AS token, it->>'stdword' AS stdword FROM jsonb(debug_standardize_address('us_lex',  'us_gaz', 'us_rules','50 Gold Piece Drive, Boston, MA, 02020')) AS d, jsonb_array_elements(d->'input_tokens') AS it
-WHERE it @> '{"pos": 2}'::jsonb;
+WHERE it @> '{"pos": 2}'::jsonb
+ORDER BY pos, stdword, word, token;
  ticket  | pos | word  | token | stdword 
 ---------+-----+-------+-------+---------
  #5299bt | 2   | PIECE | UNITH | PIECE
diff --git a/extensions/address_standardizer/expected/test-standardize_address_1.out b/extensions/address_standardizer/expected/test-standardize_address_1.out
index 5a12a1dcb..98fcb099b 100644
--- a/extensions/address_standardizer/expected/test-standardize_address_1.out
+++ b/extensions/address_standardizer/expected/test-standardize_address_1.out
@@ -46,3 +46,9 @@ SELECT '#5299b' AS ticket, * FROM standardize_address('us_lex',  'us_gaz', 'us_r
  #5299b |          | 50        |        |      |         | GOLD PIECE | DRIVE   |        |            |       | BOSTON | MASSACHUSETTS |         | 02020    |     | 
 (1 row)
 
+SELECT '#5695a' AS ticket, * FROM standardize_address('us_lex', 'us_gaz', 'us_rules', 'ONE E PIMA ST STE 999, TUCSON, AZ');
+ ticket | building | house_num | predir | qual | pretype | name | suftype | sufdir | ruralroute | extra |  city  |  state  | country | postcode | box |   unit    
+--------+----------+-----------+--------+------+---------+------+---------+--------+------------+-------+--------+---------+---------+----------+-----+-----------
+ #5695a |          | 1         | EAST   |      |         | PIMA | STREET  |        |            |       | TUCSON | ARIZONA | USA     |          |     | SUITE 999
+(1 row)
+
diff --git a/extensions/address_standardizer/test-debug_standardize_address.sql.in b/extensions/address_standardizer/test-debug_standardize_address.sql.in
index 8d3e77b5e..9840f2808 100644
--- a/extensions/address_standardizer/test-debug_standardize_address.sql.in
+++ b/extensions/address_standardizer/test-debug_standardize_address.sql.in
@@ -8,6 +8,7 @@ SELECT '#2978c' As ticket, jsonb_array_length(d->'rules') AS num_rules, jsonb_ar
 SELECT '#5299b' AS ticket, jsonb_array_length(d->'rules') AS num_rules, jsonb_array_length(d->'input_tokens') AS num_input_tokens, d->'rules'->0->'score' AS best_score FROM jsonb(debug_standardize_address('us_lex',  'us_gaz', 'us_rules','50 Gold Piece Drive, Boston, MA, 02020')) AS d;
 
 SELECT '#5299bt' AS ticket, it->>'pos' AS pos, it->>'word' AS word,  it->>'token' AS token, it->>'stdword' AS stdword FROM jsonb(debug_standardize_address('us_lex',  'us_gaz', 'us_rules','50 Gold Piece Drive, Boston, MA, 02020')) AS d, jsonb_array_elements(d->'input_tokens') AS it
-WHERE it @> '{"pos": 2}'::jsonb;
+WHERE it @> '{"pos": 2}'::jsonb
+ORDER BY pos, stdword, word, token;
 
 SELECT r->>'score' AS score,r->>'rule_string' AS rule, r->>'rule_stub_string' AS rule_stub  FROM jsonb(debug_standardize_address('us_lex','us_gaz','us_rules', '25 Prince Street, NC 09985')) AS d, jsonb_array_elements(d->'rules') AS r;
diff --git a/extensions/address_standardizer/test-standardize_address_1.sql.in b/extensions/address_standardizer/test-standardize_address_1.sql.in
index 9255d7356..f49694421 100644
--- a/extensions/address_standardizer/test-standardize_address_1.sql.in
+++ b/extensions/address_standardizer/test-standardize_address_1.sql.in
@@ -6,3 +6,4 @@ SELECT '#2978b' As ticket, * FROM standardize_address('us_lex','us_gaz','us_rule
 SELECT '#2978c' As ticket, * FROM standardize_address('us_lex','us_gaz','us_rules', '10-20 DORRANCE ST, PROVIDENCE, RI');
 SELECT '#5299a' AS ticket, * FROM standardize_address('us_lex',  'us_gaz', 'us_rules','1 Timepiece Point','Boston, MA, 02220');
 SELECT '#5299b' AS ticket, * FROM standardize_address('us_lex',  'us_gaz', 'us_rules','50 Gold Piece Drive','Boston, MA, 02020');
+SELECT '#5695a' AS ticket, * FROM standardize_address('us_lex', 'us_gaz', 'us_rules', 'ONE E PIMA ST STE 999, TUCSON, AZ');
\ No newline at end of file
diff --git a/extensions/address_standardizer/us_lex.sql b/extensions/address_standardizer/us_lex.sql
index 362ec58de..569efa3a9 100644
--- a/extensions/address_standardizer/us_lex.sql
+++ b/extensions/address_standardizer/us_lex.sql
@@ -2955,7 +2955,8 @@ WITH t(seq,word,stdword,token) AS ( VALUES (1, '#', '#', 16),
 (1, 'ZNJA', 'ZANJA', 1) )
 SELECT seq, word, stdword, token
 FROM t
-WHERE NOT EXISTS(SELECT 1 FROM us_lex AS t2 WHERE t2.seq = t.seq AND t2.word = t.word AND t2.stdword = t.stdword AND t2.token = t.token );
+WHERE NOT EXISTS(SELECT 1 FROM us_lex AS t2 WHERE t2.seq = t.seq AND t2.word = t.word AND t2.stdword = t.stdword AND t2.token = t.token )
+ORDER BY word, seq, token, stdword;
 
 -- needed set default back to original
 ALTER TABLE us_lex ALTER COLUMN is_custom SET DEFAULT true;

-----------------------------------------------------------------------

Summary of changes:
 NEWS                                                                | 3 ++-
 .../expected/test-debug_standardize_address.out                     | 3 ++-
 .../address_standardizer/expected/test-standardize_address_1.out    | 6 ++++++
 .../address_standardizer/test-debug_standardize_address.sql.in      | 3 ++-
 extensions/address_standardizer/test-standardize_address_1.sql.in   | 1 +
 extensions/address_standardizer/us_lex.sql                          | 3 ++-
 6 files changed, 15 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list