Skip to content

Commit

Permalink
Always use minzoom/maxzoom from header, ignore minzoom/maxzoom metada…
Browse files Browse the repository at this point in the history
…ta (#20)

In workflows where MBTiles are converted to PMTiles, we might end up
with the minzoom/maxzoom string attributes from the MBTiles metatada
table in the PMTiles JSON metadata. If we copied that over, we would end
up with string values in the TileJSON, confusing/breaking clients.
  • Loading branch information
ssiegel authored Aug 16, 2023
1 parent 408a10a commit cb20c5d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/async_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ impl<B: AsyncBackend + Sync + Send> AsyncPmTilesReader<B> {
tj.name = Some(v);
} else if key == "version" {
tj.version = Some(v);
} else if key == "minzoom" || key == "maxzoom" {
// We already have the correct values from the header, so just drop these
// attributes from the metadata silently, don't overwrite known-good values.
} else {
tj.other.insert(key, Value::String(v));
}
Expand Down

0 comments on commit cb20c5d

Please sign in to comment.