-
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
order placement of city/towns names #337
Conversation
use population tag to place city/town names of major cities/towns first.
Null population is sorting ahead of all population values, which doesn't seem right. Either Also, should it be more conservative? "100 (Census 2000)" casts to 1002000. 👍 though: This should fix Bellevue blocking Seattle at z 6-9. |
The concat is already there: '0' || population = concat('0',population) "population=100 (Census 2000)" is an error, and if it makes this error visible it has much more chances to be fixed ;) I've been using this population ordering on the OSM-FR tiles and Seattle is there: http://tile.openstreetmap.fr/?zoom=8&lat=47.61191&lon=-122.19924&layers=B0000000FFFFFF |
I doubt that |
The function was added in 9.1. |
I didn't know || and concat where different. Concat is now used in place of || |
Does anyone have any comments on this creating a minimum required version for postgresql? Until now I think the stylesheets have worked on 8.4 and 9.0, right? |
Well we're running 9.1 in production on the OSM servers. |
8.4+1.5 is substantially slower than 9.1+2.0 on the osm2pgsql side. I'm not the typical developer, but I do my testing on 9.3+2.1. That being said, why not |
I implemented this for the german style. Our population-select returns only an integer, if the population value is a real integer: CASE WHEN tags->'population' ~ '^[0-9]+$'
THEN (tags->'population')::integer
ELSE 0 END as "population", |
I'm working on |
Fixes #1083 (added to description). |
Just for future reference: |
Closing. Would need rewriting against YAML, and the SQL chosen isn't the best method. |
Could you expand on what is wrong with this method? I would like to fix the SQL, so reopening. |
The SQL done for layernotnull is better. But unless @cquest wants to rebase this we need to close this PR and open a new one. |
The problem is more complex than the population alone - Seattle is also tagged as a city with importance=national, while Bellevue is just a town. I guess admin_centre can also be a hint for rendering (#1391). So we have 4 factors of visibility - which should we use and in what order? :
|
Bellevue was place=city when this was originally written. This is looking at population merely as a tiebreaker when the place tags are equal. |
But my question is still valid: what should we render if the capital is less populated than a place with conflicting name label? Do we want to use "importance" tag (long time draft)? There can be many cases involving one or more of these tags, so it would be good to know which tags/features labels we want to show on general map when they are clashing. |
No, absolutely not. That's a completely subjective tag and a hugely bad proposal for tagging. |
So we're left with "only" 3 more or less objective hinting tags. =} I guess I would treat admin_* tags as the most important hint, then I would check place type (this one is less objective than the rest) and population as the last resort. However that's only my intuition that it would work the best. |
The usual approach would be to calculate a score based on the various properties that are to be considered. For example you could use the population as score and multiply it with a factor of for example three in case it is a national capital. This would mean a larger city is only rendered with preference if its population is more than three times that of the capital. |
2015-03-24 13:32 GMT+01:00 Andy Allan [email protected]:
while I agree, it should be noted that every ranking of cities will be |
Of course. But the way it works is that the consumers of the data (e.g. openstreetmap-carto) each have their own subjective ranking, based on whatever objective information we choose to use in OSM and/or elsewhere. But that's where the subjective decisions get made, not by the mappers (otherwise chaos and endless edit wars ensue). Ranking cities by importance is like choosing what roads show up on which zoom levels - it's a subjective issue, for the cartographers to juggle. Each map will choose differently. Thankfully we don't have a "zoom" tag in OSM (e.g. "highway=motorway;zoom=6") and we shouldn't have an "importance" tag either. |
use population tag to place city/town names of major cities/towns first.
Fixes #1083