treee111 / wahooMapsCreator

Create maps for Wahoo device based on latest OSM maps
GNU General Public License v3.0
259 stars 26 forks source link

Show tunnels in the map #160

Closed masc4ii closed 1 year ago

masc4ii commented 2 years ago

Is your feature request related to a problem? Please describe.

See the maps around lake garda. All the tunnels are not shown. It is hard to see which road goes where.

1

Describe the solution you'd like

Show the tunnels...

Problems

The green forest area is not transparent and tunnels are rendered under the forest. That looks really bad.

2

Transparency

By accident I found out, that the Bolt2 and Roam2 devices can handle transparency. But only, if it is defined via SVG. So the solution for tunnels is to use a semi-transparent forest SVG. And now the map looks like this:

3

Pull request

As my personal theme is now reduced to Bolt2 and Roam2 (my friends and myself just have these two), I can't easily create a pull request - it is too different now. But you find my "tunnel solution" in these commits in my fork. If you find it useful, you could add it for all the other Wahoo devices in the main fork (if possible - I don't know and can't test for Bolt1 and Roam1). de160baef1f72fbf8d2fd31f4a85a77e37177981 00bb392e05fa9038e4e457fad805cb5b26a83c96

masc4ii commented 2 years ago

The same could be achived when transforming tunnel layer from -1 to something higher... and I found your transform xml "tunnel-transform.xml". Could you please help me, how to use that (on non-windows)? And does this work too? Would maybe be a more elegant solution than changing from a color to a transparent svg.

treee111 commented 2 years ago

I have only taken over the tunnel-transform xml and processing. I am aware that there is a difference in macOS and Windows processing of tunnels but hadn't time to dig deeper there. If you provide X/Y coordinates I can generate maps for that tile with Windows and macOS and take screenshots or send the tiles to you.

If you could bring a little light into the tunnel-transform stuff that would be nice! 👍

masc4ii commented 2 years ago

Python really is not my programming language and for me it is a mystery anything works... 😃 ...respect for all the code! But little progress on my side:

Did I missunderstand a point in the code?

Edit: sry, me beeing stupid: I also should load the new map into cruiser. So, I confirm this works! How can I run this command from your code...? 😄

Your transform xml changes level to =2. This is a little much - any reason for this? This shows tunnels over all other ways. I think level=0 looks nice. Here the above example with transformed level tag and other colors for the way types:

Bildschirmfoto 2022-10-31 um 20 34 47
masc4ii commented 2 years ago

Crazy... no idea what I do, but it seems to work with your processing and a little change (additional call) now for macOS: 7f7f73ac133ade796b3b5914f7dadf2ae99b035d (ignore my "python3" - on my system it is called with python3, whyever)

masc4ii commented 2 years ago

Please be careful! I updated to latest Oct31 build, since that it stopped showing maps at all! Same for a friend. I copied back my backups and deleted vtm-elemnt folder - no luck.

treee111 commented 2 years ago

thanks for the warning, the update didn't arrived for me but I heared in the Telegram group that it screwed a lot of people.

Actually I am tinkering with your tunnel-inputs. Is it right,

I'm testing with the BOLT version of vtm-elemnt.xml (from this repo) in cruiser and can't see a difference here but if the above written is right, that's because of the theme grafik

masc4ii commented 2 years ago

There is a Telegram group for this? Do you have a link for that please, even if off-topic here? The one from your Readme page?

The tunnels are in the map, if you create the tiles with your application. In vtm-elemnt.xml the code is missing to show it. I added many lines here (see my fork). Now, the tunnels will be drawn below forests. After changing the level to 0, the tunnels are shown correctly. Note: my vtm-elemnt is very different now to yours, because Roam2 had some problems with the default theme (mixed all devices). I killed all but Bolt2 and now it works for Roam2 too, perfectly.

treee111 commented 2 years ago

There is a Telegram group for this? Do you have a link for that please, even if off-topic here? The one from your Readme page?

yes, the one from the README, very busy in the last days :-) feel free to join: https://t.me/joinchat/TaMhjouxlsAzNWZk

The tunnels are in the map, if you create the tiles with your application. In vtm-elemnt.xml the code is missing to show it. I added many lines here (see my fork). Now, the tunnels will be drawn below forests. After changing the level to 0, the tunnels are shown correctly. Note: my vtm-elemnt is very different now to yours, because Roam2 had some problems with the default theme (mixed all devices). I killed all but Bolt2 and now it works for Roam2 too, perfectly.

Ok thanks for confiming, then my thoughts were allright. I also had a look at your fork! I'll look out for tunneling later, I want to release v3.0.0 in the next few days and focus on that.

Cool that you changed a lot and also personalized the theme to suit you. Most likely the themes is what people do personalize. My aim with this repo is to have a "well going" and good tested set of tooling and themes where others can fork from.

masc4ii commented 2 years ago
Bildschirmfoto 2022-11-01 um 22 24 25

That is the latest revision until my white screen problem, in cruiser. It was working like this also in my Bolt.

Joined the group! I hope there is a solution soon.

treee111 commented 1 year ago

Hi @masc4ii, I tinkered around and now came up with a clean and identical way of doing the merging stuff incl. tunnels in Windows and macOS with https://github.com/treee111/wahooMapsCreator/commit/a19add789f16d2bb5a3c065cc40ddd080c52877a: https://github.com/treee111/wahooMapsCreator/blob/a19add789f16d2bb5a3c065cc40ddd080c52877a/wahoomc/osm_maps_functions.py#L623-L662

Could you please check if this works also with your local changes / theme? It is branch tunnels-macOS-2 Thanks!

masc4ii commented 1 year ago

@treee111 : thank you! It works over here. Your code is better than my try. 👍 You could change the level value to 0 in the tunnel xml. When using 2, the tunnels are rendered over all other objects - maybe not necessary.

treee111 commented 1 year ago

thanks for your feedback @masc4ii and for bringing this up in general! We are getting there ;-) Implemented the level-change as well. Gonna merge this in the next days, this issue will be closed then automatically.

masc4ii commented 1 year ago

Great! Thank you!

masc4ii commented 1 year ago

One more thing: I tried again on a fresh macOS. -->

osmium-tool is not installed. 
Please refer to the Quickstart Guide of wahooMapsCreator for instructions:
- https://github.com/treee111/wahooMapsCreator/blob/develop/docs/QUICKSTART_ANACONDA.md                     
or create an issue:
- https://github.com/treee111/wahooMapsCreator/issues

osmium is not needed anymore, so this could be deleted. Edit: sorry... I see it is still needed. But is it possible to move all commands over to osmosis instead of osmium?

treee111 commented 1 year ago

you are right, there are still three usages of osmium. Btw. nice, that the check for needed packages worked as intended 💯

I had a brief look. It seems to be not super easy to move the 1st and 2nd usage over to osmosis. Windows uses osmfilter (also available via homebrew) and osmconvert (not easy installable). As usages of these two tools would not bring a benefit and would cause some work, I'll leave them two usages as they are.

I moved the 3rd usage over to osmosis, was easy ;-)

Thanks for giving a hint on that!