Skip to content

Commit

Permalink
more robustness against invalid Antarctica nodes
Browse files Browse the repository at this point in the history
This is another fix in the vein of 066ca0a

Testing Antarctica with this PR: 9m5s

The generated mbtiles doesn't seem to be convertible to a pmtiles file
-- `pmtiles convert` fails with:

```
main.go:162: Failed to convert /home/cldellow/src/basemap/tiles.mbtiles, Missing row
```

I've never generated Antarctica with the previous code, so I'm not sure
if this is specific to this PR or not.

My intuition is this is not specific to this PR. Wild guess is that
we're creating tiles with no features, due to https://github.com/systemed/tilemaker/blob/d470dc94fea6ae74e948c1a858c6e1228c9f4bf9/src/tile_worker.cpp#L210, and pmtiles doesn't like that.
  • Loading branch information
cldellow committed Dec 7, 2023
1 parent 06a72b1 commit 47bcf4a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/tile_data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ void TileDataSource::collectObjectsForTile(
TileCoordinate z6x = dstIndex.x / (1 << (zoom - CLUSTER_ZOOM));
TileCoordinate z6y = dstIndex.y / (1 << (zoom - CLUSTER_ZOOM));

if (z6x >= 64 || z6y >= 64) {
if (verbose) std::cerr << "collectObjectsForTile: invalid tile z" << zoom << "/" << dstIndex.x << "/" << dstIndex.y << std::endl;
return;
}
iStart = z6x * CLUSTER_ZOOM_WIDTH + z6y;
iEnd = iStart + 1;
}
Expand Down

0 comments on commit 47bcf4a

Please sign in to comment.