Ensure nameless POI have biggest rank
This commit is contained in:
parent
071201fe52
commit
eb847606bb
@ -4,11 +4,12 @@
|
||||
|
||||
CREATE OR REPLACE FUNCTION layer_poi(bbox geometry, zoom_level integer, pixel_width numeric)
|
||||
RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, class text, subclass text, "rank" int) AS $$
|
||||
SELECT osm_id, geometry, name, NULLIF(name_en, ''), poi_class(subclass) AS class, subclass,
|
||||
SELECT osm_id, geometry, NULLIF(name, ''), NULLIF(name_en, ''), poi_class(subclass) AS class, subclass,
|
||||
row_number() OVER (
|
||||
PARTITION BY LabelGrid(geometry, 100 * pixel_width)
|
||||
ORDER BY poi_class_rank(poi_class(subclass)) ASC,
|
||||
length(name) DESC NULLS LAST
|
||||
ORDER BY
|
||||
CASE WHEN name = '' THEN 1 ELSE 0 END ASC,
|
||||
poi_class_rank(poi_class(subclass)) ASC
|
||||
)::int AS "rank"
|
||||
FROM (
|
||||
-- etldoc: osm_poi_point -> layer_poi:z14
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user