@chrtco/sdk 0.10.10 → 0.10.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +148 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +111 -1
- package/dist/index.d.ts +111 -1
- package/dist/index.js +137 -20
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2578,6 +2578,81 @@ declare function daymarkColor(props: Record<string, unknown>, ct?: ColorTableNam
|
|
|
2578
2578
|
* Defines which layers get text labels and how to extract label text.
|
|
2579
2579
|
*/
|
|
2580
2580
|
|
|
2581
|
+
/**
|
|
2582
|
+
* Feature-class hierarchy for SEAARE labels. Returns a tier number 1-5 per
|
|
2583
|
+
* feature:
|
|
2584
|
+
*
|
|
2585
|
+
* Exported (with the other tier builders below) for the build-side parity
|
|
2586
|
+
* test: CHRTbaremetal replicates these taxonomies as data in
|
|
2587
|
+
* tools/chrt-baremetal/server/src/tilebuild/placeNameTiers.ts to stamp
|
|
2588
|
+
* `tier` onto PLACENAME index features, and
|
|
2589
|
+
* placename-tier-parity.test.ts evaluates the two against shared
|
|
2590
|
+
* fixtures. Change a branch here and that test names the drift.
|
|
2591
|
+
*
|
|
2592
|
+
* 1 — Ocean (OBJNAM contains "<X> Ocean" — CATSEA has no
|
|
2593
|
+
* ocean code; the attribute is 1/unset on oceans)
|
|
2594
|
+
* 2 — Sea / Gulf (OBJNAM "Gulf of …" / "… Sea")
|
|
2595
|
+
* 3 — Bay / Sound / (CATSEA in {5 bay, 12 narrows} OR OBJNAM
|
|
2596
|
+
* Strait / Narrows " Bay" / " Sound" / " Strait")
|
|
2597
|
+
* 4 — Anchorage detail (OBJNAM contains "Anchorage Area")
|
|
2598
|
+
* 5 — Relief + default (CATSEA relief codes — authoritative — or
|
|
2599
|
+
* relief-term names, or anything uncategorised;
|
|
2600
|
+
* suppressed below z9 by the size curve)
|
|
2601
|
+
*
|
|
2602
|
+
* Order matters: tier-4/5 demotions (anchorages, relief) run BEFORE the
|
|
2603
|
+
* promotion shims so "Bear Seamount" (contains " Sea") and "…Anchorage
|
|
2604
|
+
* Area" compound names can't bubble up into headline tiers.
|
|
2605
|
+
* `coalesce(CATSEA, catsea)` handles post-tippecanoe case variation
|
|
2606
|
+
* (matches `s52-conditional.ts` precedent).
|
|
2607
|
+
*/
|
|
2608
|
+
declare function buildSeaAreaTierExpression(): ExpressionSpecification;
|
|
2609
|
+
/**
|
|
2610
|
+
* Built-up area tier (BUAARE): major city / town / neighborhood.
|
|
2611
|
+
* 1 — Major city (CATBUA=1 urban, or OBJNAM length <= 8)
|
|
2612
|
+
* 2 — Town (CATBUA=5 village, or OBJNAM length <= 14)
|
|
2613
|
+
* 3 — Neighborhood (longer compound names)
|
|
2614
|
+
*
|
|
2615
|
+
* Tier 1/2 may fire via CATBUA when populated; OBJNAM length is the
|
|
2616
|
+
* fallback so unpopulated CATBUA still produces a usable hierarchy.
|
|
2617
|
+
*/
|
|
2618
|
+
declare function buildBuiltUpAreaTierExpression(): ExpressionSpecification;
|
|
2619
|
+
/**
|
|
2620
|
+
* Land region tier (LNDRGN): major region vs. local point.
|
|
2621
|
+
* 1 — Major region (OBJNAM length <= 12 AND no comma — "Long Island", "Cape Cod")
|
|
2622
|
+
* 2 — Local point (else — "Bird Island", "Cottage Park")
|
|
2623
|
+
*
|
|
2624
|
+
* No CATLND analog for region scope, so OBJNAM is the only signal.
|
|
2625
|
+
* The comma-absence test is a heuristic: NOAA compound names like
|
|
2626
|
+
* "Boston Harbor, MA Castle Island" carry a comma and belong at deeper
|
|
2627
|
+
* zoom regardless of length.
|
|
2628
|
+
*/
|
|
2629
|
+
declare function buildLandRegionTierExpression(): ExpressionSpecification;
|
|
2630
|
+
/**
|
|
2631
|
+
* Land area tier (LNDARE): major vs. local.
|
|
2632
|
+
* 1 — Major (OBJNAM length <= 12)
|
|
2633
|
+
* 2 — Local
|
|
2634
|
+
*
|
|
2635
|
+
* No category attribute. OBJNAM length is the only signal.
|
|
2636
|
+
*/
|
|
2637
|
+
declare function buildLandAreaTierExpression(): ExpressionSpecification;
|
|
2638
|
+
/**
|
|
2639
|
+
* Lake tier (LAKARE): lake vs. reservoir/pond.
|
|
2640
|
+
* 1 — Lake (CATLAK=1, or OBJNAM length <= 12)
|
|
2641
|
+
* 2 — Reservoir/pond (CATLAK in {2,3}, or longer name)
|
|
2642
|
+
*/
|
|
2643
|
+
declare function buildLakeTierExpression(): ExpressionSpecification;
|
|
2644
|
+
/**
|
|
2645
|
+
* River tier (RIVERS): major vs. local.
|
|
2646
|
+
* 1 — Major river (OBJNAM length <= 15 AND no comma)
|
|
2647
|
+
* 2 — Local creek (else)
|
|
2648
|
+
*/
|
|
2649
|
+
declare function buildRiverTierExpression(): ExpressionSpecification;
|
|
2650
|
+
/**
|
|
2651
|
+
* Airport tier (AIRARE): major airport vs. small airstrip.
|
|
2652
|
+
* 1 — Major (OBJNAM length <= 25 — e.g. "Logan International Airport")
|
|
2653
|
+
* 2 — Airstrip
|
|
2654
|
+
*/
|
|
2655
|
+
declare function buildAirportTierExpression(): ExpressionSpecification;
|
|
2581
2656
|
interface LabelLayerConfig {
|
|
2582
2657
|
/** Mapbox source layer type */
|
|
2583
2658
|
type: "symbol";
|
|
@@ -2754,6 +2829,22 @@ declare function isNavAidLayer(layerName: string): boolean;
|
|
|
2754
2829
|
* Computes a simple average-coordinate centroid for each polygon feature that has OBJNAM.
|
|
2755
2830
|
*/
|
|
2756
2831
|
declare function preprocessWaterBodies(fc: GeoJSON.FeatureCollection): GeoJSON.FeatureCollection;
|
|
2832
|
+
/** MVT layer the build-side place-name index emits. */
|
|
2833
|
+
declare const PLACENAME_SOURCE_LAYER = "PLACENAME";
|
|
2834
|
+
/** Orientation classes whose names render italic (water voice). */
|
|
2835
|
+
declare const PLACENAME_WATER_CLASSES: readonly string[];
|
|
2836
|
+
/** Orientation classes whose names render upright (land voice). */
|
|
2837
|
+
declare const PLACENAME_LAND_CLASSES: readonly string[];
|
|
2838
|
+
/**
|
|
2839
|
+
* The 2 PLACENAME symbol layers. Layout contract (design §2.2): collision
|
|
2840
|
+
* ON (`allow-overlap: false`, `ignore-placement: false`,
|
|
2841
|
+
* `optional: true`), padding 4, `text-variable-anchor`, and
|
|
2842
|
+
* `symbol-sort-key` straight from the build-side `rank` — MapLibre places
|
|
2843
|
+
* LOWER sort keys first, and rank is minted lower-is-more-important
|
|
2844
|
+
* (tier major, bbox area minor), so when space runs out the biggest names
|
|
2845
|
+
* survive. That ranking is the per-zoom density governor P4 asked for.
|
|
2846
|
+
*/
|
|
2847
|
+
declare function buildPlaceNameLayers(sourceId: string): maplibregl.LayerSpecification[];
|
|
2757
2848
|
|
|
2758
2849
|
/**
|
|
2759
2850
|
* Spatial grid-based feature decimation for performance at low zoom levels.
|
|
@@ -3262,6 +3353,25 @@ interface StyleGeneratorOptions extends BuildSourcesOptions {
|
|
|
3262
3353
|
* When false, all soundings render in a single shade. Default true.
|
|
3263
3354
|
*/
|
|
3264
3355
|
twoShadeSoundings?: boolean;
|
|
3356
|
+
/**
|
|
3357
|
+
* Label model for the 9 orientation place-name classes (SEAARE, LNDRGN,
|
|
3358
|
+
* LAKARE, RIVERS, CANALS, BUAARE, AIRARE, LNDARE, PRDARE).
|
|
3359
|
+
*
|
|
3360
|
+
* "legacy" (default) — the per-cell-band orientation fan
|
|
3361
|
+
* (fanOrientationLabelByCellBand): one label per feature per band,
|
|
3362
|
+
* deconflicted only by `_label_anchor` tags and watermark opacity.
|
|
3363
|
+
*
|
|
3364
|
+
* "placename" — 2 PLACENAME symbol layers over the build-side
|
|
3365
|
+
* place-name index (CHRTbaremetal placeNameIndex.ts): one collision-
|
|
3366
|
+
* managed label per named place with a per-feature zoom window; the
|
|
3367
|
+
* orientation fan for those classes is NOT emitted. Requires tiles
|
|
3368
|
+
* built with the PLACENAME side index — on older tiles the layers
|
|
3369
|
+
* simply draw nothing (soft-fail is index-side), which is why the
|
|
3370
|
+
* default stays "legacy" until L2c's rebuild + Maine-coast visual
|
|
3371
|
+
* verification flips it (docs/design/chart-label-deconfliction.md
|
|
3372
|
+
* §2.3). Feature-label classes are untouched either way.
|
|
3373
|
+
*/
|
|
3374
|
+
labels?: "legacy" | "placename";
|
|
3265
3375
|
/**
|
|
3266
3376
|
* Font weight for SOUNDG labels. Default "semibold" — crisper numerals
|
|
3267
3377
|
* at small sizes on screen.
|
|
@@ -4310,4 +4420,4 @@ declare class Chrt {
|
|
|
4310
4420
|
warmTiles(region?: string): Promise<void>;
|
|
4311
4421
|
}
|
|
4312
4422
|
|
|
4313
|
-
export { ALL_NAV_AID_LAYERS, ALL_WATER_BODY_LAYERS, AREA_QUERY_LAYERS, ATON_EXPRESSION_CLASSES, type AheadCoverageCell, type AheadFeatureProperties, type AheadOptions, type AheadResponse, type AlongRouteFeatureProperties, type AlongRouteOptions, type AlongRouteResponse, type AreaInspectResult, type AtlasStyle, type AttachOptions, BAND_DRAW_ORDER, BAND_PRIORITY_RANGES, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, type BandCode, type BandPriorityRange, type BridgeInspectResult, type BuildOfflineStyleOptions, type BuildSourcesOptions, CHART_BAND_CODES, CHART_CASCADE_CODES, CHART_SECTIONS, CHRTRASTER_REF_CROPS, CHRTRASTER_SVGS, CHRT_ATON_COLORS, CHRT_GLYPH_NAMES, CHRT_GLYPH_SVGS, CHRT_ICON_EXPRESSIONS, CHRT_ICON_PREFIX, CHRT_SDF_GLYPHS, CHRT_STYLE_MODES, type CandidateQueryOptions, type CandidatesEventContext, type CellDeletedEvent, type CellDetail, type CellEventData, type CellNewEvent, type CellUpdatedData, type CellUpdatedEvent, type CellsOptions, type CellsResponse, type ChartSection, Chrt, type ChrtConfig, ChrtError, type ChrtStyleMode, type ChrtStyleOptions, type ChrtStyleTheme, type ChrtSymbolSet, type ClickAnchor, ColorTableName, type CoverageOptions, type CoverageResponse, type CoverageRouteCell, type CoverageRouteOptions, type CoverageRouteResponse, type CoverageSource, type CustomStyleConfig, DEFAULT_CLICK_TOLERANCE, DEFAULT_CUSTOM_STYLE_CONFIG, DEFAULT_INSPECT_CLASS_RANK, DEFAULT_LABEL_SETTINGS, DEFAULT_NAV_AID_SETTINGS, DEFAULT_REGION, DEFAULT_SAFETY_CONTOUR_M, DEFAULT_SOUNDING_SETTINGS, DEFAULT_TILE_BASE_URL, DEFAULT_TILE_REGION, DEFAULT_WATER_BODY_SETTINGS, type DecodedAreaFeature, type DecodedBridge, type DecodedNavAid, type DecodedProperty, type DisplayCategory, type DisplayMode, type FeatureCollection, type FeaturesOptions, type FetchStyleOptions, FileSystemAdapter, type FlashPattern, type FlashPhase, type GenerateCustomStyleOptions, type GeneratedCustomStyle, type GeoJsonFeature, type GeoJsonGeometry, type GeomType, INSPECT_CLASS_RANK, INSPECT_RANK_DEVIATIONS, type InspectCandidate, type InspectCandidateSet, type InspectEnrichment, type InspectEventContext, type InspectNotice, type InspectOptions, type InspectResult, type InspectTargetClass, type InspectableFeature, InteractClient, type InteractEntitlement, InteractError, type InteractErrorCode, type InteractHandle, type InteractMapLike, type InteractMapMouseEvent, LABELED_LAYERS, LABEL_BEHAVIOR, LABEL_LAYER_GROUPS, LABEL_PRIORITY, LAND_REGION, type LabelBehavior, type LabelConfigOptions, type LabelLayerConfig, type LabelSettings, type LookupEntry, type MapLibreStyle, type MapboxStyle, type MapboxVectorSource, type MarineAlert, type MarineAlertsOptions, type MarineAlertsResponse, type MarineConditionsOptions, type MarineConditionsResponse, type MarineForecastOptions, type MarineForecastPeriod, type MarineForecastResponse, type MarineSeas, type MarineStation, type MarineSwellTrain, type MarineWind, type MarineZoneRef, NAUTICAL_SYMBOLS, NAV_AID_LAYER_GROUPS, NAV_AID_QUERY_LAYERS, NON_SOLAS_DISCLAIMER, NON_SOLAS_DISCLAIMER_SHORT, type NauticalCategory, type NauticalSymbol, type NavAidInspectResult, type NavAidSettings, type NearbyMarineStation, type OfflineBundleResponse, type OfflineDownloadOptions, type OfflineDownloadProgress, type OfflineDownloadResult, OfflineError, type OfflineErrorCode, type OfflineFetchStyleOptions, type OfflineHeartbeatOptions, type OfflineRegionSummary, type OfflineRemoveOptions, OfflineStyleError, type OfflineStylePlatform, type OfflineStyleResponse, type PmtilesVectorSource, type QueryFeatureProperties, type QueryOptions, type QueryResponse, RASTER_ATON_CLASSES, RASTER_GLYPH_NAMES, RASTER_ICON_PREFIX, RELIEF_REGION, type ResolvedStyle, type ResolvedTheme, type S101ArtworkProvenance, type S101Feature, S101_AREA_FILL_NAMES, S101_CHART_SECTIONS, S101_FEATURES, S101_ICON_PREFIX, S101_LINE_STYLE_NAMES, S101_NEW_SYMBOLS, S101_NO_OFFICIAL_COUNTERPART, S101_SOURCE_COMMIT, S101_SYMBOL_GROUPS, S101_SYMBOL_NAMES, S52_ATON_LOOKUPS, S52_ATON_LOOKUPS_PAPER, S52_DRAW_ORDER, S52_LOOKUP, S52_PATTERN_SPRITE_PREFIX, SOUNDING_LAYERS, SYMBOL_FAMILIES, SYMBOL_FAMILY_META, SYMBOL_GROUPS, SYMBOL_MAP, type ScaleBand, type SearchCoverageNotice, type SearchHit, type SearchOptions, type SearchResponse, type SectorArcFeature, type SectorArcFeatureCollection, type SectorInfo, type SoundingSettings, type SourceMode, type StyleGeneratorOptions, type StyleLayer, type StyleUrlOptions, type SymbolFamily, type SymbolFamilyMeta, type SymbolGroup, TileAuth, type TileGroup, type TileGroupsResponse, TileTokenError, type TileTokenErrorCode, type TileTokenResponse, type TransformRequest, type TransformedRequest, type VectorSourceSpec, type VesselProfile, WATER_BODY_LAYER_GROUPS, type WaterBodySettings, WeatherEndpoint, type WeatherReading, type WebhookEvent, type WebhookEventType, type WebhookPayload, applyChrtSymbolSet, applyColorTheme, applyCustomStyleSettings, applyRasterSymbolSet, applyS101SymbolSet, atonIconExpression, bandFilterExpression, buildFlashPattern, buildLabelLayer, buildLayersForClass, buildOfflineStyle, buildSectorArcGeoJSON, buildSectorArcsFC, buildSectorsFromFeatures, buildSources, candidateRank, chrtAtonTintExpression, chrtLightTintExpression, collectCandidates, collectClickCandidates, combineWithBandFilter, daymarkColor, decimateFeatures, decodeAreaFeatureProps, decodeBridgeProps, decodeCandidate, decodeNavAidProps, depareColor, depareFillExpression, deriveMarinerName, extractNavAidDesignation, featureIdentity, generateCustomStyle, generateSpriteManifest, generateSpriteSheet, generateStyle, generateStyleJSON, getAvailableLineSymbols, getAvailablePatterns, getAvailablePointSymbols, getCollisionSettings, getDrawPriority, getGridSizeForZoom, getIconExpression, getLabelBehavior, getLabelConfig, getLabelPriority, getLookupEntry, getMaxCellsForZoom, getOrderedClasses, getRasterSvg, getS52SvgString, getS52SymbolStats, getStyleStats, getSymbolSvgString, getThemedS101Svg, getThemedS52Svg, getTopmarkMeaning, hazardColor, hazardFillExpression, iconExpressionForFamily, isLabelLayerVisible, isNavAidLayer, isNavAidLayerVisible, isSoundingLayerVisible, isVisibleInMode, isWaterBodyLayerVisible, labelSortKey, lateralColor, lateralFillExpression, lightColor, lightFillExpression, lightsIconExpression, normalizeStyleMode, normalizeTheme, paginate, parseListCodes, parseSymbolFamily, parseWebhook, patternSpriteId, preprocessLights, preprocessNavAids, preprocessSoundings, preprocessWaterBodies, rasterAtonIconExpression, resolveCustomTheme, resolveRasterImage, resolveS101Color, resolveStyle, resolveTargetClass, s101ArtworkProvenance, sanitizeCustomStyleConfig, scaleSizeValue, scaminToMinZoom, styleModeBand, withinBboxFilter, worldMinusBboxPolygon };
|
|
4423
|
+
export { ALL_NAV_AID_LAYERS, ALL_WATER_BODY_LAYERS, AREA_QUERY_LAYERS, ATON_EXPRESSION_CLASSES, type AheadCoverageCell, type AheadFeatureProperties, type AheadOptions, type AheadResponse, type AlongRouteFeatureProperties, type AlongRouteOptions, type AlongRouteResponse, type AreaInspectResult, type AtlasStyle, type AttachOptions, BAND_DRAW_ORDER, BAND_PRIORITY_RANGES, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, type BandCode, type BandPriorityRange, type BridgeInspectResult, type BuildOfflineStyleOptions, type BuildSourcesOptions, CHART_BAND_CODES, CHART_CASCADE_CODES, CHART_SECTIONS, CHRTRASTER_REF_CROPS, CHRTRASTER_SVGS, CHRT_ATON_COLORS, CHRT_GLYPH_NAMES, CHRT_GLYPH_SVGS, CHRT_ICON_EXPRESSIONS, CHRT_ICON_PREFIX, CHRT_SDF_GLYPHS, CHRT_STYLE_MODES, type CandidateQueryOptions, type CandidatesEventContext, type CellDeletedEvent, type CellDetail, type CellEventData, type CellNewEvent, type CellUpdatedData, type CellUpdatedEvent, type CellsOptions, type CellsResponse, type ChartSection, Chrt, type ChrtConfig, ChrtError, type ChrtStyleMode, type ChrtStyleOptions, type ChrtStyleTheme, type ChrtSymbolSet, type ClickAnchor, ColorTableName, type CoverageOptions, type CoverageResponse, type CoverageRouteCell, type CoverageRouteOptions, type CoverageRouteResponse, type CoverageSource, type CustomStyleConfig, DEFAULT_CLICK_TOLERANCE, DEFAULT_CUSTOM_STYLE_CONFIG, DEFAULT_INSPECT_CLASS_RANK, DEFAULT_LABEL_SETTINGS, DEFAULT_NAV_AID_SETTINGS, DEFAULT_REGION, DEFAULT_SAFETY_CONTOUR_M, DEFAULT_SOUNDING_SETTINGS, DEFAULT_TILE_BASE_URL, DEFAULT_TILE_REGION, DEFAULT_WATER_BODY_SETTINGS, type DecodedAreaFeature, type DecodedBridge, type DecodedNavAid, type DecodedProperty, type DisplayCategory, type DisplayMode, type FeatureCollection, type FeaturesOptions, type FetchStyleOptions, FileSystemAdapter, type FlashPattern, type FlashPhase, type GenerateCustomStyleOptions, type GeneratedCustomStyle, type GeoJsonFeature, type GeoJsonGeometry, type GeomType, INSPECT_CLASS_RANK, INSPECT_RANK_DEVIATIONS, type InspectCandidate, type InspectCandidateSet, type InspectEnrichment, type InspectEventContext, type InspectNotice, type InspectOptions, type InspectResult, type InspectTargetClass, type InspectableFeature, InteractClient, type InteractEntitlement, InteractError, type InteractErrorCode, type InteractHandle, type InteractMapLike, type InteractMapMouseEvent, LABELED_LAYERS, LABEL_BEHAVIOR, LABEL_LAYER_GROUPS, LABEL_PRIORITY, LAND_REGION, type LabelBehavior, type LabelConfigOptions, type LabelLayerConfig, type LabelSettings, type LookupEntry, type MapLibreStyle, type MapboxStyle, type MapboxVectorSource, type MarineAlert, type MarineAlertsOptions, type MarineAlertsResponse, type MarineConditionsOptions, type MarineConditionsResponse, type MarineForecastOptions, type MarineForecastPeriod, type MarineForecastResponse, type MarineSeas, type MarineStation, type MarineSwellTrain, type MarineWind, type MarineZoneRef, NAUTICAL_SYMBOLS, NAV_AID_LAYER_GROUPS, NAV_AID_QUERY_LAYERS, NON_SOLAS_DISCLAIMER, NON_SOLAS_DISCLAIMER_SHORT, type NauticalCategory, type NauticalSymbol, type NavAidInspectResult, type NavAidSettings, type NearbyMarineStation, type OfflineBundleResponse, type OfflineDownloadOptions, type OfflineDownloadProgress, type OfflineDownloadResult, OfflineError, type OfflineErrorCode, type OfflineFetchStyleOptions, type OfflineHeartbeatOptions, type OfflineRegionSummary, type OfflineRemoveOptions, OfflineStyleError, type OfflineStylePlatform, type OfflineStyleResponse, PLACENAME_LAND_CLASSES, PLACENAME_SOURCE_LAYER, PLACENAME_WATER_CLASSES, type PmtilesVectorSource, type QueryFeatureProperties, type QueryOptions, type QueryResponse, RASTER_ATON_CLASSES, RASTER_GLYPH_NAMES, RASTER_ICON_PREFIX, RELIEF_REGION, type ResolvedStyle, type ResolvedTheme, type S101ArtworkProvenance, type S101Feature, S101_AREA_FILL_NAMES, S101_CHART_SECTIONS, S101_FEATURES, S101_ICON_PREFIX, S101_LINE_STYLE_NAMES, S101_NEW_SYMBOLS, S101_NO_OFFICIAL_COUNTERPART, S101_SOURCE_COMMIT, S101_SYMBOL_GROUPS, S101_SYMBOL_NAMES, S52_ATON_LOOKUPS, S52_ATON_LOOKUPS_PAPER, S52_DRAW_ORDER, S52_LOOKUP, S52_PATTERN_SPRITE_PREFIX, SOUNDING_LAYERS, SYMBOL_FAMILIES, SYMBOL_FAMILY_META, SYMBOL_GROUPS, SYMBOL_MAP, type ScaleBand, type SearchCoverageNotice, type SearchHit, type SearchOptions, type SearchResponse, type SectorArcFeature, type SectorArcFeatureCollection, type SectorInfo, type SoundingSettings, type SourceMode, type StyleGeneratorOptions, type StyleLayer, type StyleUrlOptions, type SymbolFamily, type SymbolFamilyMeta, type SymbolGroup, TileAuth, type TileGroup, type TileGroupsResponse, TileTokenError, type TileTokenErrorCode, type TileTokenResponse, type TransformRequest, type TransformedRequest, type VectorSourceSpec, type VesselProfile, WATER_BODY_LAYER_GROUPS, type WaterBodySettings, WeatherEndpoint, type WeatherReading, type WebhookEvent, type WebhookEventType, type WebhookPayload, applyChrtSymbolSet, applyColorTheme, applyCustomStyleSettings, applyRasterSymbolSet, applyS101SymbolSet, atonIconExpression, bandFilterExpression, buildAirportTierExpression, buildBuiltUpAreaTierExpression, buildFlashPattern, buildLabelLayer, buildLakeTierExpression, buildLandAreaTierExpression, buildLandRegionTierExpression, buildLayersForClass, buildOfflineStyle, buildPlaceNameLayers, buildRiverTierExpression, buildSeaAreaTierExpression, buildSectorArcGeoJSON, buildSectorArcsFC, buildSectorsFromFeatures, buildSources, candidateRank, chrtAtonTintExpression, chrtLightTintExpression, collectCandidates, collectClickCandidates, combineWithBandFilter, daymarkColor, decimateFeatures, decodeAreaFeatureProps, decodeBridgeProps, decodeCandidate, decodeNavAidProps, depareColor, depareFillExpression, deriveMarinerName, extractNavAidDesignation, featureIdentity, generateCustomStyle, generateSpriteManifest, generateSpriteSheet, generateStyle, generateStyleJSON, getAvailableLineSymbols, getAvailablePatterns, getAvailablePointSymbols, getCollisionSettings, getDrawPriority, getGridSizeForZoom, getIconExpression, getLabelBehavior, getLabelConfig, getLabelPriority, getLookupEntry, getMaxCellsForZoom, getOrderedClasses, getRasterSvg, getS52SvgString, getS52SymbolStats, getStyleStats, getSymbolSvgString, getThemedS101Svg, getThemedS52Svg, getTopmarkMeaning, hazardColor, hazardFillExpression, iconExpressionForFamily, isLabelLayerVisible, isNavAidLayer, isNavAidLayerVisible, isSoundingLayerVisible, isVisibleInMode, isWaterBodyLayerVisible, labelSortKey, lateralColor, lateralFillExpression, lightColor, lightFillExpression, lightsIconExpression, normalizeStyleMode, normalizeTheme, paginate, parseListCodes, parseSymbolFamily, parseWebhook, patternSpriteId, preprocessLights, preprocessNavAids, preprocessSoundings, preprocessWaterBodies, rasterAtonIconExpression, resolveCustomTheme, resolveRasterImage, resolveS101Color, resolveStyle, resolveTargetClass, s101ArtworkProvenance, sanitizeCustomStyleConfig, scaleSizeValue, scaminToMinZoom, styleModeBand, withinBboxFilter, worldMinusBboxPolygon };
|
package/dist/index.d.ts
CHANGED
|
@@ -2578,6 +2578,81 @@ declare function daymarkColor(props: Record<string, unknown>, ct?: ColorTableNam
|
|
|
2578
2578
|
* Defines which layers get text labels and how to extract label text.
|
|
2579
2579
|
*/
|
|
2580
2580
|
|
|
2581
|
+
/**
|
|
2582
|
+
* Feature-class hierarchy for SEAARE labels. Returns a tier number 1-5 per
|
|
2583
|
+
* feature:
|
|
2584
|
+
*
|
|
2585
|
+
* Exported (with the other tier builders below) for the build-side parity
|
|
2586
|
+
* test: CHRTbaremetal replicates these taxonomies as data in
|
|
2587
|
+
* tools/chrt-baremetal/server/src/tilebuild/placeNameTiers.ts to stamp
|
|
2588
|
+
* `tier` onto PLACENAME index features, and
|
|
2589
|
+
* placename-tier-parity.test.ts evaluates the two against shared
|
|
2590
|
+
* fixtures. Change a branch here and that test names the drift.
|
|
2591
|
+
*
|
|
2592
|
+
* 1 — Ocean (OBJNAM contains "<X> Ocean" — CATSEA has no
|
|
2593
|
+
* ocean code; the attribute is 1/unset on oceans)
|
|
2594
|
+
* 2 — Sea / Gulf (OBJNAM "Gulf of …" / "… Sea")
|
|
2595
|
+
* 3 — Bay / Sound / (CATSEA in {5 bay, 12 narrows} OR OBJNAM
|
|
2596
|
+
* Strait / Narrows " Bay" / " Sound" / " Strait")
|
|
2597
|
+
* 4 — Anchorage detail (OBJNAM contains "Anchorage Area")
|
|
2598
|
+
* 5 — Relief + default (CATSEA relief codes — authoritative — or
|
|
2599
|
+
* relief-term names, or anything uncategorised;
|
|
2600
|
+
* suppressed below z9 by the size curve)
|
|
2601
|
+
*
|
|
2602
|
+
* Order matters: tier-4/5 demotions (anchorages, relief) run BEFORE the
|
|
2603
|
+
* promotion shims so "Bear Seamount" (contains " Sea") and "…Anchorage
|
|
2604
|
+
* Area" compound names can't bubble up into headline tiers.
|
|
2605
|
+
* `coalesce(CATSEA, catsea)` handles post-tippecanoe case variation
|
|
2606
|
+
* (matches `s52-conditional.ts` precedent).
|
|
2607
|
+
*/
|
|
2608
|
+
declare function buildSeaAreaTierExpression(): ExpressionSpecification;
|
|
2609
|
+
/**
|
|
2610
|
+
* Built-up area tier (BUAARE): major city / town / neighborhood.
|
|
2611
|
+
* 1 — Major city (CATBUA=1 urban, or OBJNAM length <= 8)
|
|
2612
|
+
* 2 — Town (CATBUA=5 village, or OBJNAM length <= 14)
|
|
2613
|
+
* 3 — Neighborhood (longer compound names)
|
|
2614
|
+
*
|
|
2615
|
+
* Tier 1/2 may fire via CATBUA when populated; OBJNAM length is the
|
|
2616
|
+
* fallback so unpopulated CATBUA still produces a usable hierarchy.
|
|
2617
|
+
*/
|
|
2618
|
+
declare function buildBuiltUpAreaTierExpression(): ExpressionSpecification;
|
|
2619
|
+
/**
|
|
2620
|
+
* Land region tier (LNDRGN): major region vs. local point.
|
|
2621
|
+
* 1 — Major region (OBJNAM length <= 12 AND no comma — "Long Island", "Cape Cod")
|
|
2622
|
+
* 2 — Local point (else — "Bird Island", "Cottage Park")
|
|
2623
|
+
*
|
|
2624
|
+
* No CATLND analog for region scope, so OBJNAM is the only signal.
|
|
2625
|
+
* The comma-absence test is a heuristic: NOAA compound names like
|
|
2626
|
+
* "Boston Harbor, MA Castle Island" carry a comma and belong at deeper
|
|
2627
|
+
* zoom regardless of length.
|
|
2628
|
+
*/
|
|
2629
|
+
declare function buildLandRegionTierExpression(): ExpressionSpecification;
|
|
2630
|
+
/**
|
|
2631
|
+
* Land area tier (LNDARE): major vs. local.
|
|
2632
|
+
* 1 — Major (OBJNAM length <= 12)
|
|
2633
|
+
* 2 — Local
|
|
2634
|
+
*
|
|
2635
|
+
* No category attribute. OBJNAM length is the only signal.
|
|
2636
|
+
*/
|
|
2637
|
+
declare function buildLandAreaTierExpression(): ExpressionSpecification;
|
|
2638
|
+
/**
|
|
2639
|
+
* Lake tier (LAKARE): lake vs. reservoir/pond.
|
|
2640
|
+
* 1 — Lake (CATLAK=1, or OBJNAM length <= 12)
|
|
2641
|
+
* 2 — Reservoir/pond (CATLAK in {2,3}, or longer name)
|
|
2642
|
+
*/
|
|
2643
|
+
declare function buildLakeTierExpression(): ExpressionSpecification;
|
|
2644
|
+
/**
|
|
2645
|
+
* River tier (RIVERS): major vs. local.
|
|
2646
|
+
* 1 — Major river (OBJNAM length <= 15 AND no comma)
|
|
2647
|
+
* 2 — Local creek (else)
|
|
2648
|
+
*/
|
|
2649
|
+
declare function buildRiverTierExpression(): ExpressionSpecification;
|
|
2650
|
+
/**
|
|
2651
|
+
* Airport tier (AIRARE): major airport vs. small airstrip.
|
|
2652
|
+
* 1 — Major (OBJNAM length <= 25 — e.g. "Logan International Airport")
|
|
2653
|
+
* 2 — Airstrip
|
|
2654
|
+
*/
|
|
2655
|
+
declare function buildAirportTierExpression(): ExpressionSpecification;
|
|
2581
2656
|
interface LabelLayerConfig {
|
|
2582
2657
|
/** Mapbox source layer type */
|
|
2583
2658
|
type: "symbol";
|
|
@@ -2754,6 +2829,22 @@ declare function isNavAidLayer(layerName: string): boolean;
|
|
|
2754
2829
|
* Computes a simple average-coordinate centroid for each polygon feature that has OBJNAM.
|
|
2755
2830
|
*/
|
|
2756
2831
|
declare function preprocessWaterBodies(fc: GeoJSON.FeatureCollection): GeoJSON.FeatureCollection;
|
|
2832
|
+
/** MVT layer the build-side place-name index emits. */
|
|
2833
|
+
declare const PLACENAME_SOURCE_LAYER = "PLACENAME";
|
|
2834
|
+
/** Orientation classes whose names render italic (water voice). */
|
|
2835
|
+
declare const PLACENAME_WATER_CLASSES: readonly string[];
|
|
2836
|
+
/** Orientation classes whose names render upright (land voice). */
|
|
2837
|
+
declare const PLACENAME_LAND_CLASSES: readonly string[];
|
|
2838
|
+
/**
|
|
2839
|
+
* The 2 PLACENAME symbol layers. Layout contract (design §2.2): collision
|
|
2840
|
+
* ON (`allow-overlap: false`, `ignore-placement: false`,
|
|
2841
|
+
* `optional: true`), padding 4, `text-variable-anchor`, and
|
|
2842
|
+
* `symbol-sort-key` straight from the build-side `rank` — MapLibre places
|
|
2843
|
+
* LOWER sort keys first, and rank is minted lower-is-more-important
|
|
2844
|
+
* (tier major, bbox area minor), so when space runs out the biggest names
|
|
2845
|
+
* survive. That ranking is the per-zoom density governor P4 asked for.
|
|
2846
|
+
*/
|
|
2847
|
+
declare function buildPlaceNameLayers(sourceId: string): maplibregl.LayerSpecification[];
|
|
2757
2848
|
|
|
2758
2849
|
/**
|
|
2759
2850
|
* Spatial grid-based feature decimation for performance at low zoom levels.
|
|
@@ -3262,6 +3353,25 @@ interface StyleGeneratorOptions extends BuildSourcesOptions {
|
|
|
3262
3353
|
* When false, all soundings render in a single shade. Default true.
|
|
3263
3354
|
*/
|
|
3264
3355
|
twoShadeSoundings?: boolean;
|
|
3356
|
+
/**
|
|
3357
|
+
* Label model for the 9 orientation place-name classes (SEAARE, LNDRGN,
|
|
3358
|
+
* LAKARE, RIVERS, CANALS, BUAARE, AIRARE, LNDARE, PRDARE).
|
|
3359
|
+
*
|
|
3360
|
+
* "legacy" (default) — the per-cell-band orientation fan
|
|
3361
|
+
* (fanOrientationLabelByCellBand): one label per feature per band,
|
|
3362
|
+
* deconflicted only by `_label_anchor` tags and watermark opacity.
|
|
3363
|
+
*
|
|
3364
|
+
* "placename" — 2 PLACENAME symbol layers over the build-side
|
|
3365
|
+
* place-name index (CHRTbaremetal placeNameIndex.ts): one collision-
|
|
3366
|
+
* managed label per named place with a per-feature zoom window; the
|
|
3367
|
+
* orientation fan for those classes is NOT emitted. Requires tiles
|
|
3368
|
+
* built with the PLACENAME side index — on older tiles the layers
|
|
3369
|
+
* simply draw nothing (soft-fail is index-side), which is why the
|
|
3370
|
+
* default stays "legacy" until L2c's rebuild + Maine-coast visual
|
|
3371
|
+
* verification flips it (docs/design/chart-label-deconfliction.md
|
|
3372
|
+
* §2.3). Feature-label classes are untouched either way.
|
|
3373
|
+
*/
|
|
3374
|
+
labels?: "legacy" | "placename";
|
|
3265
3375
|
/**
|
|
3266
3376
|
* Font weight for SOUNDG labels. Default "semibold" — crisper numerals
|
|
3267
3377
|
* at small sizes on screen.
|
|
@@ -4310,4 +4420,4 @@ declare class Chrt {
|
|
|
4310
4420
|
warmTiles(region?: string): Promise<void>;
|
|
4311
4421
|
}
|
|
4312
4422
|
|
|
4313
|
-
export { ALL_NAV_AID_LAYERS, ALL_WATER_BODY_LAYERS, AREA_QUERY_LAYERS, ATON_EXPRESSION_CLASSES, type AheadCoverageCell, type AheadFeatureProperties, type AheadOptions, type AheadResponse, type AlongRouteFeatureProperties, type AlongRouteOptions, type AlongRouteResponse, type AreaInspectResult, type AtlasStyle, type AttachOptions, BAND_DRAW_ORDER, BAND_PRIORITY_RANGES, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, type BandCode, type BandPriorityRange, type BridgeInspectResult, type BuildOfflineStyleOptions, type BuildSourcesOptions, CHART_BAND_CODES, CHART_CASCADE_CODES, CHART_SECTIONS, CHRTRASTER_REF_CROPS, CHRTRASTER_SVGS, CHRT_ATON_COLORS, CHRT_GLYPH_NAMES, CHRT_GLYPH_SVGS, CHRT_ICON_EXPRESSIONS, CHRT_ICON_PREFIX, CHRT_SDF_GLYPHS, CHRT_STYLE_MODES, type CandidateQueryOptions, type CandidatesEventContext, type CellDeletedEvent, type CellDetail, type CellEventData, type CellNewEvent, type CellUpdatedData, type CellUpdatedEvent, type CellsOptions, type CellsResponse, type ChartSection, Chrt, type ChrtConfig, ChrtError, type ChrtStyleMode, type ChrtStyleOptions, type ChrtStyleTheme, type ChrtSymbolSet, type ClickAnchor, ColorTableName, type CoverageOptions, type CoverageResponse, type CoverageRouteCell, type CoverageRouteOptions, type CoverageRouteResponse, type CoverageSource, type CustomStyleConfig, DEFAULT_CLICK_TOLERANCE, DEFAULT_CUSTOM_STYLE_CONFIG, DEFAULT_INSPECT_CLASS_RANK, DEFAULT_LABEL_SETTINGS, DEFAULT_NAV_AID_SETTINGS, DEFAULT_REGION, DEFAULT_SAFETY_CONTOUR_M, DEFAULT_SOUNDING_SETTINGS, DEFAULT_TILE_BASE_URL, DEFAULT_TILE_REGION, DEFAULT_WATER_BODY_SETTINGS, type DecodedAreaFeature, type DecodedBridge, type DecodedNavAid, type DecodedProperty, type DisplayCategory, type DisplayMode, type FeatureCollection, type FeaturesOptions, type FetchStyleOptions, FileSystemAdapter, type FlashPattern, type FlashPhase, type GenerateCustomStyleOptions, type GeneratedCustomStyle, type GeoJsonFeature, type GeoJsonGeometry, type GeomType, INSPECT_CLASS_RANK, INSPECT_RANK_DEVIATIONS, type InspectCandidate, type InspectCandidateSet, type InspectEnrichment, type InspectEventContext, type InspectNotice, type InspectOptions, type InspectResult, type InspectTargetClass, type InspectableFeature, InteractClient, type InteractEntitlement, InteractError, type InteractErrorCode, type InteractHandle, type InteractMapLike, type InteractMapMouseEvent, LABELED_LAYERS, LABEL_BEHAVIOR, LABEL_LAYER_GROUPS, LABEL_PRIORITY, LAND_REGION, type LabelBehavior, type LabelConfigOptions, type LabelLayerConfig, type LabelSettings, type LookupEntry, type MapLibreStyle, type MapboxStyle, type MapboxVectorSource, type MarineAlert, type MarineAlertsOptions, type MarineAlertsResponse, type MarineConditionsOptions, type MarineConditionsResponse, type MarineForecastOptions, type MarineForecastPeriod, type MarineForecastResponse, type MarineSeas, type MarineStation, type MarineSwellTrain, type MarineWind, type MarineZoneRef, NAUTICAL_SYMBOLS, NAV_AID_LAYER_GROUPS, NAV_AID_QUERY_LAYERS, NON_SOLAS_DISCLAIMER, NON_SOLAS_DISCLAIMER_SHORT, type NauticalCategory, type NauticalSymbol, type NavAidInspectResult, type NavAidSettings, type NearbyMarineStation, type OfflineBundleResponse, type OfflineDownloadOptions, type OfflineDownloadProgress, type OfflineDownloadResult, OfflineError, type OfflineErrorCode, type OfflineFetchStyleOptions, type OfflineHeartbeatOptions, type OfflineRegionSummary, type OfflineRemoveOptions, OfflineStyleError, type OfflineStylePlatform, type OfflineStyleResponse, type PmtilesVectorSource, type QueryFeatureProperties, type QueryOptions, type QueryResponse, RASTER_ATON_CLASSES, RASTER_GLYPH_NAMES, RASTER_ICON_PREFIX, RELIEF_REGION, type ResolvedStyle, type ResolvedTheme, type S101ArtworkProvenance, type S101Feature, S101_AREA_FILL_NAMES, S101_CHART_SECTIONS, S101_FEATURES, S101_ICON_PREFIX, S101_LINE_STYLE_NAMES, S101_NEW_SYMBOLS, S101_NO_OFFICIAL_COUNTERPART, S101_SOURCE_COMMIT, S101_SYMBOL_GROUPS, S101_SYMBOL_NAMES, S52_ATON_LOOKUPS, S52_ATON_LOOKUPS_PAPER, S52_DRAW_ORDER, S52_LOOKUP, S52_PATTERN_SPRITE_PREFIX, SOUNDING_LAYERS, SYMBOL_FAMILIES, SYMBOL_FAMILY_META, SYMBOL_GROUPS, SYMBOL_MAP, type ScaleBand, type SearchCoverageNotice, type SearchHit, type SearchOptions, type SearchResponse, type SectorArcFeature, type SectorArcFeatureCollection, type SectorInfo, type SoundingSettings, type SourceMode, type StyleGeneratorOptions, type StyleLayer, type StyleUrlOptions, type SymbolFamily, type SymbolFamilyMeta, type SymbolGroup, TileAuth, type TileGroup, type TileGroupsResponse, TileTokenError, type TileTokenErrorCode, type TileTokenResponse, type TransformRequest, type TransformedRequest, type VectorSourceSpec, type VesselProfile, WATER_BODY_LAYER_GROUPS, type WaterBodySettings, WeatherEndpoint, type WeatherReading, type WebhookEvent, type WebhookEventType, type WebhookPayload, applyChrtSymbolSet, applyColorTheme, applyCustomStyleSettings, applyRasterSymbolSet, applyS101SymbolSet, atonIconExpression, bandFilterExpression, buildFlashPattern, buildLabelLayer, buildLayersForClass, buildOfflineStyle, buildSectorArcGeoJSON, buildSectorArcsFC, buildSectorsFromFeatures, buildSources, candidateRank, chrtAtonTintExpression, chrtLightTintExpression, collectCandidates, collectClickCandidates, combineWithBandFilter, daymarkColor, decimateFeatures, decodeAreaFeatureProps, decodeBridgeProps, decodeCandidate, decodeNavAidProps, depareColor, depareFillExpression, deriveMarinerName, extractNavAidDesignation, featureIdentity, generateCustomStyle, generateSpriteManifest, generateSpriteSheet, generateStyle, generateStyleJSON, getAvailableLineSymbols, getAvailablePatterns, getAvailablePointSymbols, getCollisionSettings, getDrawPriority, getGridSizeForZoom, getIconExpression, getLabelBehavior, getLabelConfig, getLabelPriority, getLookupEntry, getMaxCellsForZoom, getOrderedClasses, getRasterSvg, getS52SvgString, getS52SymbolStats, getStyleStats, getSymbolSvgString, getThemedS101Svg, getThemedS52Svg, getTopmarkMeaning, hazardColor, hazardFillExpression, iconExpressionForFamily, isLabelLayerVisible, isNavAidLayer, isNavAidLayerVisible, isSoundingLayerVisible, isVisibleInMode, isWaterBodyLayerVisible, labelSortKey, lateralColor, lateralFillExpression, lightColor, lightFillExpression, lightsIconExpression, normalizeStyleMode, normalizeTheme, paginate, parseListCodes, parseSymbolFamily, parseWebhook, patternSpriteId, preprocessLights, preprocessNavAids, preprocessSoundings, preprocessWaterBodies, rasterAtonIconExpression, resolveCustomTheme, resolveRasterImage, resolveS101Color, resolveStyle, resolveTargetClass, s101ArtworkProvenance, sanitizeCustomStyleConfig, scaleSizeValue, scaminToMinZoom, styleModeBand, withinBboxFilter, worldMinusBboxPolygon };
|
|
4423
|
+
export { ALL_NAV_AID_LAYERS, ALL_WATER_BODY_LAYERS, AREA_QUERY_LAYERS, ATON_EXPRESSION_CLASSES, type AheadCoverageCell, type AheadFeatureProperties, type AheadOptions, type AheadResponse, type AlongRouteFeatureProperties, type AlongRouteOptions, type AlongRouteResponse, type AreaInspectResult, type AtlasStyle, type AttachOptions, BAND_DRAW_ORDER, BAND_PRIORITY_RANGES, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, type BandCode, type BandPriorityRange, type BridgeInspectResult, type BuildOfflineStyleOptions, type BuildSourcesOptions, CHART_BAND_CODES, CHART_CASCADE_CODES, CHART_SECTIONS, CHRTRASTER_REF_CROPS, CHRTRASTER_SVGS, CHRT_ATON_COLORS, CHRT_GLYPH_NAMES, CHRT_GLYPH_SVGS, CHRT_ICON_EXPRESSIONS, CHRT_ICON_PREFIX, CHRT_SDF_GLYPHS, CHRT_STYLE_MODES, type CandidateQueryOptions, type CandidatesEventContext, type CellDeletedEvent, type CellDetail, type CellEventData, type CellNewEvent, type CellUpdatedData, type CellUpdatedEvent, type CellsOptions, type CellsResponse, type ChartSection, Chrt, type ChrtConfig, ChrtError, type ChrtStyleMode, type ChrtStyleOptions, type ChrtStyleTheme, type ChrtSymbolSet, type ClickAnchor, ColorTableName, type CoverageOptions, type CoverageResponse, type CoverageRouteCell, type CoverageRouteOptions, type CoverageRouteResponse, type CoverageSource, type CustomStyleConfig, DEFAULT_CLICK_TOLERANCE, DEFAULT_CUSTOM_STYLE_CONFIG, DEFAULT_INSPECT_CLASS_RANK, DEFAULT_LABEL_SETTINGS, DEFAULT_NAV_AID_SETTINGS, DEFAULT_REGION, DEFAULT_SAFETY_CONTOUR_M, DEFAULT_SOUNDING_SETTINGS, DEFAULT_TILE_BASE_URL, DEFAULT_TILE_REGION, DEFAULT_WATER_BODY_SETTINGS, type DecodedAreaFeature, type DecodedBridge, type DecodedNavAid, type DecodedProperty, type DisplayCategory, type DisplayMode, type FeatureCollection, type FeaturesOptions, type FetchStyleOptions, FileSystemAdapter, type FlashPattern, type FlashPhase, type GenerateCustomStyleOptions, type GeneratedCustomStyle, type GeoJsonFeature, type GeoJsonGeometry, type GeomType, INSPECT_CLASS_RANK, INSPECT_RANK_DEVIATIONS, type InspectCandidate, type InspectCandidateSet, type InspectEnrichment, type InspectEventContext, type InspectNotice, type InspectOptions, type InspectResult, type InspectTargetClass, type InspectableFeature, InteractClient, type InteractEntitlement, InteractError, type InteractErrorCode, type InteractHandle, type InteractMapLike, type InteractMapMouseEvent, LABELED_LAYERS, LABEL_BEHAVIOR, LABEL_LAYER_GROUPS, LABEL_PRIORITY, LAND_REGION, type LabelBehavior, type LabelConfigOptions, type LabelLayerConfig, type LabelSettings, type LookupEntry, type MapLibreStyle, type MapboxStyle, type MapboxVectorSource, type MarineAlert, type MarineAlertsOptions, type MarineAlertsResponse, type MarineConditionsOptions, type MarineConditionsResponse, type MarineForecastOptions, type MarineForecastPeriod, type MarineForecastResponse, type MarineSeas, type MarineStation, type MarineSwellTrain, type MarineWind, type MarineZoneRef, NAUTICAL_SYMBOLS, NAV_AID_LAYER_GROUPS, NAV_AID_QUERY_LAYERS, NON_SOLAS_DISCLAIMER, NON_SOLAS_DISCLAIMER_SHORT, type NauticalCategory, type NauticalSymbol, type NavAidInspectResult, type NavAidSettings, type NearbyMarineStation, type OfflineBundleResponse, type OfflineDownloadOptions, type OfflineDownloadProgress, type OfflineDownloadResult, OfflineError, type OfflineErrorCode, type OfflineFetchStyleOptions, type OfflineHeartbeatOptions, type OfflineRegionSummary, type OfflineRemoveOptions, OfflineStyleError, type OfflineStylePlatform, type OfflineStyleResponse, PLACENAME_LAND_CLASSES, PLACENAME_SOURCE_LAYER, PLACENAME_WATER_CLASSES, type PmtilesVectorSource, type QueryFeatureProperties, type QueryOptions, type QueryResponse, RASTER_ATON_CLASSES, RASTER_GLYPH_NAMES, RASTER_ICON_PREFIX, RELIEF_REGION, type ResolvedStyle, type ResolvedTheme, type S101ArtworkProvenance, type S101Feature, S101_AREA_FILL_NAMES, S101_CHART_SECTIONS, S101_FEATURES, S101_ICON_PREFIX, S101_LINE_STYLE_NAMES, S101_NEW_SYMBOLS, S101_NO_OFFICIAL_COUNTERPART, S101_SOURCE_COMMIT, S101_SYMBOL_GROUPS, S101_SYMBOL_NAMES, S52_ATON_LOOKUPS, S52_ATON_LOOKUPS_PAPER, S52_DRAW_ORDER, S52_LOOKUP, S52_PATTERN_SPRITE_PREFIX, SOUNDING_LAYERS, SYMBOL_FAMILIES, SYMBOL_FAMILY_META, SYMBOL_GROUPS, SYMBOL_MAP, type ScaleBand, type SearchCoverageNotice, type SearchHit, type SearchOptions, type SearchResponse, type SectorArcFeature, type SectorArcFeatureCollection, type SectorInfo, type SoundingSettings, type SourceMode, type StyleGeneratorOptions, type StyleLayer, type StyleUrlOptions, type SymbolFamily, type SymbolFamilyMeta, type SymbolGroup, TileAuth, type TileGroup, type TileGroupsResponse, TileTokenError, type TileTokenErrorCode, type TileTokenResponse, type TransformRequest, type TransformedRequest, type VectorSourceSpec, type VesselProfile, WATER_BODY_LAYER_GROUPS, type WaterBodySettings, WeatherEndpoint, type WeatherReading, type WebhookEvent, type WebhookEventType, type WebhookPayload, applyChrtSymbolSet, applyColorTheme, applyCustomStyleSettings, applyRasterSymbolSet, applyS101SymbolSet, atonIconExpression, bandFilterExpression, buildAirportTierExpression, buildBuiltUpAreaTierExpression, buildFlashPattern, buildLabelLayer, buildLakeTierExpression, buildLandAreaTierExpression, buildLandRegionTierExpression, buildLayersForClass, buildOfflineStyle, buildPlaceNameLayers, buildRiverTierExpression, buildSeaAreaTierExpression, buildSectorArcGeoJSON, buildSectorArcsFC, buildSectorsFromFeatures, buildSources, candidateRank, chrtAtonTintExpression, chrtLightTintExpression, collectCandidates, collectClickCandidates, combineWithBandFilter, daymarkColor, decimateFeatures, decodeAreaFeatureProps, decodeBridgeProps, decodeCandidate, decodeNavAidProps, depareColor, depareFillExpression, deriveMarinerName, extractNavAidDesignation, featureIdentity, generateCustomStyle, generateSpriteManifest, generateSpriteSheet, generateStyle, generateStyleJSON, getAvailableLineSymbols, getAvailablePatterns, getAvailablePointSymbols, getCollisionSettings, getDrawPriority, getGridSizeForZoom, getIconExpression, getLabelBehavior, getLabelConfig, getLabelPriority, getLookupEntry, getMaxCellsForZoom, getOrderedClasses, getRasterSvg, getS52SvgString, getS52SymbolStats, getStyleStats, getSymbolSvgString, getThemedS101Svg, getThemedS52Svg, getTopmarkMeaning, hazardColor, hazardFillExpression, iconExpressionForFamily, isLabelLayerVisible, isNavAidLayer, isNavAidLayerVisible, isSoundingLayerVisible, isVisibleInMode, isWaterBodyLayerVisible, labelSortKey, lateralColor, lateralFillExpression, lightColor, lightFillExpression, lightsIconExpression, normalizeStyleMode, normalizeTheme, paginate, parseListCodes, parseSymbolFamily, parseWebhook, patternSpriteId, preprocessLights, preprocessNavAids, preprocessSoundings, preprocessWaterBodies, rasterAtonIconExpression, resolveCustomTheme, resolveRasterImage, resolveS101Color, resolveStyle, resolveTargetClass, s101ArtworkProvenance, sanitizeCustomStyleConfig, scaleSizeValue, scaminToMinZoom, styleModeBand, withinBboxFilter, worldMinusBboxPolygon };
|
package/dist/index.js
CHANGED
|
@@ -23826,6 +23826,102 @@ function computePolygonCentroid(geom) {
|
|
|
23826
23826
|
}
|
|
23827
23827
|
return [sumX / coords.length, sumY / coords.length];
|
|
23828
23828
|
}
|
|
23829
|
+
var PLACENAME_SOURCE_LAYER = "PLACENAME";
|
|
23830
|
+
var PLACENAME_WATER_CLASSES = [
|
|
23831
|
+
"SEAARE",
|
|
23832
|
+
"LAKARE",
|
|
23833
|
+
"RIVERS",
|
|
23834
|
+
"CANALS",
|
|
23835
|
+
"PRDARE"
|
|
23836
|
+
];
|
|
23837
|
+
var PLACENAME_LAND_CLASSES = [
|
|
23838
|
+
"LNDRGN",
|
|
23839
|
+
"LNDARE",
|
|
23840
|
+
"BUAARE",
|
|
23841
|
+
"AIRARE"
|
|
23842
|
+
];
|
|
23843
|
+
var PLACENAME_FITS = ["<=", ["coalesce", ["get", "min_z"], 0], ["zoom"]];
|
|
23844
|
+
var PLACENAME_RETIRES = [">=", ["coalesce", ["get", "max_z"], 14], ["zoom"]];
|
|
23845
|
+
var PLACENAME_TIER = [
|
|
23846
|
+
"to-number",
|
|
23847
|
+
["coalesce", ["get", "tier"], 9]
|
|
23848
|
+
];
|
|
23849
|
+
var PLACENAME_TEXT_OPACITY = [
|
|
23850
|
+
"interpolate",
|
|
23851
|
+
["linear"],
|
|
23852
|
+
["zoom"],
|
|
23853
|
+
3,
|
|
23854
|
+
0.55,
|
|
23855
|
+
9,
|
|
23856
|
+
0.5,
|
|
23857
|
+
12,
|
|
23858
|
+
0.4,
|
|
23859
|
+
16,
|
|
23860
|
+
0.3
|
|
23861
|
+
];
|
|
23862
|
+
var PLACENAME_WATER_SIZE_STOPS = [
|
|
23863
|
+
[3, [14, 9, 0, 0, 0, 0, 0, 0, 0, 0]],
|
|
23864
|
+
[5, [16, 13, 9, 0, 0, 0, 0, 0, 0, 0]],
|
|
23865
|
+
[7, [14, 14, 12, 9, 0, 0, 0, 0, 0, 0]],
|
|
23866
|
+
[9, [12, 13, 14, 11, 10, 9, 0, 9, 9, 9]],
|
|
23867
|
+
[11, [10, 12, 13, 12, 10, 9, 9, 11, 11, 9]],
|
|
23868
|
+
[13, [9, 11, 12, 11, 10, 10, 10, 11, 11, 10]],
|
|
23869
|
+
[16, [9, 10, 11, 10, 9, 9, 9, 10, 10, 9]]
|
|
23870
|
+
];
|
|
23871
|
+
var PLACENAME_LAND_SIZE_STOPS = [
|
|
23872
|
+
[3, [0, 0, 11, 0, 0, 0, 0, 0, 0, 0]],
|
|
23873
|
+
[5, [0, 0, 13, 0, 0, 0, 0, 0, 0, 0]],
|
|
23874
|
+
[7, [0, 0, 13, 9, 9, 0, 0, 0, 0, 0]],
|
|
23875
|
+
[9, [0, 0, 12, 12, 11, 0, 0, 0, 0, 0]],
|
|
23876
|
+
[11, [0, 0, 11, 12, 11, 9, 9, 0, 0, 9]],
|
|
23877
|
+
[13, [0, 0, 10, 11, 10, 11, 10, 10, 10, 10]],
|
|
23878
|
+
[16, [0, 0, 10, 10, 9, 10, 9, 9, 9, 9]]
|
|
23879
|
+
];
|
|
23880
|
+
function buildPlaceNameLayers(sourceId) {
|
|
23881
|
+
const sortKey = ["to-number", ["coalesce", ["get", "rank"], 9999999]];
|
|
23882
|
+
const make = (idSuffix, classes, font, haloColor, letterSpacing, stops) => ({
|
|
23883
|
+
id: `chrt-placename-${idSuffix}`,
|
|
23884
|
+
type: "symbol",
|
|
23885
|
+
source: sourceId,
|
|
23886
|
+
"source-layer": PLACENAME_SOURCE_LAYER,
|
|
23887
|
+
minzoom: 3,
|
|
23888
|
+
filter: [
|
|
23889
|
+
"all",
|
|
23890
|
+
["match", ["get", "cls"], [...classes], true, false],
|
|
23891
|
+
PLACENAME_FITS,
|
|
23892
|
+
PLACENAME_RETIRES
|
|
23893
|
+
],
|
|
23894
|
+
layout: {
|
|
23895
|
+
"text-field": ["get", "name"],
|
|
23896
|
+
"text-font": font,
|
|
23897
|
+
"text-size": tieredSizeCurve(PLACENAME_TIER, stops),
|
|
23898
|
+
"text-letter-spacing": letterSpacing,
|
|
23899
|
+
"text-max-width": 9,
|
|
23900
|
+
"text-padding": 4,
|
|
23901
|
+
"text-allow-overlap": false,
|
|
23902
|
+
"text-ignore-placement": false,
|
|
23903
|
+
"text-optional": true,
|
|
23904
|
+
"text-variable-anchor": ["center", "top", "bottom", "left", "right"],
|
|
23905
|
+
"text-radial-offset": 0.3,
|
|
23906
|
+
"text-justify": "auto",
|
|
23907
|
+
"symbol-sort-key": sortKey
|
|
23908
|
+
},
|
|
23909
|
+
paint: {
|
|
23910
|
+
"text-color": DARK_BG,
|
|
23911
|
+
"text-halo-color": haloColor,
|
|
23912
|
+
"text-halo-width": ORIENTATION_HALO_WIDTH,
|
|
23913
|
+
"text-opacity": PLACENAME_TEXT_OPACITY
|
|
23914
|
+
},
|
|
23915
|
+
metadata: {
|
|
23916
|
+
"chrt:placename": true,
|
|
23917
|
+
"chrt:labelPriority": ORIENTATION_LABEL_PRIORITY
|
|
23918
|
+
}
|
|
23919
|
+
});
|
|
23920
|
+
return [
|
|
23921
|
+
make("water", PLACENAME_WATER_CLASSES, ["Open Sans Italic"], COLOR.WATER_DEEP, 0.05, PLACENAME_WATER_SIZE_STOPS),
|
|
23922
|
+
make("land", PLACENAME_LAND_CLASSES, ["Open Sans Regular"], COLOR.LAND_REGION, 0.02, PLACENAME_LAND_SIZE_STOPS)
|
|
23923
|
+
];
|
|
23924
|
+
}
|
|
23829
23925
|
|
|
23830
23926
|
// src/atlas/feature-decimation.ts
|
|
23831
23927
|
function getGridSizeForZoom(zoom) {
|
|
@@ -28101,6 +28197,21 @@ var BAND_DATA_MINZOOM = {
|
|
|
28101
28197
|
function dominatedVariantMaxzoom(D) {
|
|
28102
28198
|
return Math.max(BAND_PRIORITY_RANGES[D].minzoom, BAND_DATA_MINZOOM[D]);
|
|
28103
28199
|
}
|
|
28200
|
+
var DOMINANCE_EXEMPT_FILL_CLASSES = /* @__PURE__ */ new Set([
|
|
28201
|
+
"LNDARE",
|
|
28202
|
+
"DEPARE",
|
|
28203
|
+
"UNSARE",
|
|
28204
|
+
"LAKARE",
|
|
28205
|
+
"DRGARE",
|
|
28206
|
+
"SEAARE"
|
|
28207
|
+
]);
|
|
28208
|
+
function isExemptOpaqueFill(layer) {
|
|
28209
|
+
if (layer.type !== "fill") return false;
|
|
28210
|
+
for (const cls of DOMINANCE_EXEMPT_FILL_CLASSES) {
|
|
28211
|
+
if (layer.id.startsWith(`s52-${cls}-`)) return true;
|
|
28212
|
+
}
|
|
28213
|
+
return false;
|
|
28214
|
+
}
|
|
28104
28215
|
var BAND_DRAW_ORDER = ["1", "2", "3", "4", "5", "6"];
|
|
28105
28216
|
var CHART_BAND_CODES = {
|
|
28106
28217
|
Overview: ["1"],
|
|
@@ -28221,7 +28332,7 @@ function collapsedDominanceGate(B, minzoom) {
|
|
|
28221
28332
|
function makeCollapsedBandVariant(layer, B, isExempt) {
|
|
28222
28333
|
const range = BAND_PRIORITY_RANGES[B];
|
|
28223
28334
|
const classMinzoom = layer.minzoom ?? 0;
|
|
28224
|
-
const minzoom = Math.max(classMinzoom, range.minzoom);
|
|
28335
|
+
const minzoom = isExemptOpaqueFill(layer) ? classMinzoom : Math.max(classMinzoom, range.minzoom);
|
|
28225
28336
|
if (isExempt) {
|
|
28226
28337
|
const exempt = {
|
|
28227
28338
|
...layer,
|
|
@@ -28350,30 +28461,18 @@ var DOMINANCE_EXEMPT_CLASSES = /* @__PURE__ */ new Set([
|
|
|
28350
28461
|
"RTPBCN",
|
|
28351
28462
|
"RDOSTA"
|
|
28352
28463
|
]);
|
|
28353
|
-
var DOMINANCE_EXEMPT_FILL_CLASSES = /* @__PURE__ */ new Set([
|
|
28354
|
-
"LNDARE",
|
|
28355
|
-
"DEPARE",
|
|
28356
|
-
"UNSARE",
|
|
28357
|
-
"LAKARE",
|
|
28358
|
-
"DRGARE",
|
|
28359
|
-
"SEAARE"
|
|
28360
|
-
]);
|
|
28361
28464
|
function isDominanceExempt(layer) {
|
|
28362
28465
|
for (const cls of DOMINANCE_EXEMPT_CLASSES) {
|
|
28363
28466
|
if (layer.id.startsWith(`s52-${cls}-`)) return true;
|
|
28364
28467
|
}
|
|
28365
|
-
if (layer
|
|
28366
|
-
for (const cls of DOMINANCE_EXEMPT_FILL_CLASSES) {
|
|
28367
|
-
if (layer.id.startsWith(`s52-${cls}-`)) return true;
|
|
28368
|
-
}
|
|
28369
|
-
}
|
|
28468
|
+
if (isExemptOpaqueFill(layer)) return true;
|
|
28370
28469
|
return false;
|
|
28371
28470
|
}
|
|
28372
28471
|
var TOP_STACK_LIGHT_CLASSES = /* @__PURE__ */ new Set(["LIGHTS"]);
|
|
28373
28472
|
function makeBandVariants(layer, B) {
|
|
28374
28473
|
const range = BAND_PRIORITY_RANGES[B];
|
|
28375
28474
|
const classMinzoom = layer.minzoom ?? 0;
|
|
28376
|
-
const minzoom = Math.max(classMinzoom, range.minzoom);
|
|
28475
|
+
const minzoom = isExemptOpaqueFill(layer) ? classMinzoom : Math.max(classMinzoom, range.minzoom);
|
|
28377
28476
|
const variants = [];
|
|
28378
28477
|
if (isDominanceExempt(layer)) {
|
|
28379
28478
|
const exempt = {
|
|
@@ -28603,9 +28702,12 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
28603
28702
|
emitChartFeatureVariants(topLightBundles);
|
|
28604
28703
|
const chartLabelBundles = byLabelPriorityBottomUp(
|
|
28605
28704
|
bundles.filter(
|
|
28606
|
-
(b) => b.label !== null
|
|
28705
|
+
(b) => b.label !== null && (opts.labels !== "placename" || getLabelBehavior(b.objectClass) !== "orientation-cross-band")
|
|
28607
28706
|
)
|
|
28608
28707
|
);
|
|
28708
|
+
if (opts.labels === "placename") {
|
|
28709
|
+
labelLayers.push(...buildPlaceNameLayers(sourceId));
|
|
28710
|
+
}
|
|
28609
28711
|
for (const { label } of chartLabelBundles) {
|
|
28610
28712
|
if (bandFan === "collapsed") {
|
|
28611
28713
|
labelLayers.push(
|
|
@@ -28650,10 +28752,14 @@ function generateStyle(palette = "DAY", opts = {}) {
|
|
|
28650
28752
|
}
|
|
28651
28753
|
}
|
|
28652
28754
|
}
|
|
28653
|
-
|
|
28654
|
-
|
|
28655
|
-
|
|
28656
|
-
|
|
28755
|
+
if (opts.labels === "placename") {
|
|
28756
|
+
labelLayers.push(...buildPlaceNameLayers(sourceId));
|
|
28757
|
+
} else {
|
|
28758
|
+
for (const { objectClass, label } of bundles) {
|
|
28759
|
+
if (!label) continue;
|
|
28760
|
+
if (getLabelBehavior(objectClass) === "orientation-cross-band") {
|
|
28761
|
+
labelLayers.push(...fanOrientationLabelByCellBand(label, bandFan));
|
|
28762
|
+
}
|
|
28657
28763
|
}
|
|
28658
28764
|
}
|
|
28659
28765
|
const featureLabelBundles = byLabelPriorityBottomUp(
|
|
@@ -29533,6 +29639,9 @@ export {
|
|
|
29533
29639
|
NON_SOLAS_DISCLAIMER_SHORT,
|
|
29534
29640
|
OfflineError,
|
|
29535
29641
|
OfflineStyleError,
|
|
29642
|
+
PLACENAME_LAND_CLASSES,
|
|
29643
|
+
PLACENAME_SOURCE_LAYER,
|
|
29644
|
+
PLACENAME_WATER_CLASSES,
|
|
29536
29645
|
RASTER_ATON_CLASSES,
|
|
29537
29646
|
RASTER_GLYPH_NAMES,
|
|
29538
29647
|
RASTER_ICON_PREFIX,
|
|
@@ -29572,10 +29681,18 @@ export {
|
|
|
29572
29681
|
applyS101SymbolSet,
|
|
29573
29682
|
atonIconExpression,
|
|
29574
29683
|
bandFilterExpression,
|
|
29684
|
+
buildAirportTierExpression,
|
|
29685
|
+
buildBuiltUpAreaTierExpression,
|
|
29575
29686
|
buildFlashPattern,
|
|
29576
29687
|
buildLabelLayer,
|
|
29688
|
+
buildLakeTierExpression,
|
|
29689
|
+
buildLandAreaTierExpression,
|
|
29690
|
+
buildLandRegionTierExpression,
|
|
29577
29691
|
buildLayersForClass,
|
|
29578
29692
|
buildOfflineStyle,
|
|
29693
|
+
buildPlaceNameLayers,
|
|
29694
|
+
buildRiverTierExpression,
|
|
29695
|
+
buildSeaAreaTierExpression,
|
|
29579
29696
|
buildSectorArcGeoJSON,
|
|
29580
29697
|
buildSectorArcsFC,
|
|
29581
29698
|
buildSectorsFromFeatures,
|