Usage of raster maps instead of vector one for low zoom levels.

Libor Poutnik Striz shared this idea 8 years ago
Gathering feedback

It may be good to have optional configurable option of a using of a raster map of choice

instead of a vector maps for low zoom levels.


"Use <rasterMapOfChoice(bestIfCached)> instead of VectorMaps if zoom <= <ZoomLimitForRastermap>"

Like using cached OpenTopoMaps at zoom <=8


It may provide some map overview even for regions not covered by offline vector maps and speed up the rendering for low zooms, where usage of advantage of vector maps is slow, compared to low rendered details.

Replies (20)

photo
1

100% agree. I issued similar request quite long time ago.

Result so far is that Petr is preferring to waste his time in trying to compete with high quality, and high variety low zoom maps that are out there - lost battle from day one. With his 10 MB world map you cannot expect miracles - re outcome looks bad, and it is slow. But who today will care about space for a 200, even 400 MB world map ? And if you restrict the area even further, or go with cached maps, as you propose, the user has made his exact choice of space versus comfort.

I did some experiments with MOBAC recently: at zoom level 8, from 60 degrees south to 75 degrees north you need

- 220 MB for Street style

- 280 MB for Terrain style

- 430 MB for Hybrid style

And with MOBAC you can even build maps with mixed styles - one nice mix is hybrid for levels 0 to 4, terrain for 5 and 6, street for 7 and 8.


Menion is supporting the vector world map "religion" by denying the few hours development for proposed improvement.


While I am a 100% fan and promoter of Locus to a lot of people, this case makes me very angry !


Some history:

http://help.locusmap.eu/topic/use_bitmaps_for_lower_zoom_levels

photo
1

Note that OSMAnd has such a hybrid raster/vector approach already implemented as an option.

photo
1

I know that well ...

photo
photo
1

You can sort of have a raster overview map of your choice right now, even without menions help. Just create your favorite thingy with Mobac, eg zooms 0 to 8, then add another layer (zoom 9) with 100% transparent empty tiles. Use this as an overlay map in Locus with full opacity.

Result: Your own map at 0 to 8 and Locus vector maps at 9 and more.

Of course Locus will still waste time and battery rendering useless vector crap at 0 to 8, but at least not a single pixel of that nonsense will be visible :)

photo
1

How to create a transparent layer with Mobac? Create a random custom map source and point the URL towards a fixed empty transparent 256x256 PNG.

photo
1

This is all majorly backwards and uselessly complicated obviously... but at least it's a solution until Locus finally comes to its senses.

photo
1

TXs for the advise, juts tried, but got lost. I get overlays to work. But of course that is map by (vector) maps by maps, ... I hope reason will arrive soon ....

It seems I did not get the point how the three maps you mention play together and how to configure such.

Two maps (vector and my MOBAC) I got to play. But I am lost on the third.

photo
1

Its only two maps. The idea is to use a vector map as base map and a sqlite map from mobac as overlay at 100% opacity. At lower zooms, the overlay map will hide the vector map completely. But since the most detailed zoom level of the overlay map is fully transparent, at this level (and anything closer), the vector map will show.

This works nicely and smoothely together with Locus auto vector map switching... ie you can zoom out of Germany, move around in the sqlite overview map, zoom back into Spain and Locus will have the Spain vector map loaded automatically.

One drawback is that Locus will waste time and battery to render the vector maps at lower zooms, even though they will be completely covered by the overlay.

The other drawback is that creating that special kind of overlay map in Mobac is a bit "complicated". You have to define a Mobac custom map source for "All Transparent" (with a special empty png that you prepared) and then, in Mobac, add layers accordingly. For example:

Zoom 0-5: Googlemap (nice world map)

Zoom 6-9: Kompass Hike (<- quite pretty)

Zoom 10: AllTransparent

photo
1

Thank you joeloc. MOBAC I understand and have used so far. Incl. using SQLITE locally.

Could you pls. just drop the few lines for this mapsource XML into this thread, please ?

TXs and cheers

Michael

photo
1

<?xml version="1.0" encoding="UTF-8"?>

<customMapSource>

<name>_transparent</name>

