osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.61k stars 1.01k forks source link

objects rendered with wrong z order #17835

Closed quantenschaum closed 1 year ago

quantenschaum commented 1 year ago

Description

Seamarks and maybe other objects are drawn with wrong z order such that certain feature get hidden under other features. In the example below at https://osmand.net/map#16/53.4600/6.1658 some fairways (light green) and cable area (transparent red with dotted outline) are partially hidden below tidal flats (wetlands). The are only (slightly) visible because the wetland area is not fully opaque.

(Also when using an underlay with 'show polygons' disabled I would like the wetland polygons to be hidden.)

Screenshot_20230807-112053- Screenshot_20230807-112102-

How to reproduce

Look at https://osmand.net/map#16/53.4600/6.1658 in the boating profile (nautical map style)

Actual result

Features hidden below wetland area.

Expected result

Wetland area should be in the background.

Environment OsmAnd Version: 4.5.9 Android version: 13 Device model: Nokia X20

quantenschaum commented 1 year ago

It seems to be more difficult than I thought. The proposed simple change only works for render engine 2. With engine 1 and wetland order=4 or 5 the wetland polygon gets hidden behind the water polygon. :grimacing:

quantenschaum commented 1 year ago

render engine 1

wetland order=6 as it currently is, fairway hidden behind wetland (1) and cable area is hidden behide wetland (2) and seabed polygons are hidden behind wetland (X) engine1-wetland6

wetland order=5, it is better but cable area still behind wetland (3) engine1-wetland5

and when zoomed in, wetland polygon gets behind water polygon engine1-wetland5-zoomed

wetland order=4, the wetland is not display at all engine1-wetland4

render engine 2

wetland order=4, it works as expected engine2-wetland4

I use diffrent colors for wetland and fairways, but this does not affect the z ordering issue.

vshcherb commented 1 year ago

rendering engine v1 is out of support for such complex issues, so it's relevant to be honest. On iOS version v1 was never supported

xmd5a2 commented 1 year ago

Fixed Legacy engine: изображение

OpenGL engine: изображение

quantenschaum commented 1 year ago

Thanks! But I do not consider this as fixed.

The no anchor area is still partially behind the wetland.

zorder

But this is maybe just a minor issue, like this it is definitely better than before, great improvement. Thanks.

quantenschaum commented 1 year ago

Is the render.xml file actually updated when the app gets updated via the app store?

quantenschaum commented 1 year ago

The order attribute was removed for sand_waves. But what about the other sea bed related keys/values?

vshcherb commented 1 year ago

Commit is attached https://github.com/osmandapp/OsmAnd-resources/commit/8cc445ad9ed46bc3d6aa9126c926779ece7cb027

quantenschaum commented 1 year ago

I meant, in line https://github.com/osmandapp/OsmAnd-resources/blob/master/rendering_styles/nautical.render.xml#L491 the order attribute was removed, but shouldn't it also be removed from the surrounding lines?

DmitryAlexei commented 1 year ago

OsmAnd~ 4.6.0#710m, released: 2023-09-01 Latest Netherlands Frisia map downloaded 53.4582 6.1760

xmd5a2 commented 1 year ago

This is because of sorting by area. Nothing to do in rendering style.

quantenschaum commented 1 year ago

It does have to do with the rendering style, because the order is defined there. Transparent areas like seamark:type=cable_area should get a higher order. This won't hide anything since they are (semi)transparent and ensures that the auto order algorithm does not put them in the back. Danger areas already have a higher order assigned.

quantenschaum commented 1 year ago

Some seamark:areas are matched by area=true others by cycle=true, some by both. cable_area is only in the area section.

quantenschaum commented 1 year ago

Adding <case tag="seamark:type" value="cable_area" order="8"/> here would fix https://github.com/osmandapp/OsmAnd/issues/17835#issuecomment-1702874036

xmd5a2 commented 1 year ago

изображение