X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/291fdd1894fd44bd117259956ac5299cb0d7babd..72c0898409d5c496538287cea3c71edc3c170e62:/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;