<minZoom>0</minZoom>

<maxZoom>18</maxZoom>

<tileType>PNG</tileType>

<url>http://www.nonexistantdummy.de/TransparentTile-256x256.png</url>

<backgroundColor>#ffffff00</backgroundColor>

<ignoreErrors>true</ignoreErrors>

</customMapSource>

That might do the trick. I used my own local http server instead of nonexistantdummy. AFAIK Mobac will use the specified background color (in this case white with alpha set at 0) in case of errors, so it should work without having to put up some transparent png somewhere.

photo
1

Btw... a variation of this method would be to use semi-transparent hillshade tiles instead of the completely transparent dummy for the last zoom layer. Very nice hillshading is for example available from uni heidelberg. Here's the mobac custom mapsource:

<?xml version="1.0" encoding="UTF-8"?>

<customMapSource>

<name>_unihd-Hillshade</name>

<minZoom>0</minZoom>

<maxZoom>12</maxZoom>

<tileType>PNG</tileType>

<url><![CDATA[http://korona.geog.uni-heidelberg.de/tiles/asterh/?x={$x}&y={$y}&z={$z}]]></url>

</customMapSource>

So you would use whatever overview map you like for mobac 0...9 and then this hillshade layer for 10. In Locus, you will then get automatic hillshading for your vector maps at zooms >= 10. Way faster than Locus builtin hillshading and no extra battery usage. Little problem: The hillshading is too dark. We would have to find a way to reduce the alpha in the uni-hd png tiles to 50% of its original value. Maybe that could be accomplished with a clever mobac multilayer map source... havent really looked into that yet.

photo
1

Thank you joelec.

This is what I troied, but failed:

<customMapSource>

<name>transparent2</name>

<minZoom>0</minZoom>

<maxZoom>18</maxZoom>

<tileType>PNG</tileType>

<url>file:///N:/Geo-Maps/MOBAC/mapsources/TransparentTile-256x256.png</url>

<backgroundColor>#ffffff00</backgroundColor>

<ignoreErrors>true</ignoreErrors>

</customMapSource>


MOBAC log shows: Download of tile z5_x16_y10 failed


Hmmm, any idea ?

photo
photo
1

For now , it seems easier and resource friendly to use a fast manual map switching at zooms 8-9... :-)

photo
1

Hm can't use the "overlay hint", because i need this layer for other things.

Whatever, so +1 for topic "Usage of raster maps instead of vector one for low zoom levels"

...without tricks

photo
1

Good luck... auto map switching by zoom level has been on several wish lists since... i dont even remember anymore... 4 years :-)? And now menion is kind of fixated on this world vector map thingy, so chances have gotten even slimmer.

photo
photo
1

There are more(!) than 20 very good ideas waiting for implementation. So what :o)

photo
1

This one has consumed more time in denial discussions than it would have needed to built it.

photo
1

It doesn't matter if the tile download fails. Mobac will use background-color parameter then. Which has full transparency. At least that's what the Docs say and what works for me (Beta 2.0.1 or some such).

photo
1

Hmm, the file I get has only zoom levels 0..4 in it, as per Locus. (I use that as a test, the transparent level is 5 then). Weird.

photo
1

Produced the second approach with uniHD and got it to work. However, it slows down any scrolling on higher zoom levels massively.

So I am back to the transparent file approach. But even with Process Monitor MOBAC does not disclose which file it wants to open - and fails.

photo
1

Slows down scrolling? Funny. It's almost instant here with unihd, hardly any difference to scrolling without overlay map. On the contrary... it "feels" faster because the overlay hillshade appears right away, way before the vector data. No blank screen visible.

Oh well, that might depend a lot on the phone... there's plenty differences out there. Some are stronger on single threading (fewer cores with higher frequency), some on multi. I can make my Note 4 use about 70% CPU when scrolling intensively and 90% when zooming (with overlay). Iirc it has 8 cores, so Locus algorithms seem to multithread quite nicely meanwhile. Cheers, menion :).

photo
1

Last night I managed to create a map with a local transparent file finally (just put one file in the right subfolder structure) . But there the effect comes, too. In the moment Overlays are activated, Locus slows down like crazy, in particular at high zoom levels, for which there are no files, of course.

