From fe61912c097073b10b6c38de0c74775112ab5ae8 Mon Sep 17 00:00:00 2001 From: Peter Hanecak <115141505+phanecak-maptiler@users.noreply.github.com> Date: Mon, 29 Jan 2024 07:51:24 +0100 Subject: [PATCH] Make sure areas above 160000000 get rank 2 or 1 (#1623) This is a follow-up on https://github.com/openmaptiles/openmaptiles/pull/1604 . Seminole Nation is shown in the screenshot there with rank 3 while based on area it should be 1. This PR fixes `area_rank()` function to handle areas greater than 160000000, e.g. this fixes #1622 . Co-authored-by: Paul Norman --- layers/place/area_rank.sql | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/layers/place/area_rank.sql b/layers/place/area_rank.sql index 7ef3c7af..d9af8e4f 100644 --- a/layers/place/area_rank.sql +++ b/layers/place/area_rank.sql @@ -1,12 +1,12 @@ CREATE OR REPLACE FUNCTION area_rank(area real) RETURNS int AS $$ SELECT CASE - WHEN area < 10000000 THEN 6 - WHEN area BETWEEN 1000000 AND 15000000 THEN 5 - WHEN area BETWEEN 15000000 AND 40000000 THEN 4 - WHEN area > 40000000 THEN 3 - WHEN area > 160000000 THEN 2 WHEN area > 640000000 THEN 1 + WHEN area > 160000000 THEN 2 + WHEN area > 40000000 THEN 3 + WHEN area > 15000000 THEN 4 + WHEN area > 10000000 THEN 5 + WHEN area > 0 THEN 6 ELSE 7 END; $$ LANGUAGE SQL IMMUTABLE