Own overlay map

134 views
Skip to first unread message

Andreas Hofacker

unread,
Apr 9, 2019, 8:45:38 AM4/9/19
to Osmand
Hi all,

as an absolute beginner with OsmAnd, I'm trying to create my own overlay map.
I have georeferenced topographic maps 1:50.000 in .tif formatt and want to use them as an overlay in OsmAnd. Its only for private use and navigating. I tried serveral things (for example, I made with QGis .png tiles) but couldn't find a way how to do it. Any ideas or even  guidance?

With kind regards and many thanks in advance

Andreas

bartei...@gmail.com

unread,
Apr 9, 2019, 9:07:39 AM4/9/19
to Osmand
This video covers more of the topic than you need (it assumes your maps are not already georeferenced), but you may find
it useful.
https://youtu.be/Y_fekLfcUOc

bartei...@gmail.com

unread,
Apr 9, 2019, 8:06:28 PM4/9/19
to Osmand
I've also heard that QGIS and Mobile Atlas Creator can be used together to create overlays. But I've never done it. There might be a posting here on the forum.

Andreas Hofacker

unread,
Apr 10, 2019, 4:32:34 AM4/10/19
to Osmand
Hi Bart,

perfect. Exactely, what I was looking for. It worked very easy. Thank you very much.
The only problem I still have, is that the overlay maps are not sharp. The tif-files are about 4000 x 3000 px and in the preview sharp. On the device (Samsung S9+) not.  Do you have a idea, wht I can do to get shart overlays on the device?

All the best

Andreas

bartei...@gmail.com

unread,
Apr 10, 2019, 7:46:13 AM4/10/19
to Osmand
I'm afraid I don't have an answer. But assuming you're a licensee, you might contact (MAPC2MAPC creator) John Thorn directly. The few times I've done so, he's been responsive and helpful.

Akkana Peck

unread,
Apr 10, 2019, 9:13:14 PM4/10/19
to Osmand
Bart, your videos are wonderful, super clear. Alas, MAPC2MAPC doesn't
work for me as a Linux user. But seeing your breakdown of the steps
gave me some useful web search terms, and I was able to come up with
a way to do the same thing on Linux. I'm jazzed -- I've wanted this
for years and was never able to figure out how to do it before.

I wrote up what I learned, which might help other people who can't
use MAPC2MAPC: Making Overlay Maps for OsmAnd on Linux,
http://shallowsky.com/blog/mapping/osmand-making-overlay-maps.html

...Akkana

Andreas Hofacker

unread,
Apr 11, 2019, 9:38:59 AM4/11/19
to Osmand
Bart, thank you again. On my tablet, it works. Funny. Must have someting to do with the smartphome. I'll check it with John Thorne.

Cheers,

Andreas

bartei...@gmail.com

unread,
Apr 11, 2019, 8:19:02 PM4/11/19
to Osmand
@Akkana: I'm honored to be mentioned on your blog!

And I'm glad the video was of use. When I made it, I thought the topic was pretty escoteric. On the other hand, if there's an app that handles overlays as gracefully as OsmAnd, with that slider bar allowing you to shift between layers, I haven't seen it.

A Thompson

unread,
Apr 11, 2019, 9:23:57 PM4/11/19
to Osmand

On Wednesday, April 10, 2019 at 1:06:28 AM UTC+1, bartei...@gmail.com wrote:
I've also heard that QGIS and Mobile Atlas Creator can be used together to create overlays. But I've never done it. There might be a posting here on the forum.

This might be alluding to the time I posted my notes on this here, which were also just the result of googling other online guides. Since then, I've successfully loaded tile maps into OsmAnd skipping the creation of the sqlite file: just putting the directory hierarchy of .png tiles into a suitably named directory in the "tiles" directory of OsmAnd makes them available as a map source. (No .metainfo file at the top level as is needed for online tile sources.)

Does anyone know if creating a single sqlite file is beneficial? Just having the directory structure of .png tiles is easier to make, edit, and extend.

bartei...@gmail.com

unread,
Apr 12, 2019, 6:29:08 AM4/12/19
to Osmand
If I understand your post and link, you've worked out a way to produce an overlay entirely within QGIS. Yes? If so, I think that's significant, assuming, as you suspect, there's no big advantage to converting to a single sqlite file. Is sqlite more compact?