Vector map alone: fast. Overlay map alone (12800 zoom, but that is not an issue for comparison here): fast. Both together: disaster.

I hope, Menion's Logging facility that I read about somewhere else will come soon. Should immediately show the smoking gun.

photo
1

How did your xml and the dir structure with the trans file look like in the end?

photo
1

This structure calmed down MOBAC:

N:\Geo-Maps\MOBAC\mapsources\ZOOM\1\0\1.png


N:\Geo-Maps\MOBAC\mapsources\ZOOM\2\0\3.png


N:\Geo-Maps\MOBAC\mapsources\ZOOM\3\0\7.png


N:\Geo-Maps\MOBAC\mapsources\ZOOM\4\0\15.png


N:\Geo-Maps\MOBAC\mapsources\ZOOM\5\0\31.png


N:\Geo-Maps\MOBAC\mapsources\ZOOM\6\0\63.png


N:\Geo-Maps\MOBAC\mapsources\ZOOM\10\0\1023.png


N:\Geo-Maps\MOBAC\mapsources\ZOOM\11\0\2047.png

using this XML:


<?xml version="1.0" encoding="UTF-8"?>

<localTileFiles>

<name>transparent</name>

<sourceType>DIR_ZOOM_X_Y</sourceType>

<sourceFolder>N:\Geo-Maps\MOBAC\mapsources\ZOOM</sourceFolder>

<invertYCoordinate>true</invertYCoordinate> <!-- optional -->

<backgroundColor>#ffffff00</backgroundColor>

</localTileFiles>


However, Locus is not happy with the result, as you may have seen in my error report.

photo
1

Could you do me a favor pls ? Create an SQLITE with only transparent tiles, whole planet, level 10, and another one level 11.

I hope those would be massively compressed ...

photo
1

I cannot make your local tile layout work. It gives me red Xs for every missing tile file obviously. Cant seem to find a way around one file per tile with this mobac xml syntax. I also cannot create a world map using http:// tiles because mobac has a 500.000 tile limit. I only used smaller regions for testing so far.

Anyway... I suppose Locus would totally crash and burn if you confront it with a sqlite map that has 2^11 tiles or some such (world in zoom 11). Even if a single tile has only a very tiny png image data, Locus probably tries to build up an internal tile index list, eating away all the memory, crawl and/or crash.

photo
1

You could try TwoNav/RMAP as format (extention .rmap). Locus supports that and maybe handles it differently.

photo
1

For level 10, taking only the continents will be below 500k tiles (80k Americas, 180k EMEASIA). And Locus goes for the bounding box, not for inventory.

For level 11, each single continent will fly (factor 4).

But I can try RMAP in parallel tonight.

photo
photo
1

Do I understand you guys correctly, you want the hole globe map to show on certain zoomlevel?

If you can describe it/why like we're 5... you will probably get more upvotes :-).. (119 views of thread at this point)

Can you provide some screenshoots/recordings of what you have accomplished so far.

photo
1

Were just chatting...

photo
1

RMAP does not work.

Could you pls. try the level 9 transparent file ? Box -60 .. 75, -179.999 .. 179.999 degrees

Only 139740 tiles

That would be great!

photo
1

BTW: for a world map, the Heidelberg Hillshades mean more than 4 GB - on level 9 :-)

But the 140k empty tiles should be a piece of cake ...

photo
1

Further tests reveal that Mobac seems to create broken maps with


a) your local tiles trick

b) my non-existing-url and ignorerrors trick


