Read 0-based BSB palettes, and bake from a caller-owned list - #56
Merged
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two changes, both needed to import raster charts from a host.
A BSB palette numbered from 0 crashed the bake. BSB numbers its palette from 1, so the parser indexed palette[idx - 1]. One sheet in 968 of a US West Coast set hit it. The header now records which number the file gave its first entry, and both places that read a colour index by it; pixel value 0 stops being treated as "no data" on those sheets. Tested both conventions.
tile57_bake_files and tile57_bake_rasters bake a caller-supplied list to caller-supplied paths, the counterpart to tile57_bake_tree. The caller owning the list is the point: label can name a finished chart by index so no string crosses the ABI, and a host that wants the coarse charts first sorts its own list that way, which is what makes a partly finished bake usable. The raster half writes partition.tpart beside the archives, as the CLI does, so a host does not rebuild the quilt at every open. A chart that will not bake is skipped rather than fatal — a BSB set routinely carries a sheet with no georeference.
tile57_info.is_raster tells a raster archive from a vector chart. Both open and both carry coverage and a scale, and tile_type cannot carry the difference because TILE57_TILE_TYPE_MLT is 2 and 2 is PNG in the PMTiles header. Without it a host composes an RNC as vector tiles.
Verified against 968 KAP sheets: all bake, 966 archives (two share a stem), and the two refusals are sheets with no georeference.