-
Notifications
You must be signed in to change notification settings - Fork 819
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render place names from both points and polygons #2816
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1232,11 +1232,30 @@ Layer: | |
WHEN (tags->'population' ~ '^[0-9]{1,8}$') THEN (tags->'population')::INTEGER ELSE 0 | ||
END as population, | ||
round(ascii(md5(osm_id::text)) / 55) AS dir -- base direction factor on geometry to be consistent across metatiles | ||
FROM planet_osm_point | ||
WHERE place IN ('city', 'town', 'village', 'hamlet') | ||
AND name IS NOT NULL | ||
AND tags @> 'capital=>yes' | ||
ORDER BY population DESC | ||
FROM | ||
(SELECT | ||
way, | ||
osm_id, | ||
name, | ||
place, | ||
tags, | ||
NULL AS way_area | ||
FROM planet_osm_point | ||
UNION ALL | ||
SELECT | ||
way, | ||
osm_id, | ||
name, | ||
place, | ||
tags, | ||
way_area | ||
FROM planet_osm_polygon | ||
) places | ||
WHERE place IN ('city', 'town', 'village', 'hamlet') | ||
AND name IS NOT NULL | ||
AND tags @> 'capital=>yes' | ||
ORDER BY population DESC, | ||
way_area DESC NULLS LAST | ||
) AS capital_names | ||
properties: | ||
minzoom: 3 | ||
|
@@ -1296,7 +1315,25 @@ Layer: | |
ELSE 1 | ||
END) | ||
) AS score | ||
FROM planet_osm_point | ||
FROM | ||
(SELECT | ||
osm_id, | ||
way, | ||
place, | ||
name, | ||
tags, | ||
NULL AS way_area | ||
FROM planet_osm_point | ||
UNION ALL | ||
SELECT | ||
osm_id, | ||
way, | ||
place, | ||
name, | ||
tags, | ||
way_area | ||
FROM planet_osm_polygon | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
) places | ||
WHERE place IN ('city', 'town') | ||
AND name IS NOT NULL | ||
AND NOT (tags @> 'capital=>yes') | ||
|
@@ -1316,7 +1353,23 @@ Layer: | |
way, | ||
place, | ||
name | ||
FROM planet_osm_point | ||
FROM | ||
(SELECT | ||
way, | ||
place, | ||
name, | ||
tags, | ||
NULL AS way_area | ||
FROM planet_osm_point | ||
UNION ALL | ||
SELECT | ||
way, | ||
place, | ||
name, | ||
tags, | ||
NULL AS way_area | ||
FROM planet_osm_polygon | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice idea. One thing I noted. Should: from planet_osm_point p not be: from planet_osm_point b ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. sure, fixed :) [a for area, p for point] |
||
) AS places | ||
WHERE place IN ('village', 'hamlet') | ||
AND name IS NOT NULL | ||
AND NOT tags @> 'capital=>yes' | ||
|
@@ -1330,7 +1383,10 @@ Layer: | |
WHEN place = 'locality' THEN 7 | ||
WHEN place = 'isolated_dwelling' THEN 8 | ||
WHEN place = 'farm' THEN 9 | ||
END ASC, length(name) DESC, name | ||
END ASC, | ||
way_area DESC NULLS LAST, | ||
length(name) DESC, | ||
name | ||
) AS placenames_small | ||
properties: | ||
minzoom: 12 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.