Offline map, custom datum, and Yandex (RU).

Started by yip, May 07, 2015, 01:45:25 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

yip

Hi


QuoteIn short: custom projection cannot be set for mbtiles maps.

If forcibly set in the oruxmapsmaps.db internal database,   it is resetted at the next mapsources rescan.


QuoteIs it possible to force a custom projection over a mbtiles ?


OK, official specs of the mbtiles format defines only one projection: Mercator Spherical ... or something like this.

So theorically, one would never ever need to define a custom datum/proj when using MBtiles.



With that said, mbtiles is becoming the de-facto standard for offline maps.



Still, some TMS don't serves maps in this projection. It is the case of Yandex and probably many others.

Therefore, when building an offline map from this service, mbtiles format cannot be used.



For some reason, I cannot build a reliable map from this service with anything else than mbtiles.

When importing a mbtiles generated from yandex, there is the known offset bug, due to Yandex using MercatorEllipsoidal projection instead of Mercator Spherical (documented in another thread).

Oruxmaps already supports Yandex for online sources via the XML config file.



Now, for offline use, the only option is to convert mbtiles to the otrk2 format, which doesn't seem easy to me.

Another option would be to convert mbtiles to one of the mysterious, undocumented "rmap" formats and attach a custom datum to it. (I spent dozens of hours trying to achieve this, to no avail, see next post).



Last resort, I ended up tinkering the internal oruxmaps database and made it work (sort of) with standard yandex mbtiles:

small workaround for anyone coming across this post, trying to use yandex offline maps, in mbtiles format:

*** WARNING : technical and geek stuff ahead ***
Quote1. try to use Oruxmaps otrk2.xml format instead. no issue there. end.



2. import and load the mbtiles as usual (they will have the infamous offset for now)

3. Disable auto-reload of mapsource in settings

3. "root" your way to oruxmapsmaps.db and change PROJ from MERCATORESFERICA to MERCATORELIPSOIDAL with a sqlite editor

4. never rescan your mapsources or you will have to do step 3 again.


As always, orux, you provide an awesome app, I use it for a number of years, and totally love it.

This issue is not important, it is not very standard-compliant and probably isn't worth the time to investigate...

well it's for the record and info may be useful to others ;)



yip