[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-572-g58b3f2340
git at osgeo.org
git at osgeo.org
Fri Jan 27 16:37:19 PST 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, master has been updated
via 58b3f2340f3bcf93a6e63e1f79aaf3384200af7f (commit)
from 1f14839d6f6be7809a186a586ed4c2ccde5525e1 (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 58b3f2340f3bcf93a6e63e1f79aaf3384200af7f
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.4.0
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:
extras/tiger_geocoder/geocode/reverse_geocode.sql | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list