Fix housenumber_display.sql - cast to bigint instead of integer. (#1637)

Fixes `housenumber_display.sql` function and further improves https://github.com/openmaptiles/openmaptiles/pull/1632

Parsing text values that contain `;`, the string was split into array of values which were casted to `integer`. However, that fails for housenumber that exceed Postgres `int` range `-2147483648` to `+2147483647`.
There are such housenumber, e.g.: https://www.openstreetmap.org/way/1091331906#map=19/-3.82721/-38.59269
This commit is contained in:
Adam Laža 2024-02-26 13:04:00 +01:00 committed by GitHub
parent 2f170fbbd8
commit a65495f264
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,6 +15,6 @@ RETURNS text AS $$
WHEN raw_housenumber ~ '[^0-9;]' THEN display_housenumber_nonnumeric(raw_housenumber) WHEN raw_housenumber ~ '[^0-9;]' THEN display_housenumber_nonnumeric(raw_housenumber)
ELSE ELSE
(SELECT min(value)::text || '' || max(value)::text (SELECT min(value)::text || '' || max(value)::text
FROM unnest(array_remove(string_to_array(raw_housenumber, ';'), '')::int[]) AS value) FROM unnest(array_remove(string_to_array(raw_housenumber, ';'), '')::bigint[]) AS value)
END END
$$ LANGUAGE SQL IMMUTABLE; $$ LANGUAGE SQL IMMUTABLE;