der-stefan / OpenTopoMap

A topographic map from OpenStreetMap and SRTM data
https://opentopomap.org
Other
459 stars 118 forks source link

Problems with rendering of capital names #204

Open hottrails opened 5 years ago

hottrails commented 5 years ago

Problem 1: Some capital names are not rendered on every zoom level. For example New Delhi is shown up to level 4, not shown in levels 5 to 7 and appears again on zoom level 8. Same appears is with Dhaka, Pyonjang and Beijing.

Solution: duplicate text-cities-lowzoom layer. The first layer (that I suggest to name text-capital-lowzoom) should deal with state capitals (capital='yes' and admin_level='2') and needs to be placed before text-cities-lowzoom layer. The stylefile text-capital-lowzoom.xml for the capital layer results from those styles from text-cities-lowzoom.xml that deals with state capitals. These have to be deleted from the remaining text-cities-lowzoom.xml style file.

To speed up processing the filter (capital='yes' and admin_level='2') can be directly included in the query for text-capital-lowzoom and removed from the style file. Also a filter "WHERE capital is null or (capital <> 'yes')" can be added to the query for text-cities-lowzoom so "and not ([capital] = 'yes')" can be removed from the filter in the text-cities-lowzoom.xml style file.

Problem 2: Cities tagged with capital = 'yes' and admin_level not equal '2' are not shown at all due to filter set in text-cities-lowzoom.xml style file.

These are not many (my query produced five), but as Beirut and Manila are affected it may be worth fixing it.

Fixing that in the style filter seems quite complicated. If layer text-cities-lowzoom is changed as described above for problem 1 this can simply be done by changing the query where clause from "WHERE capital is null or (capital <> 'yes')" to "WHERE capital is null or (capital <> 'yes') or (capital = 'yes' and admin_level <> '2')"

The result of the changes described above can be seen on my OTM adaption at https://www.singletrails.com/maptest/maptest.html (may be down sometimes as server isn't in productive mode yet)

Juergeen commented 3 years ago

Closed #286 "Paris (France) invisible on zoom levels 6 to 10" as a duplicate of this.