Last active
December 20, 2015 16:39
-
-
Save pnorman/6163345 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(SELECT | |
way, | |
CASE | |
WHEN place='country' THEN 1 | |
WHEN capital='yes' AND admin_level='2' THEN 10 | |
WHEN place='state' THEN 20 | |
WHEN place='city' THEN 21 | |
WHEN place='town' THEN 30 | |
ELSE NULL | |
END as prio, | |
place AS type, | |
name, | |
z_order, | |
CASE | |
WHEN population ~ E'^\\\\d+$' THEN population::integer | |
ELSE NULL | |
END AS population, | |
CASE | |
WHEN capital='yes' THEN admin_level | |
ELSE NULL | |
END AS admin_level | |
FROM planet_osm_point | |
WHERE | |
place IN ('country', 'state', 'city', 'town') | |
ORDER BY prio, population DESC NULLS LAST) | |
AS data |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment