osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.65k stars 1.02k forks source link

display depth of submerged rocks in nautical style #18092

Open quantenschaum opened 1 year ago

quantenschaum commented 1 year ago

🚀 feature request

Description

When a seamark:type=rock has an attached depth tag, the depth value should be displayed next to the rock symbol since this information is very important.

Additionally, the symbols for rocks should be made smaller, the dotted circle and the colored background should be removed.

Describe the solution you'd like

see above

Describe alternatives you've considered

no alternative

miramikes commented 1 year ago

+1

14975

stones

quantenschaum commented 1 year ago

Exactly. Here a direct comparison of

how it currently looks in OsmAnd
Screenshot_20230905-080620

and how it should look like (and used to look on paper charts), a tiny cross without background is sufficient
Screenshot_20230905-080627

The rock symbols are far too big and clutter the entire chart. To be able to judge if the rock is dangerous or not to a particular vessel, the depth value must be displayed.

Note: The use of a map magnifier does not affect the size of the rock symbols, it effectively only changes the threshold (zoom level) when rocks get displayed.

quantenschaum commented 1 year ago

I tried to find the parts in the code that are responsible for rendering the rock. I did not find them. Could someone point me to the right spot, please?

miramikes commented 1 year ago

I tried to find the parts in the code that are responsible for rendering the rock. I did not find them. Could someone point me to the right spot, please?

Not sure if this what you are asking ... Part of marine.render.xml

  <!-- indication of dangerous navigational obstructions to start already at low zoom levels 13 -->
  <!-- <case minzoom="13" tag="seamark:type" value="rock" icon="seamark_rock_submerged" shield="seamark_rock_shield" iconOrder="150" iconVisibleSize="20" icon_shift_py="-1"> -->
  <case minzoom="13" tag="seamark:type" value="rock" icon="seamark_rock_submerged" shield="seamark_rock_shield" iconVisibleSize="15">
    <case additional="seamark:rock:water_level=covers" icon="seamark_rock_covers"/>
    <case additional="seamark:rock:water_level=awash" icon="seamark_rock_awash"/>
  </case>

Maybe also this might be useful: https://github.com/osmandapp/OsmAnd-resources/blob/a3c976f67abe1c878efb133ef7f7bec567e8997a/icons/tools/Generating_OSMAND_map_icons.txt

quantenschaum commented 1 year ago

Yes, these lines I did find. But how can I change the size of the icon?

quantenschaum commented 1 year ago

setting shield="null" removes the circle background. iconVisibleSize only sets the effective size, such that only one overlapping icons is displayed.

quantenschaum commented 1 year ago

w/o the shield it already looks less cluttered

Screenshot_20230905-223948 Screenshot_20230905-223943

miramikes commented 1 year ago

I found this commit "Increase size of barrier=debris icon": https://github.com/osmandapp/OsmAnd-resources/commit/1b9b7a684bff03a5eb043fb83fc9aa3dbf86c28c Is it really necessary to change svg icon to change it's rendered size?

quantenschaum commented 1 year ago

Unfortunately yes AFAIK. There seems to be no setting in the render.xml that allows changing the icon size.

quantenschaum commented 1 year ago

The shield (circle around the rock symbol) is used in paper charts to mark rocks dangerous to surface navigation or outside the corresponding depth area.

To be able to add the shield dynamically, there must be

To display the depth value, the OBF creation has to be adjusted to include this data?

INT1 section K image

miramikes commented 1 year ago

The shield (circle around the rock symbol) is used in paper charts to mark rocks dangerous to surface navigation or outside the corresponding depth area.

To be able to add the shield dynamically, there must be

  • either an additional tag in the OSM data to mark the rock as dangerous
  • or depth data available to decide if the rock below a certain depth oder outside of the depth area

This maybe would be dificult as only about 11% of seamark:type=rock having depth=* https://taginfo.openstreetmap.org/tags/seamark:type=rock#combinations

Would'nt be enough to just add depth to rock? Anybody can decide what is dangerour for his wessel ...

BTW depth for submerged wrecks would be great too ;) https://taginfo.openstreetmap.org/keys/seamark%3Awreck%3Acategory#combinations

quantenschaum commented 1 year ago

Sure, this is is just advanced stuff. Display of the depth value should be 1st priority. Is just have been thinking about it.

side question concerning depth data: Is there some documentation on how to generate an OBF containing depth contours? https://github.com/osmandapp/OsmAnd/discussions/12502

miramikes commented 1 year ago

side question concerning depth data: Is there some documentation on how to generate an OBF containing depth contours? #12502

I used phyghtmap program to generate contours file when I builded my own maps for garmin years ago. http://katze.tfiu.de/projects/phyghtmap/

According to man pages it can use GeoTiff file and generat pbf/xml file pbf/xml file should be able to convert in OsmAndMapCreator to obf file http://katze.tfiu.de/projects/phyghtmap/phyghtmap.1.html https://osmand.narkive.com/KmMkzQIN/making-srtm-obf-files

Never tried this program to generate depht contour but I used it a lot before for contours

You will need some depth data ... maybe from here? https://www.gebco.net/data_and_products/gridded_bathymetry_data/#global

quantenschaum commented 1 year ago

https://github.com/osmandapp/OsmAnd/discussions/18116

quantenschaum commented 1 year ago

This can be implemented easily with https://github.com/osmandapp/OsmAnd/discussions/18116#discussioncomment-6945803

vshcherb commented 1 year ago

I think subscript values are better to display with textSize2 i.e. instead of "4.3" -> "4 (3)" so then it could be a separate text tag value

quantenschaum commented 1 year ago

Could you please explain this a little more in detail? Is there some magic happening when a string like 4 (3) is parsed?

quantenschaum commented 1 year ago

There is no textSize2 according to https://osmand.net/docs/technical/osmand-file-formats/osmand-rendering-style/.

vshcherb commented 1 year ago

There is nameTag2, it suggests that for 1 object 2 texts needs to be displayed, so it's automatically puts 1 text in brackets, in future we could have a feature to say nameTag2="subscript" textPlacement="subscript", now we already have textPlacement but it's for main tag (top/bottom/center) which could be later reused for 2nd text

quantenschaum commented 1 year ago

I still do not understand how this actually works. The docs are very short and hard to understand.

So, what exactly needs to be in rendering_types.xml (T) and render.xml (S) for text to be displayed? How do nameTag, nameTag2 in (S) and nameTags in (T) work?

Currently there is

Simply adding <case minzoom="10" tag="seamark:type" value="rock" textSize="14" textDy="-12" /> to the text section in (S) makes the depth labels appear on the map, even though depth is never listed in any nameTag attribute. Why?

What is the order attribute in (T) and (S) good for?

quantenschaum commented 1 year ago

:pointright: In ENCs there is the attribute EXPSOU which contains information about the depth (of the rock) relative to its surrounding area. This corresponds to [depth:exposition](https://wiki.openstreetmap.org/wiki/Key:depth#Exposition(EXPSOU)) in OSM. The seamark_rock_shield should only be displayed if depth:exposition=shoaler and the iconOrder should be lowered (higher priority).

quantenschaum commented 10 months ago

With depth:exposition and the shield only rendered when shoaler, it may look like this.

Rocks outside (shoaler) of the surrounding depth contour area get the shield.

image