X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/df6b4330669c15cb46edf3547be2588d9925ed4d..47714357cb800c69d006b3a868356bf80d09549a:/sql/tiger_import_start.sql diff --git a/sql/tiger_import_start.sql b/sql/tiger_import_start.sql index f6d65ae2..ef55e11c 100644 --- a/sql/tiger_import_start.sql +++ b/sql/tiger_import_start.sql @@ -10,7 +10,6 @@ DECLARE endnumber INTEGER; stepsize INTEGER; numberrange INTEGER; - rangestartnumber INTEGER; place_centroid GEOMETRY; out_partition INTEGER; out_parent_place_id BIGINT; @@ -27,9 +26,13 @@ BEGIN endnumber = in_startnumber; END IF; + IF startnumber < 0 THEN + RAISE WARNING 'Negative house number range (% to %) on %, %', startnumber, endnumber, in_street, in_isin; + RETURN 0; + END IF; + numberrange := endnumber - startnumber; - rangestartnumber := startnumber; - + IF (interpolationtype = 'odd' AND startnumber%2 = 0) OR (interpolationtype = 'even' AND startnumber%2 = 1) THEN startnumber := startnumber + 1; stepsize := 2;