[postgis-tickets] r15132 - fix numeric in interpolate_from_address

Regina Obe lr at pcorp.us
Fri Sep 23 21:11:17 PDT 2016


Author: robe
Date: 2016-09-23 21:11:16 -0700 (Fri, 23 Sep 2016)
New Revision: 15132

Modified:
   trunk/extras/tiger_geocoder/geocode/interpolate_from_address.sql
Log:
fix numeric in interpolate_from_address
References #3640 for PostGIS 2.3.0 (trunk)

Modified: trunk/extras/tiger_geocoder/geocode/interpolate_from_address.sql
===================================================================
--- trunk/extras/tiger_geocoder/geocode/interpolate_from_address.sql	2016-09-23 17:38:30 UTC (rev 15131)
+++ trunk/extras/tiger_geocoder/geocode/interpolate_from_address.sql	2016-09-24 04:11:16 UTC (rev 15132)
@@ -25,8 +25,8 @@
         RETURN NULL;
     END IF;
 
-	var_addr1 := to_number(in_addr1, '999999');
-	var_addr2 := to_number(in_addr2, '999999');
+	var_addr1 := to_number(COALESCE(NULLIF(trim(in_addr1),''),'0'), '999999');
+	var_addr2 := to_number(COALESCE(NULLIF(trim(in_addr2),''),'0'), '999999');
 
     IF geometrytype(in_road) = 'LINESTRING' THEN
       road := ST_Transform(in_road, utmzone(ST_StartPoint(in_road)) );



More information about the postgis-tickets mailing list