<div dir="ltr">On the first zoom levels, I'm using the capital=* tag to select the country capitals, then sorting them with decreasing population.<div>It is a very small number of objects, that can easily be maintained.<br>
</div><div><br></div><div>The postgis query is here: <a href="https://github.com/cquest/osmfr-cartocss/blob/master/osmfr-cartocss.mml#L2070">https://github.com/cquest/osmfr-cartocss/blob/master/osmfr-cartocss.mml#L2070</a></div>
<div><br></div><div>If you remove the FR specific part, it looks like:</div><div><br>(SELECT way,<br> place,<br> name,<br> cast(regexp_replace('0' || population,'[^0-9]','','g') AS bigint) AS pop,<br>
coalesce(tags->'is_capital', (CASE WHEN coalesce(admin_level, capital)='2' THEN 'country' WHEN coalesce(admin_level, capital)='4' THEN 'state' ELSE NULL END)) AS is_capital<br>
FROM planet_osm_point<br> WHERE place IS NOT NULL<br> AND place IN ('city',<br> 'town')<br> AND (tags->'is_capital' IN ('country',<br> 'state')<br>
OR capital IN ('2',<br> '4')<br> OR (capital='yes'<br> AND admin_level IN ('2',<br> '4')))<br>
ORDER BY is_capital,<br> place,<br> pop DESC) AS placenames<br><br><br>As it is a bit a mess in the capital/is_capital tags so I had to use this long coalesce/case to deal with different tagging.<br>
As you can see it uses the place=* tag + is_capital/capital + population.</div><div class="gmail_extra">The result looks ok to me: <a href="http://tile.openstreetmap.fr/?zoom=5&lat=43.52781&lon=4.22487&layers=B0000000FFFFFFF">http://tile.openstreetmap.fr/?zoom=5&lat=43.52781&lon=4.22487&layers=B0000000FFFFFFF</a></div>
<div class="gmail_extra">At zoom 4, I just put a black dot for capitals.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Starting at zoom 6 there is an additional placenames layer to "fill" empty spaces. This avoid large areas with no names at all due to hard cuts in place=* tags. Many areas in the world have far less population than in Europe so the stylesheet has to adapt to this.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Compare:</div><div class="gmail_extra"><a href="http://osm.org">osm.org</a>: <a href="http://tile.openstreetmap.fr/?zoom=6&lat=23.87977&lon=-4.41038&layers=00B00000FFFFFFF">http://tile.openstreetmap.fr/?zoom=6&lat=23.87977&lon=-4.41038&layers=00B00000FFFFFFF</a></div>
<div class="gmail_extra">mapquest: <a href="http://tile.openstreetmap.fr/?zoom=6&lat=23.87977&lon=-4.41038&layers=000B0000FFFFFFF">http://tile.openstreetmap.fr/?zoom=6&lat=23.87977&lon=-4.41038&layers=000B0000FFFFFFF</a></div>
<div class="gmail_extra">osm-fr: <a href="http://tile.openstreetmap.fr/?zoom=6&lat=23.87977&lon=-4.41038&layers=B0000000FFFFFFF">http://tile.openstreetmap.fr/?zoom=6&lat=23.87977&lon=-4.41038&layers=B0000000FFFFFFF</a></div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-07-14 11:54 GMT+02:00 moltonel 3x Combo <span dir="ltr"><<a href="mailto:moltonel@gmail.com" target="_blank">moltonel@gmail.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="">On 14/07/2014, Martin Koppenhoefer <<a href="mailto:dieterdreist@gmail.com">dieterdreist@gmail.com</a>> wrote:<br>
>> Am 13/lug/2014 um 22:29 schrieb moltonel 3x Combo <<a href="mailto:moltonel@gmail.com">moltonel@gmail.com</a>>:<br>
>><br>
>> If osm is missing placename population figures,<br>
><br>
> deducting the importance from population alone doesn't hit it, and adding<br>
> ranks is generally disputed by many mappers (subjective), so here there is<br>
> no easy solution. IMHO there is not even a complicated solution, as it is<br>
> indeed subjective how to weight different aspects like economy, politics,<br>
> transportation, communication, religion, ...<br>
<br>
</div>Indeed it's a thorny subject, but delegating the decision to NE sounds<br>
like a cop-out. Whatever hard data NE used in it decision making<br>
(population, area, administrative status, connectedness...) should be<br>
available in OSM, and the subjective algorythm that takes this data to<br>
output a global place ranking could go either in the style or in a<br>
common extraction script.<br>
<br>
For that matter, how does the osmfr style do its place ranking ?<br>
<div class=""><div class="h5"><br>
_______________________________________________<br>
talk mailing list<br>
<a href="mailto:talk@openstreetmap.org">talk@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/talk" target="_blank">https://lists.openstreetmap.org/listinfo/talk</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Christian Quest - OpenStreetMap France</div>
</div></div>