I just set up a local web server (use eg https://sourceforge.net/projects/miniweb/ for windows) and used the following mapsource:


<?xml version="1.0" encoding="UTF-8"?>

<customMapSource>

<name>_transparent-localhost</name>

<minZoom>0</minZoom>

<maxZoom>18</maxZoom>

<tileType>PNG</tileType>

<url>http://localhost:8000/TransparentTile-256x256.png</url>;

</customMapSource>


The resulting map (tested middle europe area with googlemaps 0..9 and transparent 10, around 70MB) behaves nicely when used in Locus as overlay. No slowdown.

photo
1

Do you mind sharing the miniweb config to make this customMapSource fly, please ?

photo
1

Theres nothing to config really... just unpack miniweb, copy the png to the htdocs folder and run the exe.

photo
1

works like a charm. TXs a lot.

For MOBAC friends: here is the link to a map file with transparent zoom level 10 tiles for all continents (except Amerika high north and except Antarctica). It is about 85 MB big.

https://www.dropbox.com/sh/hzp3q3lt1rq07gp/AACfw_sAapz5x_qsSj2pQNmra?dl=0

photo
1

Glad to hear... now if only petr and menion would realize how *wrong* vector maps are for lower zooms... :)


Falk Roadmap: useful town names, properly sized, important mountains, even in the two official languages spoken in south tirol.

vector map: mostly useless bullshit. you cant even realize where you are.

73457ba08d08f8b9cade7d5ea8e9dc55


Geoportail overview map at zoom 12 vs utter vector bullshit. No comment necessary.

6d2eedae275d5b8be876ae405e2633ec

photo
1

Only two things needed from Menion now:

- obsolete your trick re. transparent additional zoom layer - it only eats tiles count. How: by not zooming the overlay map, once its max zoom level is reached.

- as long as overlay map is visible at 100% opacity level, do not draw the vector map.

Both minimal surgery additional "IFs", I suppose.

Then we can live with the overlay trick for a while, right ... :-)

photo
1

The beauty of this "trick" is that it works without menion already... no more waiting for another five years :-).

The all transparent max zoom level in the overlay map is required, how else could Locus show the vector data on a 100% opaque overlay? Obviously, Locus could consider overlay maps as "empty & transparent" automatically when zoomed beyond their max, but that is not useful for all overlays... only for these "trick maps". But imagine for example a hill shade overlay at zoom 11. You would obviously want Locus to bitmapzoom it to 12, 13, 14...

The "invisible" vector tile rendering really only eats battery... it doesnt slow down things visibly. At least not here. And it is really invisible. Basically, it feels totally like I imagine an auto-map-switch would feel.


Yes... we do have a tile count problem for the last level... seeing that I would want sqlite maps up to zoom 12... this magic might only work continent-wide... not world wide. maybe not even that.

photo
1

You are right re. different scenarios beyond zoom max in overlays. For that it would be best to have a switch to control behavior when selecting the overlay.

Even better would be a choice up to which zoom level to use, potentially scale the overlay, before dropping the overlay completely from displaying - selectable also in the overlay selection screen.

Another dream :-)

photo
photo
1

A world map from google tiles up to zoom 8 and a transparent level at 9 is around 450MB and improves Locus vector map usability quite a bit when used as 100% overlay.

photo
1

And level 9 with l 10 transparent for the continents needs 810 MB

photo
1

Size can probably be cut in half by re-compressing the google tiles with some lousy jpg/50% with Mobac. Has visible artifacts obviously, but maybe doesnt matter so much on an overview map. Obviously, the png transparent layer must not be recompressed.

photo
1

Anyway... I just made an

Alps-Google-0-8-Falk-9-12-Trans-13.sqlitedb (600MB)

and am quite happy with the look&feel in Locus. Vector maps render nicely at zooms>=13 (openandromaps with elevate theme). Below 13, the overlay kicks in seemlessly. Big improvement in overall handling.

Obviously this is till sort of an "evil hack" for overlays... but it will do until petr and menion come to their senses regarding overview maps and auto switching :-)

photo
1

btw... have you found a way to create a uni-hd hillshade layer with reduced alpha?

photo
1

Not my area of expertise until now, so I did not try. One way I can imagine is: select a map format that produces tiles as easily accessible files (tree or in zip), then process all those with an image tool. Then use file system as source for SQLITEs

photo
1

I have turned this thread discussion into explicit "idea":

http://help.locusmap.eu/topic/optimize-overlay-behaviour-for-better-speed-and-less-battery-use-and-better-usability

It summarizes the actions needed to optimize the usage of joelec's workaround.


@

Hallgeir Gjesdal now it is time to collect votes ...

Leave a Comment
 
Attach a file