From f295882286878346dc940438fe46638155406d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ko=C4=87?= Date: Thu, 1 Mar 2018 23:06:04 +0100 Subject: [PATCH] numeric height fix --- project.mml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/project.mml b/project.mml index b28ca603ae..7f7e33151d 100644 --- a/project.mml +++ b/project.mml @@ -1455,7 +1455,14 @@ Layer: religion, tags->'denomination' as denomination, tags->'generator:source' as "generator:source", - tags->'height' as height, + CASE + WHEN man_made IN ('mast', 'tower') THEN + CASE + WHEN tags->'height' ~ '^-?\d{1,4}(\.\d+)?$' THEN (tags->'height')::NUMERIC + ELSE NULL + END + ELSE NULL + END AS height, tags->'power_source' as power_source, tags->'icao' as icao, tags->'iata' as iata, @@ -1562,7 +1569,14 @@ Layer: religion, tags->'denomination' as denomination, tags->'generator:source' as "generator:source", - tags->'height' as height, + CASE + WHEN man_made IN ('mast', 'tower') THEN + CASE + WHEN tags->'height' ~ '^-?\d{1,4}(\.\d+)?$' THEN (tags->'height')::NUMERIC + ELSE NULL + END + ELSE NULL + END AS height, tags->'power_source' as power_source, tags->'icao' as icao, tags->'iata' as iata,