Locus Map - forum

Content & Tools => Themes - Vector maps => Topic started by: gauvins on October 25, 2021, 23:34:36

Title: Possible to show features of a LoMap at any zoom level via theme?
Post by: gauvins on October 25, 2021, 23:34:36
My understanding is that the zoom level at which a map feature is visible is determined by the map data and not by the theme that is applied to it. If I am wrong, please correct me. Otherwise, is it possible to edit the *.map or *.db in order to change the design setting?

This wiki entry suggests that small roads become visible at a zoom level of 15 or more https://wiki.openstreetmap.org/wiki/Zoom_levels (https://wiki.openstreetmap.org/wiki/Zoom_levels). I'd like to be able to see them at a smaller scale. Idem for some POIs such as campsites.
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: michaelbechtold on October 26, 2021, 14:22:23
It is determined by BOTH in fact.
The map typically contains 3 data sets for three zoom level ranges.
If an object is available in such a ZL goup, (only) then the theme decides if it is visible.
If the object is not included at that level in the .map file, then the theme is powerless.

Only the authors can decide and make happen what is in the .map file at which level (group).
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: gauvins on October 26, 2021, 17:40:02
Thanks for your input.

So I gather that it is not possible to change the .map hard=coded ZL values. Too bad.

Would you happen to know if it might be possible to ask for a different set of values for highway=tertiary|unclassified|cycleway ?
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: michaelbechtold on October 26, 2021, 18:46:47
That would be a request to the LoMpas team (Petr et.al.)
But you can try to reduce the minimum in the theme to explore from which ZL these objects of your interest are available today.
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: gauvins on October 26, 2021, 19:49:34
I've edited the theme. Improves things in some cases (ex: campgrounds can be seen at a smaller scale than currently themed); but not for others (route planning in Northern Quebec is an adventure in zooming in-out).

I've sent a request to LoMaps (Assam). Might also try alternative maps - was hoping for a simpler solution :)

Thanks again for your time
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: Viajero Perdido on October 26, 2021, 20:00:29
Have you tried OpenAndroMaps with the Elements (not Elevate) theme?

Elements is designed for sparsely-populated areas, and shows elements as soon as their data appears in the file, rather than keeping them selectively hidden until a higher zoom level.

https://www.openandromaps.org/en/legend/elevate-mountain-hike-theme

OAM are very similar to LoMaps, but - ironically - they render better in Locus than Locus' own maps.  That's because OAM and the Locus app both support MapsForge V4, but LoMaps are still stuck at V3.
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: gauvins on October 26, 2021, 22:34:18
Thanks for the pointer.

I will take a look at OAM. But to be honest, I'll probably stick with LoMaps because they work well and (I assume) support the team behind Locus.
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: michaelbechtold on October 27, 2021, 01:12:32
Well, I run a gold subscription, hence support the team, have access in particular to the address/POI DB for offline use, while I employ OAM maps on a daily basis ...
We can achieve all at once :-)
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: freischneider on October 27, 2021, 06:43:02
I also have gold and only use LoMaps because of the offline address data in the background. That means the types are installed but are not displayed. I use the OAM cards for viewing. I think the OAM theme is so good.
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: voldapet on October 27, 2021, 09:49:34
@gauvins it's even a little bit more complicated, there is another parameter that defines the minimal zoom-level defined in so called tag-mapping XML file used during map generation. For LoMaps it's https://github.com/asamm/mapsforge-v3-modded/blob/master/various/tag-mapping-xml/tag-mapping-tourist.xml
But the most important is probably the theme itself. The LoMaps theme is available at https://github.com/asamm/mapsforge-v3-modded/tree/master/theme-base/src/main/assets/themes/mapsforgeV3/base

I'd suggest to check alternative community themes available in the Locus Store (Menu > Locus Store > Graphics) or here on the forum  https://forum.locusmap.eu/index.php?board=40.0

There are also other community maps as mentioned OAM as other suggested

