osmandapp / OsmAnd

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

Render labels of boundary=administrative on lines #16531

Open abdullahO2 opened 1 year ago

abdullahO2 commented 1 year ago

🚀 feature request

Ways and relations tagged as "boundary=administrative" and "leisure=nature_reserve" in OpenStreetMap are render them as lines and displays their labels below/above them, Is it possible to make their labels appear on the lines that represent them? Also, is it possible to cancel the NR icon from "leisure=nature_reserve" or enable it to be hidden from the options? (because it confuses how the elements appear inside the nature reserve)

Description

Ex: https://www.openstreetmap.org/#map=13/27.6132/44.8788 OsmAnd: image

openstreetmap-carto image

Describe the solution you'd like

make labels appear on the lines of "boundary=administrative" and "leisure=nature_reserve"

ivanPyrohivskyi commented 1 year ago

Perhaps related to https://github.com/osmandapp/OsmAnd-Issues/issues/1587

xmd5a2 commented 10 months ago

Dev notes: leisure=nature_reserve Rendering engine is not capable of displaying 2 texts (one at center and one on path) from single main tag. So I tried to add new tag by using entity_convert (see https://github.com/osmandapp/OsmAnd-resources/commit/aa0dfc2ef3b1c472aaeb739c65e005c6d0032a08) and added textOnPath="true". But this works differently in engine v1 and OpenGL.

engine v1 OpenGL
Screenshot_2023-11-23_11-50-38 Screenshot_2023-11-23_11-52-10

Note that textOnPath is not used in OpenGL at all. It is used in engine v1 but only on object mapped as line (nature reserve at bottom)

Place to test (synthetic_test_rendering): 45.73699, 36.550488

obf data for nat_reserve_relation (relation):

leisure=nature_reserve
name=nat_reserve_relation
original_id=-4901726689637263
osmand_id=-627421016273569600
osmand_nature_reserve=line

obf data for nature_reserve (way):

leisure=nature_reserve
name=nature reserve
original_id=169699
osmand_id=21721595
osmand_nature_reserve=line
xmd5a2 commented 9 months ago

I propose don't add new tag osmand_nature_reserve=line while treating it as line and to implement textOnPath support for areas. This solves at least issue with nature_reserve.

xmd5a2 commented 8 months ago

Dev notes: Adding boundary=administrative to obf data doesn't adds name tags (commit). But same code for boundary=aboriginal_lands works as expected (name is added to data). Looks like some java code issue.

Dima-1 commented 5 months ago

Dev notes: Adding boundary=administrative to obf data doesn't adds name tags (commit). But same code for boundary=aboriginal_lands works as expected (name is added to data). Looks like some java code issue.

boundary=administrative with present admin_level tag are processed differently from other multipolygon boundaries by design. Therefore another solution is needed.

vshcherb commented 5 months ago

https://www.openstreetmap.org/way/1071799717

vshcherb commented 5 months ago

To do:

MarioSwitch commented 5 months ago

I was about to create a Feature Request issue for this exact thing, thanks someone already did it 👍