Read, bake and quilt raster charts - #48
Merged
Merged
Conversation
A raster chart is a chart made of pictures. tile57 reads two kinds. An MBTiles opens in place: SQLite reads it read-only with PRAGMA mmap_size, so a half-gigabyte file never becomes resident. The reader inverts the TMS row, calculates a zoom range and bounds the file omits, reads the tile size from a picture header, and ignores the file name — two measured charts declare minzoom 9 and maxzoom 17 and are named Z10-Z18. A BSB/KAP sheet bakes. fitRefs calculates the georeferencing from the sheet's control points, ellipsoidal and bivariate: the published PWY polynomial misses its own points by 7 km on a 1:10,000,000 sheet, spherical Mercator leaves 37 times the residual, and NOAA publishes sheets skewed 31 degrees. The bake applies the datum shift, warps to web mercator, clips to the PLY border, and writes the archive the ENC bake writes, with the PLY as coverage, KNP/SC as the compilation scale and CED as the date key. A sheet is refused when the fit misses its own control points. The scale decides the quilt. A baked sheet gives one and composes through the ownership partition by scale band and date. An MBTiles gives none, owns no ground, and the compositor skips it. mariner.chart_over_image removes the DEPARE, DRGARE, UNSARE and LNDARE fills so a raster chart below shows through, and keeps the contours, symbols, lights, soundings, text and pattern boundaries. It engages the S-52 10.3.4.2 DisplayPlane precedence, which applies when an image is below the chart. imageDim gives the dim factor for the colour scheme. tile57_raster_chart_* opens a raster chart and gives a tile. tile57_compose_rasters quilts them; one compositor holds one kind. tile57 bake takes a KAP or a BSB_ROOT, and tile57 raster info prints what a chart declares beside what its name claims. The PNG codec moves beside the tile formats and gains a decoder.
The flags set the mariner soundings switch. Use them to show spot soundings without the full OTHER category.
The page gives how to read a raster chart, what the reader corrects, why an absent tile is usual, how the scale decides the quilt, chart over picture, how to bake a BSB/KAP sheet and how to quilt them.
The raster underlay draws through the sprite pipeline with depth write, to hide the chart's area fills where a picture covers them. A baked RNC is transparent outside its neat line, and those pixels wrote depth and cut holes in the chart below. Costs nothing for a sprite or a glyph: both draw with depth write off, so this only skips a fragment that would blend to nothing.
The header, the feature list, the quickstart and the output table. Drops the WASM claim, which is an implementation detail of the web build and not finished.
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.
tile57_raster_chartis a peer oftile57_chart: it serves tiles and nothing else, so there is no portrayal to run, no pick to answer and no view to render. MBTiles opens in place through the vendored SQLite amalgamation, read-only and mmapped, so a half-gigabyte file never becomes resident.The reader corrects four things SQLite does not: it flips the TMS row to XYZ, ignores the zoom range in the file name, computes absent zoom and bounds from the tile index, and reads the tile size from a picture header. A missing tile is NULL with
TILE57_OK— about a third of the ground inside a coastal pyramid's own bounds carries no tile.raster.bsbreads a BSB/KAP sheet andtile57 bakewrites it to the same structure the ENC bake writes, carrying the sheet'sPLYborder,KNP/SCscale andCEDdate. The georeferencing comes fromfitRefsover the sheet'sREFpoints, not the publishedPWYpolynomial, which misses its own control points by 7 km on the North Pacific sheet. The fit is ellipsoidal and bivariate: the spherical form leaves 37 times the residual, and NOAA's skewed plotting sheets defeat a per-axis fit by 0.9°. A sheet whose fit cannot reproduce its own control points is refused by name.tile57_compose_rastersquilts them through the same ownership partition vector charts use — same scale bands, same date tie-break. A chart declaring no scale owns no ground and is skipped. One compositor holds one kind.mariner.chart_over_imagedrops theDEPARE,DRGARE,UNSAREandLNDAREfills for the outputs with no depth buffer, and engages the S-52 §10.3.4.2 DisplayPlane precedence.tile57_mariner_image_dimgives the dim factor so a daylight photograph does not destroy dark adaptation at night.tile57 raster infoprints what a chart declares beside what its name claims.Also here. The sprite shaders discard a fully transparent fragment.
--soundingsand--no-soundingson the png CLI.