@Viajero Perdido we still use mentioned V3 version, we quite modified it for our purposes and should be still quicker in rendering




Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: gauvins on October 27, 2021, 23:09:14
@voldapet -- thanks for your pointers.

WRT community themes, there isn't much. The market for e-ink devices is very small. I am working on a grayscale theme, which already works quite well for my purposes.

Two things perhaps --

1. I use Locus in the field (bike touring) to generate routes if the need arises. A key element is the presence/absence of camp sites or such, so I've changed the theme to display camp/caravan POIs at the smallest scale possible. So far so good. However, when I've added picnic sites, which are far more numerous, rendering screeched to a halt.

My understanding is that Locus' engine renders all the tiles that are visible at a given zoom level. If the user figures that something is wrong with rendering and zooms in, in order to reduce the number of features to render, the engine will keep going on the previous task before computing the new set of tiles. Which is odd because unless I am wrong, changing the theme kills the current rendering operation and starts a new one.

2. A related question is what are the best practices for POIs icons. Looks like the source is an .svg that the engine scales to the right size, from which it creates a .png copy that is cached and used as needed. If the icons were always rendered at the same size, irrespective of the zoom-level, would it make sense to pre-render the icons (i.e. link to properly sized icons)?
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: Menion on November 01, 2021, 15:10:34
Hi, your questions are technical (related to the app), so I'll answer instead of Petr.

1. app rendered up to 5 map tiles at once, but in case you zoom, app firstly needs to finish these five tasks. So in the case of really slow rendering, there may be a significant slowdown till the next rendering starts.

2. this is correct, the app renders SVG to PNG in the expected size and caches it. Saving directly in the PNG is possible, but why this? The app will then rescale PNG images based on the device DPI.
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: gauvins on November 01, 2021, 16:16:41
Thanks for your time (and patience). I am new to this and ask questions left and right.

I am quite pleased with the latest iteration of hcLayers high contrast theme. It essentially does what I want with, perhaps, two caveats:

1. The display of place names is not working well. I've posted in a different sub-forum. The Paris/Argenteuil is just a more visible and funny quirk. I plan to (a) upload place names POIs in order to be able to improve rendering; or (b) download Stamen Toner tiles at small scale as a stop-gap measure.

