mbtiles2osmand icon indicating copy to clipboard operation
mbtiles2osmand copied to clipboard

new flag -TMS

Open mariush444 opened this issue 5 years ago • 1 comments

there is conversion y = 2 ** z - 1 - y for the case where mbtiles are in x-y-zoom Google's format and we need them in TMS format for Osmand but some mbtiles are already in TMS format so my idea is to add flag/parameter

parser.add_argument('-TMS', action='store_true', help='convert tiles from TMS standard instead Google x y zoom')

and change line y = 2 ** z - 1 - y to if(args.TMS): y = 2 ** z - 1 - y

mariush444 avatar Dec 16 '20 14:12 mariush444

Requires analysis.

MBTiles spec: https://github.com/mapbox/mbtiles-spec/blob/master/1.3/spec.md

columns MUST encode the location of the tile, following the Tile Map Service Specification, with the restriction that the global-mercator (aka Spherical Mercator) profile MUST be used.

But I don't understand which format uses OsmAnd.

https://github.com/osmandapp/Osmand/blob/master/OsmAnd/src/net/osmand/plus/SQLiteTileSource.java

There are some interesting properties: inverted_y, tilenumbering, BIG_PLANET_TILE_NUMBERING.

I'll analyze it later.

tarwirdur avatar Jan 06 '21 22:01 tarwirdur