Skip to content

Commit

Permalink
fix(cli): mbtiles have inverted y axis
Browse files Browse the repository at this point in the history
TODO should this be covered here, most likely no..
  • Loading branch information
blacha committed Apr 4, 2021
1 parent 7779cf2 commit 8803da5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/cli/src/create/mbtiles.to.ttiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ export async function toTarTiles(
for await (const { tile, index, total } of readMbTiles(fileName, limit)) {
if (index === 0) logger.info({ path: tarFileName, count: total }, 'Covt.Tar:Start');

const tileName = xyzToPath(tile.tile_column, tile.tile_row, tile.zoom_level);
const x = tile.tile_column;
const z = tile.zoom_level;
const y = (1 << z) - 1 - tile.tile_row;

const tileName = xyzToPath(x, y, z);
const tileData = decompress ? zlib.gunzipSync(tile.tile_data) : tile.tile_data;
packer.entry({ name: tileName }, tileData);
if (writeCount % 25_000 === 0) {
Expand Down

0 comments on commit 8803da5

Please sign in to comment.