gravitystorm / openstreetmap-carto

A general-purpose OpenStreetMap mapnik style, in CartoCSS
Other
1.53k stars 819 forks source link

Skipping parts of bigger objects on lower zoom levels #2896

Closed kocio-pl closed 5 years ago

kocio-pl commented 6 years ago

Is it possible to skip rendering parts of bigger objects on some zoom levels?

I meant well mapped cases like:

I doubt in any special tagging, it would be good if the software would be able to make "hard" priorities for some areas, but maybe using relations would be the most reasonable way to recognize parts in general. Would it work within our current toolbox?

kocio-pl commented 6 years ago

Two partial solutions to make some areas more visible:

  1. We could hide all the small parkings (=when they don't show the letter). Testing shows that with gray color they become unobtrusive, but they still take some space on areas like hospital, so such area is less visible than it could be.

  2. Wikimedia maps use interesting approach: if there are some buildings on the colored area, they are colored the same, but darker up to z17 (on z.max=z18 they look like all the other buildings).

Examples:

I haven't yet look how it's done and if it's possible for us to do the same. The other problem is that we use dark violet for other features, so buildings on industrial area would look to close to them. However for societal amenities, commercial and garages this would help.

matthijsmelissen commented 6 years ago

if there are some buildings on the colored area, they are colored the same, but darker up to z17

This is the same approach as Google's.

The problem is particularly important for landuse=retail: the retail color is generally not visible, because retail areas in Europe tend to be very high densitiy areas. Example: https://www.openstreetmap.org/#map=16/52.0774/4.3125

kocio-pl commented 6 years ago

I think it's also important for schools and hospitals, because we use very pale color there.

I guess it's this code:

https://github.com/kartotherian/brighmed/blob/master/building.mss

jeisenbe commented 6 years ago

"The problem is particularly important for landuse=retail: the retail color is generally not visible, because retail areas in Europe tend to be very high densitiy areas."

I agree with this! It's also true in mid-sized towns and villages here in Asia, where retail areas often have 90% building coverage of the non-street surface area.

As a start, rendering retail buildings as a darker version of the retail landuse would be a nice test for this concept, especially since retail areas are the most important destinations for visitors and new residents. (The OsmAnd app already offers this as an option with their vector-based maps, and it works well)

Tomasz-W commented 5 years ago

@kocio-pl I think https://github.com/gravitystorm/openstreetmap-carto/pull/3467 resolved this issue.

kocio-pl commented 5 years ago

Unfortunately there's no easy way to tell "now hide the grass and show the hospital area", even on z13.

jeisenbe commented 5 years ago

I don't believe there is a reasonable way to solve this issue with the current tools, so I'm closing this issue.

However, if I'm incorrect I would be happy to reopen the issue.

Is there a way to avoid rendering footways in a cemetery, shops in a marketplace, or grass in a hospital or university at a certain zoom level (but still render paths, shops and grass which are not inside of these areas), with performance good enough for this style?

kocio-pl commented 5 years ago

What about SQL/PostGIS functions to check conditions like below (using pseudocode)? I imagine it might be quite fast:

SELECT grass WHEN not INSIDE (hospital_area OR school_area)