Skip to main content

Tile Schema

tile57's vector tiles use a fixed set of layers and fields. The generated MapLibre style depends on this schema, so the names are a contract. Do not rename a layer or a field without updating the style generator (src/style/maplibre.zig) to match and bumping the schema version.

This vocabulary is versioned as tile57/2. The tiles and the portrayal assets are generated from the same S-101 catalogue and stamped with that schema_version, so a renderer can refuse a schema it doesn't speak. Any change to a layer name or field key bumps it.

Every tile uses an extent of 4096 and a buffer of 64.

Live path coverage

Whether the tiles come from a pre-baked PMTiles archive or are generated live from a raw S-57 chart, the schema is the same. The live path (src/scene/) emits areas, area_patterns, lines, point_symbols, soundings, and text. Features carrying SCAMIN (attr 133) keep it as the per-feature scamin property, and every feature has a display_priority for S-52 fill ordering. DEPCNT lines carry valdco (the contour value, including the 0 m drying line) for line-centre labels. The same schema is encoded as MLT or MVT (see architecture).

Color is always a name

Fields like color_token and halo_color_token hold S-101 color names, not RGB values. The style resolves them against colortables.json to get the right Day, Dusk, or Night color — which is how a renderer switches palette without regenerating tiles.

Zoom levels and navigational bands

A nautical chart is not one map at one scale. NOAA compiles each chart (an ENC cell) for a navigational purpose — from a wide overview to a close-in berthing plan — and the right chart to show depends on how far you are zoomed in. Each chart carries a compilation scale (CSCL, a 1:N denominator) that maps to a band, and each band covers the Web-Mercator zoom range that matches its scale:

BandZoom range
Overview5 – 8
General8 – 10
Coastal10 – 12
Approach12 – 14
Harbor14 – 16
Berthing16 – 18

Vector tiles scale crisply, so a renderer overzooms the top level rather than baking more. Within a band, a feature may carry an S-52 SCAMIN (the scale below which it should disappear) as the per-feature scamin property; the style hides the feature once the display is coarser than 1:scamin, so minor features drop out at their own thresholds and the chart never clutters. (Earlier schema versions split these into separate *_scamin layers; tile57/2 folds them back into the base layers, gated by the per-feature property.)

The six layers

Every feature also carries shared metadata the style and the pick report read, regardless of layer:

FieldTypeMeaning
classstringS-57 object-class acronym.
cellstringSource chart stem.
s57stringThe feature's full S-57 attribute set as a JSON object (the pick report).
display_priorityintS-52 draw priority (fill/stroke ordering).
catintDisplay category (base / standard / other gating).
bandintNavigational band rank.
scaminintSCAMIN 1:N denominator — present only on features that carry one.

bnd, pts, plane, vg, and the date_* keys are additional gating properties emitted only when relevant. The layer-specific fields follow.

areas

Filled polygons, such as depth areas and land.

FieldTypeMeaning
color_tokenstringFill color name.
drval1, drval2numberDepth-range min/max for depth areas (DEPARE/DRGARE).
osclintOverscale denominator, present when the chart shows finer than its compilation scale.

area_patterns

Polygons filled with a repeating pattern instead of a flat color.

FieldTypeMeaning
pattern_namestringName of the fill pattern.
osclintOverscale denominator, as above.

lines

Stroked lines, such as depth contours and coastline. Symbolized/complex line runs and sector-light legs fold in here too.

FieldTypeMeaning
color_tokenstringStroke color name.
width_pxnumberStroke width in pixels.
dashstringDash pattern (empty = solid).
valdconumberContour value for DEPCNT lines (including the 0 m drying line), for line-centre labels.
ls_stylestringComplex line-style name (symbolized lines).
ls_arc0numberSector-arc start bearing (sector-light legs).

point_symbols

Single symbols placed at a point, such as buoys and beacons.

FieldTypeMeaning
symbol_namestringName of the symbol.
rotation_degnumberRotation in degrees.
rot_northint1 = hold the symbol north-up (line-placed and point symbols).
scalenumberScale factor.
danger_depth, sym_deepnumber, stringIsolated-danger depth + the deep-water symbol variant (the DANGER01/DANGER02 swap).

soundings

Depth soundings, drawn as digit glyph strings (SNDFRM digit composition).

FieldTypeMeaning
sym_s, sym_gstringBold + faint digit glyph strings, in metres.
sym_s_ft, sym_g_ftstringThe same glyph strings, in feet.
depthnumberSounding depth in metres.

text

Text labels (the name typically derives from OBJNAM via the featureName attribute).

FieldTypeMeaning
textstringThe label text.
font_size_pxnumberFont size in pixels.
color_tokenstringText color name.
halo_color_tokenstringHalo color name ("" = no halo).
halo_widthnumberHalo width in pixels (0 = none).
halign, valignstringHorizontal and vertical alignment.
loffstringPixel offset "ux,uy" from the anchor, present only when nonzero.
tgrpintS-52 text viewing group.