Tweak place ranks

This commit is contained in:
lukasmartinelli
2016-10-29 14:29:41 +02:00
parent 3f9f59dfe1
commit 52e133e126
7 changed files with 18 additions and 21 deletions

View File

@@ -1,6 +1,6 @@
CREATE OR REPLACE FUNCTION layer_country(bbox geometry, zoom_level int)
RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, "rank" int) AS $$
SELECT osm_id, geometry, name, name_en, "rank" FROM osm_country_point
WHERE geometry && bbox AND "rank" <= (zoom_level + 2)
WHERE geometry && bbox AND "rank" <= zoom_level
ORDER BY "rank" ASC, length(name) ASC;
$$ LANGUAGE SQL IMMUTABLE;