Fix issues with rank boundaries in country and state

pull/24/head
lukasmartinelli 2016-11-03 10:57:56 +01:00
rodzic dd8683154c
commit 1b4b6be3fe
2 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -22,5 +22,10 @@ UPDATE osm_country_point AS osm
SET "rank" = 6
WHERE "rank" IS NULL;
-- TODO: This shouldn't be necessary? The rank function makes something wrong...
UPDATE osm_country_point AS osm
SET "rank" = 1
WHERE "rank" = 0;
ALTER TABLE osm_country_point ADD CONSTRAINT osm_country_point_rank_constraint CHECK("rank" BETWEEN 1 AND 6);
CREATE INDEX IF NOT EXISTS osm_country_point_rank_idx ON osm_country_point("rank");
CREATE INDEX IF NOT EXISTS osm_country_point_rank_idx ON osm_country_point("rank");

Wyświetl plik

@ -16,6 +16,11 @@ SET "rank" = LEAST(6, CEILING((scalerank + labelrank + datarank)/3.0))
FROM important_state_point AS ne
WHERE osm.osm_id = ne.osm_id;
-- TODO: This shouldn't be necessary? The rank function makes something wrong...
UPDATE osm_state_point AS osm
SET "rank" = 1
WHERE "rank" = 0;
DELETE FROM osm_state_point WHERE "rank" IS NULL;
ALTER TABLE osm_state_point ADD CONSTRAINT osm_state_point_rank_constraint CHECK("rank" BETWEEN 1 AND 6);