Capital=* on federal subjects capitals

Hello fellow Russian mappers,

with the newest osm-carto release capitals are rendered with a two-ring dot. A good reason to clean the key capital=* up! Yesterday I started to clean up all cities which where tagged as capital=yes but are not the national capitals. I changed all cities (around 40) except in Russia. In Russia most capitals of federal subjects are tagged as capital=yes, admin_level=4 - currently 61 nodes (http://overpass-turbo.eu/s/iWB).

Do you agree to get them tagged to capital=4, admin_level=4? This would not change the rendering of the cities since the “placenames-medium” has the SQL-query capital = ‘4’ OR (capital = ‘yes’ AND admin_level = ‘4’).

The usage of admin_level to denote capital has further problems: https://lists.openstreetmap.org/pipermail/tagging/2016-October/030312.html

For guidance about the tagging look at:

Do not map for renderer!

No worries, I’m tagging according to best practices and documentation. This only started my interest.

Сферически правильно конечно через boundary=administrative + admin_level => role(admin_center)

Yes, the best and future-proof way is tagging capitals this way. But relation handling is difficult and at least for the national (admin_level=2) capitals the on-node approach should currently also be done.

All Russian capitals (up to admin_level=4 or even 6) are already tagged this way. Difficulty of relation handling is a problem of a specific software.

There are 721x capital=4 worldwide, this is in widespread use!

The only country besides Russia which had this setup nationwide is Australia and to a lesser point the island of Java.

Hello!

If everything at admin_level 4/6 (except Moscow) will be tagged this way, then there won’t be country-scale relations (relatively easy to process). It will be easier in the future (everything fits RAM).

I don’t think we need to tag “capitals” using multiple tagging approaches at once:

  1. using boundary=administrative + roles
  2. using capital tags

I’d pick only one way of doing it (no.1)

We may talk about it when the database reload is finished. The admin_centre role will then be available.

My request is no tagging for the renderer (the renderer supports the current russian approach) but the unification of the capital=yes tagging. Currently in order to find the national capitals without relations the keys capital and admin_level have to be queried. But the usage of admin_level together with capital=yes has semantic problems which I detailed on the tagging mailing list.

I have the impression that capital=* tagging seems not to interest many since relations are the future, so there might be no reason to keep the special Russian tagging?

It is not an evidence of “bestness” of this practice.

That’s right, but what is better on the Russian approach?

After some time has passed I try to summarize your positions:

  • Nobody seemed to like capital=* on your various lower-level capitals. The usage of relations was preferred.
  • There was no argument for capital=yes and against using capital=3 or =4 or =6 based on (technical) tagging discussion.

So I checked if your relations are complete: I used overpass to get all capital=yes which are not admin_level=2 (http://overpass-turbo.eu/s/j86) and checked in JOSM. All of them had role admin_centre.

So the best solutions seem to be to remove all capital=yes tags in from Russian capitals (except Moscow)

Всё-таки заметили иностранные друзья, что в русском государстве не всё ладно со «столицами» :slight_smile:

^^ Давно пора!

Congratulations!
The capital of Chelaybinsk Region is destroyed on the all mapnik zoom levels!
https://www.openstreetmap.org/node/27504156

Yes, because the developers of osm-carto style made a mistake with SQL when developing the rendering for capitals. It will be fixed soon in a few days.

The complexity of the current data lead to complex SQL. When implementing my proposals here the SQL can get simpler.

I created https://wiki.openstreetmap.org/wiki/Automated_edits/Jojo4u for the change.

Plan: I want to remove capital=yes from 73 nodes in Russia using overpass (http://overpass-turbo.eu/s/jfZ ) and JOSM - Moscow keeps capital=yes.

in reply to https://wiki.openstreetmap.org/wiki/Automated_edits/Jojo4u:

This is because capital=yes occurs 100 times in the world and overpass makes an index over it as rare tag automatically AFAIK. It doesn’t have an index on rare roles AFAIK.

Let’s add more indexes in overpass for roles, why not: https://github.com/drolbr/Overpass-API/issues/329

IMO not many would query capital of the country but capital=level:6 or capital=level:4 are more frequent questions.

If capital=level:2, capital=level:4 or capital=level:6 is better - tag it this way, why not.

The long runtime was because of bbox. The following query is lightning-fast and gives all country border relations with it’s admin_centre in OSM-XML.


[out:xml];
(
  relation["admin_level"="2"]["type"="boundary"]["boundary"="administrative"];
  node(r:"admin_centre");
);
out meta;

Here a working overpass query to get all russian admin_level=4 capitals using relations. It runs for around 30 seconds.


{{geocodeArea:Russia}}->.searchArea;
relation["admin_level"="4"]["type"="boundary"]["boundary"="administrative"];
node(r:"admin_centre");
node._(area.searchArea);
out meta;