Rmaps or MbTiles to use with Locus Map 4?

Svjetlana shared this question 20 days ago
Answered

On Locus I am using two formats of external maps, Rmaps sqlite and MbTiles downloaded by MOBAC. Each of those two formats of maps have tiles in png, jpg or webp format.

All of those work in Locus flawlessly and I can not see any difference in performance and/or visual quality of the maps on the screen.

Nevertheless, I wonder:

1. which of those two formats of maps is better, if at all (in terms of performance, future development, etc.) to use with Locus 4?

2. which of tile formats, png, jpg or webp is better (in terms of performance, not size on disk) to use?

I am asking this first question since information I have collected in the online manual and discussions are somehow confusing to me. Somewhere, it says, Rmaps should be used with Locus and somewhere it says that MbTiles should be used since Rmaps are an undocumented map format and support by Locus Map is limited!!! I would like that the manual is updated and/or unified in this respect.

Please see the following links:

manual - Creating Offline Maps With Mobac:

https://docs.locusmap.eu/doku.php?id=manual:advanced:map_tools:mobac

manual - Conversion of Maps

http://docs.locusmap.eu/doku.php?id=manual:advanced:map_tools:conversion

manual - External Maps

https://docs.locusmap.eu/doku.php?id=manual:user_guide:maps_external

help desk - Create Locus maps with QGIS and MOBAC:

https://help.locusmap.eu/topic/create-locus-maps-with-qgis-and-mobac

Replies (12)

photo
1

It's very important not to confuse two completely different formats: RMAP and RMaps.

===

RMAP is a proprietary CompeGPS/TwoNAV format. This link says (in the line "RMAP") that his support in Locus is limited:

https://docs.locusmap.eu/doku.php?id=manual:user_guide:maps_external#supported_map_formats

In the rest of the text we will not talk about this format anymore :)

===

RMaps is a tiled map format inherited from the RMaps program, which existed on Google Play (at that time - "Android Market") in 2010, when Locus was first released. Here's all that remains of it as of 2025:

https://robertdeveloper.blogspot.com/2009/08/rmaps.html

https://code.google.com/archive/p/robertprojects/downloads

(last release in 2013)

But it was this format that formed the basis for storing maps in Locus and was supported by a number of mapping programs that appeared during the same era. This format is sometimes referred to by the program in which it first appeared - "RMaps", and sometimes by its database format or traditional file extension: SQLite / *.sqlitedb. (although there's potential for confusion here, too, since the MBTiles format is also an SQLite database, but at least it has the traditional *.mbtiles file extension.)

And this is the format discussed here:

https://docs.locusmap.eu/doku.php?id=manual:advanced:map_tools:mobac

https://docs.locusmap.eu/doku.php?id=manual:advanced:map_tools:conversion

https://help.locusmap.eu/topic/create-locus-maps-with-qgis-and-mobac

And here, this format is mentioned in the first line, under the name "SQLite (*.sqlitedb)":

https://docs.locusmap.eu/doku.php?id=manual:user_guide:maps_external#supported_map_formats

===

The performance of RMaps (aka "SQLite", aka ".sqlitedb") and MBTiles should be absolutely identical, since these firms are the same database; only the tile numbering order is different.

I am only aware of these differences, which do not affect performance in any way:

1) The name of an RMaps map in Locus can be changed simply by renaming the file. But with MBTiles, it must be changed within the database.

2) With RMaps, if maps file are initialized correctly, Locus's automatic map loading feature can work (seamless switching between maps of the same source located in different files).

3) A correctly initialized map can have the icon of the desired map provider :) MBTiles maps always have the same icon.

4) Tiles with Ellipsoid projection cannot be written to MBTiles (without repacking and tiles recutting, that can be loosy). I'm not sure you'll ever encounter this. I only remember one source of such tiles on the internet.

5) There are some "clickable MBTiles", and this feature is supported in Locus. But I haven't gotten around to figuring it out in years. :) More indo: https://help.locusmap.eu/topic/clickable_mbtiles_layer

These are all the differences I know of.

And about future development - throughout Locus's existence, and to this day, RMaps has been Locus's internal format (for caching online maps).

But, let me remind you once again, RMaps and MBTiles differ very slightly and can be easily converted into one another with a few commands to the database.

===

I'm really curious to see what I missed that the Locus developers might add :)

I create all the maps I need in RMaps / SQLite / .sqlitedb. But if I receive a map as MBTiles, I don't see the point in converting it to RMaps (even though it's very quick and easy).

This comment is in trash! Restore
photo
1

As for the performance of image formats, as I understand it, this processing is handled entirely by Android. There are studies showing that WebP decompression is slightly faster. But as far as I understand, the other Locus workload makes this difference completely unnoticeable.


So, ultimately, the selection criteria are file size and the practicality of using lossy compression for a particular map.

This comment is in trash! Restore
photo
1

Thanks Evgeny for the clarification of this matter. I have indeed mixed up RMaps and RMap and didn't realise the difference. Now I understand. My confusion primarily appeared reading this:

https://help.locusmap.eu/topic/create-locus-maps-with-qgis-and-mobac

... saying: ... RMaps is an undocumented map format. Support by Locus Map is limited ... and ... MBTiles should be more universal and stable than RMaps ...

Now, I assume that was a slip of the tongue.

Although MBTiles format seems more modern format (at least that's what the internet says) with some fancy features like clickable MBTiles (which I don't now where/how would I use it), I presume, staying with Rmaps is better option. As I understand, Locus has some optimisations for handling RMaps format.

