Own overlay map: controlling zoom

46 views
Skip to first unread message

Akkana Peck

unread,
Apr 13, 2019, 12:39:52 PM4/13/19
to Osmand
I'm struggling to figure out OsmAnd zoom levels, to know what
zoom levels I should include when making overlay maps. I haven't
found anything written on zoom levels so I'm trying to reverse engineer.

Basically, my questions are:
1. How do I find out OsmAnd's numeric zoom levels?
2. How should I specify zoom levels in the .sqlitedb file?

I can see the zoom levels of the .sqlitedb files I created with:

sqlite3 -header filename.sqlitedb 'select minzoom,maxzoom from info;'

but the numbers are small, like 2 and 6. I thought OsmAnd zoom
levels were typically quite a bit bigger than that, but I can't find
any way to get OsmAnd to display zoom levels. I've tried enabling the
Developer plugin, like someone suggested recently on this list, and
I have "More details" checked under "Details", but there's still no
zoom level shown.

If I connect with ADB, use logcat | grep osmand, and zoom in and out,
I sometimes see messages like:

MapRenderRepositories BLat=35.31658782958984, TLat=36.49121246337891, LLong=-106.70255279541016, RLong=-105.87857818603516, zoom=10

though some zooms print nothing related to zoom level.

Zooming in and noting where I first see overlays and when I see a
MapRenderRepositories message in adb:

SCALE BAR ADB NOTES
5 mi 10 neither overlay shows
2 mi (narrow) first view of overlay with minzoom=2
3 mi (wide) 12
1 mi
.5 mi 13 first view of overlay with minzoom=6
.25 mi 15 both overlays show

That's confusing and inconsistent, but it's clear that the zoom numbers
in the sqlitedb file don't correspond to the ones printed in adb.

https://osmand.net/help-online/technical-articles#OsmAnd_SQLite_Spec
doesn't talk about zoom levels except to say they're inverted in
BigPlanet mode. I don't think my sqlite files are in BigPlanet mode,
since increasing minzooms show at increasing OsmAnd zoom levels,
and PRAGMA table_info(info); shows only two items in the info table,
minzoom and maxzoom. I tried reading SQLiteTileSource.java but I
didn't see anything that would explain this.

How do I find out the numeric zoom level in OsmAnd? And how does
OsmAnd map from the minzoom, maxzoom in the .sqlitedb file to the
actual zoom levels where it will show the map?

In case it helps, I put the overlays I'm testing with at
http://shallowsky.com/tmp/osmand-overlays/

...Akkana

Metaluc

unread,
Apr 14, 2019, 3:57:07 AM4/14/19
to Osmand

For a conceptual overview, this article may be helpful...

https://en.m.wikipedia.org/wiki/Tiled_web_map

For standard tile sizes.... Zoom level 0 the whole world, zoom level 20 house rooftop will take up most of the screen.

For the USA state level, or say most of Europe, level 5 or 6 works well as a minimum zoom.

Level 16 or 17 is usually enough for max zoom. Each higher zoom level gets geometrically more expensive in terms of data storage. You could wait days for level 20 to to be built, and it will be correspondingly large in storage usage.

On the Osmand app interface, the zoom level appears momentarily on the left bottom side just over the 3 bar main menu button. I think you must have the scale bar enabled in the display settings. It displays a fractional part, which I don't understand and just ignore. Somebody else might explain it's meaning, but it does not seem to relate to basic "slippy map"
(rates map) File storage.

Of course tile size can greatly influence the geometry. If you are trying to tile a historical single image paper map as a large tile size, increasingly higher zoom levels will get increasingly blurry. That's just a limitation of the raster method. Vector maps can stay clear at all zoom levels, which a much lower storage penalty. Vector maps cost more in computation, and less in storage.

Metaluc

unread,
Apr 14, 2019, 4:33:00 AM4/14/19
to Osmand

The only setting I can find that influences the display of the numeric zoom level indicator above the main menu icon is enable or disable of the developer plugin.

My setup always momentarily displays zoom levels in two parts like 12 4, that I presume is zoom level 12. The 4 stays the same at all zoom levels. I thought this "4" might be indicative of overzoom level (press and hold + icon for overzoom), but that does not seem to be the case.

The zoom level indicator only flashes on momentarily as you zoom. The black font color can be hard to see with dark background maps.

Akkana Peck

unread,
Apr 14, 2019, 11:18:07 AM4/14/19
to Osmand
Metaluc writes:
>
> The only setting I can find that influences the display of the numeric zoom level indicator above the main menu icon is enable or disable of the developer plugin.
>
> My setup always momentarily displays zoom levels in two parts like 12 4, that I presume is zoom level 12. The 4 stays the same at all zoom levels. I thought this "4" might be indicative of overzoom level (press and hold + icon for overzoom), but that does not seem to be the case.

The "OsmAnd development" plug-in is enabled, but I don't get a zoom
level flash above the menu button when zooming. There must be some
other setting that affects it.

> The zoom level indicator only flashes on momentarily as you zoom. The black font color can be hard to see with dark background maps.

I've tried with lots of different colors showing in the map above
the menu button. I'm sure I would see black numbers if they were
drawn there.

...Akkana

Metaluc

unread,
Apr 14, 2019, 2:18:41 PM4/14/19
to Osmand

There was a version where the zoom level indicator did not display. It was fixed in a subsequent version. It works in the latest version for me.

Akkana Peck

unread,
Apr 14, 2019, 9:49:04 PM4/14/19
to Osmand
Metaluc writes:
>
> There was a version where the zoom level indicator did not display. It was fixed in a subsequent version. It works in the latest version for me.

I have OsmAnd+ 3.3.7 2019-03-29, the latest paid version available
on Google. Maybe I should try one of the nightly builds to see if
that has the zoom indicator, but the last few times I tried
switching between OsmAnd+ and nightly, I lost my downloaded maps and
tracks and had to spend a lot of time setting up my environment
again, so I stopped doing that.

Maybe I should also note: I'm on Android (Galaxy S5). Is it possible
that the zoom indicator is only on iOS?

...Akkana

Majka

unread,
Apr 15, 2019, 2:14:40 AM4/15/19
to Osmand
Just a note - you can backup the complete Osmand data folder or just a parts of it. Doing it before reinstallation is a good idea. Regular backup of the track folder is another one. Just a copy in some other folder on the device, ideally on different memory, is enough.
Additionally, usually the data are still there - just in a different folder than the "new" installation expects it.
Reply all
Reply to author
Forward
0 new messages