Slippy maps from SD card

Goosien shared this idea 4 years ago
Completed

I have a set of JPG files using something along the lines of the Slippy naming convention.

In another app, I can specify in the custom 'online providers' list a map that uses 'file:' instead of 'http:' in order to use this in the app.

e.g. file:////storage/sdcard1/mymap/{z}/{x}/{y}.jpg

I've had a little look at MAPC2MAPC and I can use 'Work with online map sources' and add this folder as a map source. I did get to see a preview of this once and it looked fine, but not sure how I can get this into SQLite format- I presume this is the preferred method. It looks geared up to selecting an area and downloading, but by already having the collection of tiles, I already have my selection- I'll have all the tiles please!

Is it such a leap to have Locus use the Online Providers XML framework to pull maps from an SD Card?

I did try adding as an external map source in Locus, but it just took a very long time to do nothing- no extra maps were available to me.

Comments (4)

photo
1

Hello Goosien,

Locus is not able to read local files as source for slippy maps this way.

Please see there is article that describe how to prepare sqlitedb maps for Locus with Mapc2Mapc SW. I can also suggest to check Mobac SW that support local sources. Moback is also able to create sqlitedb format for Locus. Please see:

http://mobac.sourceforge.net/wiki/index.php/Local_Map_Sources or http://mobac.sourceforge.net/wiki/index.php/Custom_XML_Map_Sources

Please let me know if you were able to create sqlitedb map from the tiles.

Thank you

Regards Petr

photo
1

MOBAC turned out to be the best in the end. Took quite a bit of sussing, but at least the side bar is ordered to match the conversion process, so that guided any research into getting it to work.

First attempt failed and took a very long time, but when I made selections many and smaller (the snap to grid option was ace for this), to make up the same area, it ended up running reasonably quickly, maybe in an hour or so.

Thanks for the pointer.

Maybe one day Locus will support these files natively, it is 'only' a change between using http and the filesystem- the files aren't in an unsupported format, only an unsupported location!

photo
1

You may try one workaround.


If you rename all map tiles from 2202.png to 2202_png or 2202.png.tile, then when you add a root directory of this map with this tool http://docs.locusmap.eu/doku.php?id=manual:user_guide:maps_external , it should work.

photo
1

Wow, thanks. Almost there.


I tried initially with *.jpg.tile, but it didn't discover any maps. Converted to PNG and tried again as *.png.tile and that worked.


Only tried with zoom level 1 (4 tiles). It seemed to be geared up fine for map\z\x\y folder/file naming.


So, it would be extra handy if you could see your way clear to supporting *.jpg.tile ...?


Otherwise, I just need to search for a command-line image conversion tool and add that to my process :)

photo
1

Oki :). Done. So in next version ...

photo
1

Thanks, looks good.

photo