[postgis-tickets] [SCM] PostGIS branch stable-3.3 updated. 3.3.2-33-gf31f63bb0

git at osgeo.org git at osgeo.org
Mon Mar 13 00:00:54 PDT 2023


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.3 has been updated
       via  f31f63bb0fff93e8b893fcc314878c1dcd7bac64 (commit)
      from  66ec3e9e6eba0da34c1204b63c64f2d3e7f99f70 (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 f31f63bb0fff93e8b893fcc314878c1dcd7bac64
Author: Regina Obe <lr at pcorp.us>
Date:   Fri Jan 27 19:35:11 2023 -0500

    Prefer street segments that have a street name
    and address range over those missing either piece,
    as long as they are within 70 meters of reference point
    References #5331 for PostGIS 3.3.3

diff --git a/NEWS b/NEWS
index 480348bda..edc1543d3 100644
--- a/NEWS
+++ b/NEWS
@@ -20,6 +20,8 @@ YYYY/MM/DD
   - #5344, Include topology id sequence state in dumps (Sandro Santilli)
   - #5288, ST_LineCrossingDirection multi-cross error (Paul Ramsey)
   - #5347, _ST_BestSRID crashes on ARM with infinite geometries (Regina Obe)
+  - #5331, [postgis_tiger_geocoder] reverse_geocode, prefer addressable ranges
+          (Regina Obe, Locance)
 
 
 PostGIS 3.3.2
diff --git a/extras/tiger_geocoder/geocode/reverse_geocode.sql b/extras/tiger_geocoder/geocode/reverse_geocode.sql
index 5a103de1a..eca1364b8 100644
--- a/extras/tiger_geocoder/geocode/reverse_geocode.sql
+++ b/extras/tiger_geocoder/geocode/reverse_geocode.sql
@@ -1,6 +1,6 @@
  /***
  *
- * Copyright (C) 2011-2017 Regina Obe and Leo Hsu (Paragon Corporation)
+ * Copyright (C) 2011-2023 Regina Obe and Leo Hsu (Paragon Corporation)
  **/
 -- This function given a point try to determine the approximate street address (norm_addy form)
 -- and array of cross streets, as well as interpolated points along the streets
@@ -136,7 +136,11 @@ BEGIN
 
 	    -- for numbered street/road use var_rating_highway to determine whether to prefer numbered or not (0 no pref, 1 prefer numbered, 2 prefer named)
 		var_stmt := var_stmt || ' CASE $1 WHEN 0 THEN 0  WHEN 1 THEN CASE WHEN foo.fullname ~ ''[0-9]+'' THEN 0 ELSE 1 END ELSE CASE WHEN foo.fullname > '''' AND NOT (foo.fullname ~ ''[0-9]+'') THEN 0 ELSE 1 END END ';
-		var_stmt := var_stmt || ',  foo.fullname ASC NULLS LAST, dist LIMIT 50) As f ORDER BY f.dist, CASE WHEN fullname > '''' THEN 0 ELSE 1 END '; --don't bother penalizing for distance if less than 20 meters
+
+		-- penalize ranges with no street name or no address range if there are others with addresses within 70 meters
+		var_stmt := var_stmt || ',  foo.fullname ASC NULLS LAST, dist LIMIT 50) As f
+		ORDER BY CASE WHEN f.dist < 70 THEN 0 ELSE f.dist END, CASE WHEN fullname > '''' THEN 0 ELSE 1 END,
+			CASE WHEN f.fromhn IS NOT NULL THEN 0 ELSE 1 END, f.dist ';
 
 	IF var_debug = true THEN
 	    RAISE NOTICE 'Statement 1: %', replace(var_stmt, '$1', var_rating_highway::text);

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

Summary of changes:
 NEWS                                              | 2 ++
 extras/tiger_geocoder/geocode/reverse_geocode.sql | 8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list