Open pnorman opened 10 months ago
The icesheet polygons are large because they are generated from the coastline polygons - which are dynamically split based on coastline complexity. Hence low complexity coastline polygons with lots of complex ice free area polygons inside (i.e. Antarctic interior) result in large icesheet polygons with many inner rings. It is not unreasonable that this might lead to rendering being slow.
This is solvable - but it requires some work in development and testing - which is difficult without a budget.
Since we meanwhile have the coastline polygons in the database we could also think about rendering the icesheets on the fly based on either ST_Difference()
between (tile clipped) coastline polygons and the ice free areas or by simply drawing the ice free areas in land color over the glaciers (you would then still need to do some geometry operations for proper outline rendering though). Geometry operations would slow down rendering at the low zoom levels - but it would probably not be significant at the high zoom levels since geometric complexity per tile is low. Back when we introduced the Antarctic ice sheet rendering you were strictly against special casing the Antarctic in the style but i am meanwhile quite sure that this would be the better option because it would provide real time updates on the icesheet and would avoid the confusing mismatch between the delayed icesheet updates and the ice free area fills (mostly natural=bare_rock
).
See also #4827.
While diagnosing a renderd/Mapnik problem, I was rendering vertical stripes of z17 tiles, starting at 0,0 and going to 0,131071. This revealed a problem where every few minutes the time per tile would go from 800ms to about 3100ms, repeatedly. A bit of investigation revealed that this was happening when it rendered tiles in the southwest corner of the map, and when rendering in just the 16th of the map in the corner, it was much worse.
Performance was worse in this tile than in Europe, an area with significantly more data.
The time spent was spent waiting for CPU in Mapnik, not query performance. Knowing the data and layers, I believe this time is being spent in the
icesheet-poly
layer, as it is the only layer that would cover much of Antarctica while not being present elsewhere.Looking at the backtraces, most of the threads are in
agg::vcgen_stroke
or anothervcgen
function.The styling here is very simple
https://github.com/gravitystorm/openstreetmap-carto/blob/445e553/style/shapefiles.mss#L19-L23
A few thoughts
polygon-clip
is the only option I can think of that would impact performance, but I'm skeptical it would do anything here. The time spent is during rendering, not during clipping.