And as for the tiles/images - yes, WebP seems like the best option, at least in terms of image quality/size ratio.

This comment is in trash! Restore
photo
1

Hi,

Evgeny, thanks for the clarification, it's precisely as you described it.

Svjetlana, the articles you mentioned are quite outdated because they were written in the early days of Locus Map when there were no internal maps like LoMaps and our users struggled to find quality maps. Nevertheless, there is still a lot of useful information in them, and, under the domain .app, they can be updated in the future (docs.locusmap.eu is a completely outdated manual for Locus Map Classic, which will be abandoned next year).

This comment is in trash! Restore
photo
1

Michal, yes, that's what I assumed. Those articles are quite outdated.

Thanks for the support.

This comment is in trash! Restore
photo
1

I have made few more tests with MBTiles. All of them are downloaded/prepared by MOBAC, exactly the same way as I do with RMaps sqlitedb.

What I have discovered is that Locus 4 (4.31.3) doesn't treat MBTiles in the same way as RMaps sqlitedb.

First: Locus does not place/show MBTiles maps in the same folder as RMaps sqlitedb maps (under MAPS folder of OFFLINE maps), although I have placed them in the Locus-maps folder on my mobile phone. Please see attached Screenshot 1.

Second: As you may see from Screenshot 1, I have 3 MBTiles maps in folder OTM-TEST-MBTILES. However, as you may see from attached Screenshot 2, only one of those maps is displayed at a time (the one I choose to display). Others are invisible and Locus says "Map of the area is not available". If I choose to open another MBTiles map, Locus will show it. That happens regardless of zoom level. So, there is no maps auto-load even if I have this setting enabled.

Third: If I zoom in and out on the edge of a MBTiles map I get the situation as displayed on attached Screenshot 3. The edge area stays on zoom level 11 and the central part of the map zooms in properly (to 12-13-14-...).

I have never noticed such behaviour with RMaps sqlitedb. They always display correctly.

So, I wonder, am I missing something or doing something wrong ?

Separately of above, one more thing. I was playing/trying to convert MBTiles to RMaps sqlitedb and vice versa. I have written few python scripts for this purpose (and modified them several times). I have not succeed to do those conversions properly. When I load them in Locus, Locus always says it is unable to correctly parse the maps and doesn't show them at all (19:57:35.372 E setMenuAlignmentMode initializeMapNew(), unable to correctly parse: ../../storage/emulated/0/Locus/maps/OTM/1 Motovun OTM.mbtiles).

I presume there are some scripts or Apps that can properly do those conversions, but I am not aware of any.

This comment is in trash! Restore
photo
1

About convertion mbtiles to sqlitedb.

You need some tile number conversions:

x = tile_column
y = 2**zoom_level - tile_row - 1 \\ if metadata scheme = 'tms', or tile_row as is in case of 'xyz'
z = 17 - zoom_level
So, full sqlite queries list:

ATTACH DATABASE 'coverted.sqlitedb' as 'new';
CREATE TABLE new.tiles (x int, y int, z int, s int, image blob, PRIMARY KEY (x,y,z,s));
INSERT INTO new.tiles SELECT tile_column, if((select value from metadata where name = 'scheme') = 'xyz',tile_row,pow(2, zoom_level) - tile_row - 1), 17 - zoom_level, 0, tile_data FROM tiles;
CREATE TABLE new.info (maxzoom Int, minzoom Int);
INSERT INTO new.info SELECT min(z), max(z) from new.tiles;
(I was too lazy to write this for several years, but now it's done :)

This comment is in trash! Restore
photo
1

Hi Svjetlana,

the map auto-load works correctly if you:

- store all the maps in one folder

- choose "auto-load maps of any source" in the auto-load setup

This comment is in trash! Restore
photo
1

Thank you Evgeny. I will try that script when I catch some spare time.

The scripts I used before for conversion failed to produce correct maps. Locus would always report that it could not initialize/parse those maps. The obvious problem was in the internal structure of those converted maps/databases. I should have delved deeper into studying the structure of maps that work well in Locus.

Michal thanks, you are right, when I do what you wrote, the maps are shown - all of them regardless of the source and/or format. This is what I don't like very much because various charts are from different folders are displayed at the same time - something like overlays. However, it seems this is the only way I can see all the mbtiles maps from one folder displayed together, without switching between them manually.

In contrast, rmaps sqlitedb maps behave differently. If they are in the same folder, they are all displayed together without setting "auto-load maps of any source" in the auto-load setup, so there is no mixing of various maps (from various sources/folders) which I prefer.

This comment is in trash! Restore
photo
1

Try adding the suffix _split to the folder name. Undocumented hack since years. Using that I can see the maps separately.

This comment is in trash! Restore
photo
1

Thanks Michael. I have tried your tip. However, it doesn't work for me. Let's say the folder name is Test, I tried Test_split, Test split, Test _split. What ever I do, the result is the same, maps are messed up. I should emphasize here that I am talking about MBTiles maps (with rmaps sqlite no problem).

Attached screenshot 1 shows what I get if I don't enable "auto-load maps of any source". Only one map of three available in the folder Test are visible.

Attached screenshots 2, 3, 4 show what I get, under various zoom levels, if I enable "auto-load maps of any source". MBTiles maps (darker maps on top) and under them a rmaps sqlite map.

This comment is in trash! Restore
photo
1

Test_split is the equivalent of what I use. However, I was thinking of the separation of maps in the list in Locus, not on the screen. I have no map collection on my device that could replicate your scenario, sorry.

Cheers

Michael

This comment is in trash! Restore
Leave a Comment
 
Attach a file