Akkana Peck

unread,
Apr 12, 2019, 1:25:13 PM4/12/19
to Osmand
bartei...@gmail.com writes:
> @Akkana: I'm honored to be mentioned on your blog!
>
> And I'm glad the video was of use. When I made it, I thought the topic was pretty escoteric. On the other hand, if there's an app that handles overlays as gracefully as OsmAnd, with that slider bar allowing you to shift between layers, I haven't seen it.

I agree. OsmAnd handles overlays beautifully, especially being able to
integrate two different rasters with the vector map like you show in
the video, and to do it all offline.

A Thompson writes:
> This might be alluding to the time I posted my notes on this here
> <https://groups.google.com/d/msg/osmand/WNTTAI_aCC8/Qk82yzfxBQAJ>

In fact, I did see that posting and found it very helpful (though I
needed a few more details you omitted), and should have credited
you. I've added that link to my blog post.

> Since then, I've
> successfully loaded tile maps into OsmAnd skipping the creation of the
> sqlite file: just putting the directory hierarchy of .png tiles into a
> suitably named directory in the "tiles" directory of OsmAnd makes them
> available as a map source. [ ... ]
> Does anyone know if creating a single sqlite file is beneficial? Just
> having the directory structure of .png tiles is easier to make, edit, and
> extend.

I'd like to know that too. The single .sqlitedb file seems cleaner and
easier to copy, but I wondered if it might be slower or more memory hungry.

bartei...@gmail.com writes:
> If I understand your post and link, you've worked out a way to produce an overlay entirely within QGIS. Yes? If so, I think that's significant, assuming, as you suspect, there's no big advantage to converting to a single sqlite file. Is sqlite more compact?

There's a QGIS plugin called QTiles that's supposed to produce
tiles, but it didn't work for me. But gdal2tiles can convert a geoTIFF
to a tile directory that works in HTML/JavaScript tiled viewers, and
I bet it would work in OsmAnd too.

I notice that QGIS's Save Layer dialog offers SQLite as a format, but
I haven't tried it; "SQLite" could be anything.

...Akkana

A Thompson

unread,
Apr 12, 2019, 8:41:59 PM4/12/19
to Osmand

On Friday, April 12, 2019 at 11:29:08 AM UTC+1, bartei...@gmail.com wrote:
If I understand your post and link, you've worked out a way to produce an overlay entirely within QGIS. Yes?
 
Yes. A directory hierarchy of PNG tiles is already the way that OsmAnd caches online tile sources, so presumably its not toooo inefficient. To make it work for OsmAnd each individual PNG tile has to have the filename extension .png.tile rather than just .png

I can't remember if QGIS QTiles can save with that file extension or whether one has to work out how to recursively rename all the *.png files to *.png.tile (easy in linux, obscure in windows but ok when you know how).

I'll take a look at this again soon if I get the chance.

My notes and sources referred to QGIS 2 (I used 2.18). The interface changed a lot when they brought out version 3 and some things seemed to be worse. All versions are available to download (and you can install more than one) so you can pick and choose.

I looked at the storage sizes. My experiment was just a crude rainfall map of the UK amounting to about a megabyte. The .sqlite was only slightly smaller than the directory hierarchy of tiles in this case.

Message has been deleted

A Thompson

unread,
Apr 13, 2019, 9:47:06 PM4/13/19
to Osmand
OK, I checked. QGIS QTiles is the same for QGIS 2 and 3 and hasn't changed since 2017.It doesn't give the option of altering the filename extension. 

So to use the directory hierarchy of tiles in OsmAnd without generating a .sqlite we have to recurse through the directory hierarchy that QTiles made and change *.png to *.png.tile

In Windows, I think the easiest way is to make yourself a file called addtile.bat containing the single line:
for /r %%x in (*.png) do ren "%%x" *.png.tile

Drop that .bat in the top level of the hierarchy and double-click to run it.

Alternatively, if you use Windows Powershell, navigate to the top level and do this:
Get-ChildItem -Recurse -Include *.png | Rename-Item -NewName { $_.Name.replace(".png",".png.tile") }

In Linux, a combination of find and rename (e.g. here) looks like it does the job, but I haven't tested this.


Reply all
Reply to author
Forward
0 new messages