This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Unfortunately osmand's .sqlitedb and .mbtiles use the same table name, but with different columns | |
| alter table tiles rename to mbtiles; | |
| -- osmand uses inverted y numbering (compared to mbtiles) | |
| -- The formula to calculate inverted y is: y' = (2^z - 1) - y | |
| -- As sqlite does not support pow() function, here's a table of precalculated (2^z-1) for z from 0 to 25. | |
| create table maxy (y integer, z integer); | |
| CREATE UNIQUE INDEX IF NOT EXISTS maxy_index on maxy (z,y); | |
| insert into maxy(y,z) values(0,0); |