2. I would really love to be able to display some features at any scale, determined by the theme rather than by the .map. In particular small roads (tertiary, unclassified, tracks, etc.) that are often the only type of "highways" in sparsely populated areas. (I'll try to learn how to generate custom maps, but life is short and perhaps you'll consider selling LoMaps+ :)
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: Viajero Perdido on November 01, 2021, 18:33:51
Place names are the big shortcoming of the V3 format.  (What city is this?!?)  That, and the inability to draw curved text labels, which means fewer labels for rivers and trails are drawn, only on straight sections.  V4 fixes both those issues.  (Also with OAM you get mountain ranges, but that's off-topic here.)

PS, if you still prefer LoMaps, there is a version of OAM's Elements theme (mentioned above) for LoMaps, called Elements LE (Locus edition).  That should help with sparsely populated areas, but won't fix the missing text labels.
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: gauvins on November 01, 2021, 21:04:59
I am familiar with Element. IIRC I've used it at some point in time.

Thing is, from what I understand, it cannot render a feature that isn't available (zoom-appear). Unless I am missing something, tertiary is unavailable at a zoom smaller than 12, track at 13, camp_site at 14 (or 12, not obvious) (source here https://github.com/asamm/mapsforge-v3-modded/blob/master/various/tag-mapping-xml/tag-mapping-tourist.xml (https://github.com/asamm/mapsforge-v3-modded/blob/master/various/tag-mapping-xml/tag-mapping-tourist.xml)). And Element will not render in black and white, which is why I got motivated to learn a thing or two about themes and stuff...

My understanding is that it would be possible to extract map data with every feature appearing at zoom 0, and to defer rendering at a given zoom level to the xml (theme) instructions. I don't know how to do this for now, and presume that it may take more than a rainy Sunday to figure out. Yes, there is pleasure in learning new stuff, but life being short, I'd hope to motivate others to do it for me.
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: freischneider on November 02, 2021, 06:30:35
Ask in the Openandromaps forum.
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: voldapet on November 02, 2021, 09:54:39
QuoteMy understanding is that it would be possible to extract map data with every feature appearing at zoom 0, and to defer rendering at a given zoom level to the xml (theme) instructions. I

Theoretically, it's possible if you generate your own maps. By default, the generated map (LoMaps) consists of 3 inner parts - zoom levels.
see 'zoom-interval-conf' parameter at https://github.com/mapsforge/mapsforge/blob/master/docs/Getting-Started-Map-Writer.md

The goal is to limit the number of elements in small zooms to avoid slow rendering.  The question is whether it is even a good idea to render small road lines below level < 12. I think the number of roads would be large and the map would become unreadable.
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: gauvins on November 02, 2021, 15:42:24
Quote from: voldapet on November 02, 2021, 09:54:39
[ The question is whether it is even a good idea to render small road lines below level < 12. I think the number of roads would be large and the map would become unreadable.

I understand your point. However in parts of the world, there are few roads of any size, and small scale is all but necessary. Take Australia. Even on a large computer screen, using Google Maps, figuring out options to travel from Uluru to Little Sandy Desert without a routing software is all but impossible. In Locus, after quite a bit of zooming in/out in order to locate reasonable endpoints, bRouter will come up with a suggestion that you'll have to follow more or less blindly because there is no way to visualize alternatives.

Same issue in Northern Canada (where I live) and, I assume, the stans/Mongolia,. large portions of South America and Africa...

Anyhow -- I think it would be great if the map file didn't make rendering assumptions. I'll try to find the time to generate an agnostic map and see if there is any performance issue when these instructions are located in the theme.

Or may I tempt you in generating a map set for Australia (and Canada) and I'll let you know how things went on my cheap, yet beloved, e-ink phone? :)
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: michaelbechtold on November 02, 2021, 20:56:11
For OAM Christian uses different base settings for different parts of the world to exactly address the problem you are highlighting. The elements theme is the right counterpart for those areas of the world.
Give it a try.

Looking at Canada OSM data, there is also TONS of work to do for the OSM mappers :-)
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: gauvins on November 03, 2021, 14:16:15
Thanks for the nudge.

I've installed an OAM map. On the plus side, it looks as if features can be displayed at a smaller scale. Unfortunately the General/Element/Elevate themes do not render very well on an e-ink device and it is not clear how I can make my theme work. I've tried putting the xml file inside the _themes/Elevate folder, to no avail. I've also tried to replace the Elevate.xml with my theme and still no love.

I'll examine the Elevate and try to understand what breaks.

Will eventually update on this thread.

Thanks again
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: michaelbechtold on November 03, 2021, 18:56:59
Maybe this one  (see attached) is a good start?
I did not try, but remembered the other thread about this subject.

https://www.openandromaps.org/oam-forums/topic/einfaches-leeres-theme-fuer-v4-karten

Good luck and cheers
Michael

Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: gauvins on November 05, 2021, 14:34:34
Well -- I think I am giving up on OAM. Yes, their themes are excellent, but they do not render well in gray scale. My version of a B&W theme didn't work out of the box" I think that it is because I am using html color names -- black instead of #000000 -- which breaks rendering (!?). A brief experiment suggested that features rendering is also limited by the zoom level, so there isn't much room for improving my use case.

BTW -- I am able to reasonably see routing options between Uluru and Little Sandy Desert, which is good  enough for me :)

I'll eventually get back to this idea when I have more free time on my hands.

Thanks again for your input
Title: Re: Possible to show features of a LoMap at any zoom level via theme?
Post by: michaelbechtold on November 05, 2021, 15:21:16
Enjoy the trip!