@chrtco/sdk 0.10.26 → 0.10.28

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/dist/index.d.cts CHANGED
@@ -1836,12 +1836,21 @@ interface DecodedAreaFeature {
1836
1836
  /** Decode properties for area/hazard/regulated features into a human-readable record. */
1837
1837
  declare function decodeAreaFeatureProps(layerName: string, props: Record<string, unknown>): DecodedAreaFeature;
1838
1838
  interface SectorInfo {
1839
+ /** `SECTR1` as charted: degrees true FROM SEAWARD, looking at the light. */
1839
1840
  sectorStart: number;
1841
+ /** `SECTR2` as charted: degrees true FROM SEAWARD, looking at the light. */
1840
1842
  sectorEnd: number;
1841
1843
  colour: string;
1842
1844
  colourHex: string;
1843
1845
  notation: string;
1844
1846
  nominalRange?: number | null;
1847
+ /**
1848
+ * True when this entry is DERIVED: an all-round light (no `SECTR1`/`SECTR2`)
1849
+ * sharing its position with sectored lights, drawn over the arc the sectors
1850
+ * leave uncovered — S-52 LIGHTS05's treatment. Isle au Haut: `Fl R 4s`
1851
+ * all-round plus a white sector 034°–060° is red everywhere else.
1852
+ */
1853
+ allRound?: boolean;
1845
1854
  }
1846
1855
  interface DecodedNavAid {
1847
1856
  name: string;
@@ -1926,25 +1935,67 @@ interface SectorArcFeatureCollection {
1926
1935
  type: "FeatureCollection";
1927
1936
  features: SectorArcFeature[];
1928
1937
  }
1938
+ /**
1939
+ * The arcs (charted from-seaward degrees, clockwise start→end) that a set of
1940
+ * sectors leaves uncovered. Used to draw an all-round light that shares its
1941
+ * position with sectored lights: it shows everywhere the sectors do not.
1942
+ *
1943
+ * Returns `[]` when the sectors already cover the full circle, and a single
1944
+ * `{ start: 0, end: 0 }` (a full 360° sweep) when there are no sectors.
1945
+ */
1946
+ declare function uncoveredSectorArcs(sectors: ReadonlyArray<{
1947
+ sectorStart: number;
1948
+ sectorEnd: number;
1949
+ }>): Array<{
1950
+ start: number;
1951
+ end: number;
1952
+ }>;
1929
1953
  /**
1930
1954
  * Build all sectors from multiple LIGHTS features at the same position.
1931
1955
  * Each LIGHTS feature with SECTR1/SECTR2 defines one sector.
1956
+ *
1957
+ * An ALL-ROUND light (no `SECTR1`/`SECTR2`) at the same position as sectored
1958
+ * lights is added too, over the arc the sectors leave uncovered — S-52
1959
+ * LIGHTS05 draws such a light as an arc so its colour is not lost. Isle au
1960
+ * Haut (Robinson Point) is encoded exactly this way: `Fl R 4s` all-round plus
1961
+ * a white sector 034°–060°; without this the red never appeared at all. An
1962
+ * all-round light with no charted colour, or with no sectored sibling, adds
1963
+ * nothing (a plain light is a flare, not a ring).
1932
1964
  */
1933
1965
  declare function buildSectorsFromFeatures(features: Array<{
1934
1966
  properties: Record<string, unknown>;
1935
1967
  }>): SectorInfo[];
1968
+ /**
1969
+ * Convert a charted sector limit (`SECTR1`/`SECTR2`) into the bearing FROM
1970
+ * THE LIGHT at which its limit line is drawn on the chart.
1971
+ *
1972
+ * S-57 (and the USCG Light List) give sector limits as true bearings FROM
1973
+ * SEAWARD — the bearing of the light as observed from a vessel. A vessel that
1974
+ * sees the light bearing 000° is due SOUTH of it, so the arc that vessel sits
1975
+ * in is drawn on the reciprocal: limit + 180°. S-52 LIGHTS05 applies the same
1976
+ * reciprocal before drawing. Adding 180° to both limits preserves the
1977
+ * clockwise SECTR1→SECTR2 sense, so the sweep is unchanged.
1978
+ *
1979
+ * Drawing the raw value put every sector on the opposite side of the light —
1980
+ * the "red where white should be" report from the Maine coast (Hendricks
1981
+ * Head: W 000°–180°, R 180°–000°, painted white over Southport Island and
1982
+ * red over the Sheepscot River).
1983
+ */
1984
+ declare function sectorLimitToArcBearing(limitDegFromSeaward: number): number;
1936
1985
  /**
1937
1986
  * Generate a GeoJSON arc polygon for a sector light.
1938
- * Bearings are TRUE bearings FROM the light (as seen FROM a vessel).
1939
- * S-57 SECTR1/SECTR2 define the arc as seen FROM seaward looking AT the light,
1940
- * so we draw arcs in bearing order from the light's position.
1987
+ *
1988
+ * `startBearing`/`endBearing` are the CHARTED sector limits — S-57 SECTR1 and
1989
+ * SECTR2, degrees true from seaward, clockwise from start to end. The
1990
+ * reciprocal is applied here (see `sectorLimitToArcBearing`) so the polygon
1991
+ * lands on the side of the light the sector is actually visible from.
1941
1992
  *
1942
1993
  * When `innerRadiusNm > 0`, the polygon is an annulus segment (band) —
1943
1994
  * a ring slice between the inner and outer radius — instead of a pie wedge.
1944
1995
  *
1945
1996
  * @param center [lng, lat]
1946
- * @param startBearing degrees true (clockwise from north)
1947
- * @param endBearing degrees true
1997
+ * @param startBearing SECTR1 — degrees true FROM SEAWARD (clockwise from north)
1998
+ * @param endBearing SECTR2 — degrees true FROM SEAWARD
1948
1999
  * @param radiusNm outer radius in nautical miles
1949
2000
  * @param innerRadiusNm inner radius in nautical miles (0 = pie wedge)
1950
2001
  * @param steps number of arc segments
@@ -4696,4 +4747,4 @@ declare class Chrt {
4696
4747
  warmTiles(region?: string): Promise<TileTokenResponse>;
4697
4748
  }
4698
4749
 
4699
- 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, BASE_MAXZOOM, BASE_MINZOOM, BASE_REGION, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, BUILD_PARAM, 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 Poi, type PoiCoverage, type PoiDataset, type PoiOptions, type PoiResponse, 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, tileTemplate, withinBboxFilter, worldMinusBboxPolygon };
4750
+ 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, BASE_MAXZOOM, BASE_MINZOOM, BASE_REGION, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, BUILD_PARAM, 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 Poi, type PoiCoverage, type PoiDataset, type PoiOptions, type PoiResponse, 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, sectorLimitToArcBearing, styleModeBand, tileTemplate, uncoveredSectorArcs, withinBboxFilter, worldMinusBboxPolygon };
package/dist/index.d.ts CHANGED
@@ -1836,12 +1836,21 @@ interface DecodedAreaFeature {
1836
1836
  /** Decode properties for area/hazard/regulated features into a human-readable record. */
1837
1837
  declare function decodeAreaFeatureProps(layerName: string, props: Record<string, unknown>): DecodedAreaFeature;
1838
1838
  interface SectorInfo {
1839
+ /** `SECTR1` as charted: degrees true FROM SEAWARD, looking at the light. */
1839
1840
  sectorStart: number;
1841
+ /** `SECTR2` as charted: degrees true FROM SEAWARD, looking at the light. */
1840
1842
  sectorEnd: number;
1841
1843
  colour: string;
1842
1844
  colourHex: string;
1843
1845
  notation: string;
1844
1846
  nominalRange?: number | null;
1847
+ /**
1848
+ * True when this entry is DERIVED: an all-round light (no `SECTR1`/`SECTR2`)
1849
+ * sharing its position with sectored lights, drawn over the arc the sectors
1850
+ * leave uncovered — S-52 LIGHTS05's treatment. Isle au Haut: `Fl R 4s`
1851
+ * all-round plus a white sector 034°–060° is red everywhere else.
1852
+ */
1853
+ allRound?: boolean;
1845
1854
  }
1846
1855
  interface DecodedNavAid {
1847
1856
  name: string;
@@ -1926,25 +1935,67 @@ interface SectorArcFeatureCollection {
1926
1935
  type: "FeatureCollection";
1927
1936
  features: SectorArcFeature[];
1928
1937
  }
1938
+ /**
1939
+ * The arcs (charted from-seaward degrees, clockwise start→end) that a set of
1940
+ * sectors leaves uncovered. Used to draw an all-round light that shares its
1941
+ * position with sectored lights: it shows everywhere the sectors do not.
1942
+ *
1943
+ * Returns `[]` when the sectors already cover the full circle, and a single
1944
+ * `{ start: 0, end: 0 }` (a full 360° sweep) when there are no sectors.
1945
+ */
1946
+ declare function uncoveredSectorArcs(sectors: ReadonlyArray<{
1947
+ sectorStart: number;
1948
+ sectorEnd: number;
1949
+ }>): Array<{
1950
+ start: number;
1951
+ end: number;
1952
+ }>;
1929
1953
  /**
1930
1954
  * Build all sectors from multiple LIGHTS features at the same position.
1931
1955
  * Each LIGHTS feature with SECTR1/SECTR2 defines one sector.
1956
+ *
1957
+ * An ALL-ROUND light (no `SECTR1`/`SECTR2`) at the same position as sectored
1958
+ * lights is added too, over the arc the sectors leave uncovered — S-52
1959
+ * LIGHTS05 draws such a light as an arc so its colour is not lost. Isle au
1960
+ * Haut (Robinson Point) is encoded exactly this way: `Fl R 4s` all-round plus
1961
+ * a white sector 034°–060°; without this the red never appeared at all. An
1962
+ * all-round light with no charted colour, or with no sectored sibling, adds
1963
+ * nothing (a plain light is a flare, not a ring).
1932
1964
  */
1933
1965
  declare function buildSectorsFromFeatures(features: Array<{
1934
1966
  properties: Record<string, unknown>;
1935
1967
  }>): SectorInfo[];
1968
+ /**
1969
+ * Convert a charted sector limit (`SECTR1`/`SECTR2`) into the bearing FROM
1970
+ * THE LIGHT at which its limit line is drawn on the chart.
1971
+ *
1972
+ * S-57 (and the USCG Light List) give sector limits as true bearings FROM
1973
+ * SEAWARD — the bearing of the light as observed from a vessel. A vessel that
1974
+ * sees the light bearing 000° is due SOUTH of it, so the arc that vessel sits
1975
+ * in is drawn on the reciprocal: limit + 180°. S-52 LIGHTS05 applies the same
1976
+ * reciprocal before drawing. Adding 180° to both limits preserves the
1977
+ * clockwise SECTR1→SECTR2 sense, so the sweep is unchanged.
1978
+ *
1979
+ * Drawing the raw value put every sector on the opposite side of the light —
1980
+ * the "red where white should be" report from the Maine coast (Hendricks
1981
+ * Head: W 000°–180°, R 180°–000°, painted white over Southport Island and
1982
+ * red over the Sheepscot River).
1983
+ */
1984
+ declare function sectorLimitToArcBearing(limitDegFromSeaward: number): number;
1936
1985
  /**
1937
1986
  * Generate a GeoJSON arc polygon for a sector light.
1938
- * Bearings are TRUE bearings FROM the light (as seen FROM a vessel).
1939
- * S-57 SECTR1/SECTR2 define the arc as seen FROM seaward looking AT the light,
1940
- * so we draw arcs in bearing order from the light's position.
1987
+ *
1988
+ * `startBearing`/`endBearing` are the CHARTED sector limits — S-57 SECTR1 and
1989
+ * SECTR2, degrees true from seaward, clockwise from start to end. The
1990
+ * reciprocal is applied here (see `sectorLimitToArcBearing`) so the polygon
1991
+ * lands on the side of the light the sector is actually visible from.
1941
1992
  *
1942
1993
  * When `innerRadiusNm > 0`, the polygon is an annulus segment (band) —
1943
1994
  * a ring slice between the inner and outer radius — instead of a pie wedge.
1944
1995
  *
1945
1996
  * @param center [lng, lat]
1946
- * @param startBearing degrees true (clockwise from north)
1947
- * @param endBearing degrees true
1997
+ * @param startBearing SECTR1 — degrees true FROM SEAWARD (clockwise from north)
1998
+ * @param endBearing SECTR2 — degrees true FROM SEAWARD
1948
1999
  * @param radiusNm outer radius in nautical miles
1949
2000
  * @param innerRadiusNm inner radius in nautical miles (0 = pie wedge)
1950
2001
  * @param steps number of arc segments
@@ -4696,4 +4747,4 @@ declare class Chrt {
4696
4747
  warmTiles(region?: string): Promise<TileTokenResponse>;
4697
4748
  }
4698
4749
 
4699
- 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, BASE_MAXZOOM, BASE_MINZOOM, BASE_REGION, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, BUILD_PARAM, 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 Poi, type PoiCoverage, type PoiDataset, type PoiOptions, type PoiResponse, 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, tileTemplate, withinBboxFilter, worldMinusBboxPolygon };
4750
+ 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, BASE_MAXZOOM, BASE_MINZOOM, BASE_REGION, type BBox, BRIDGE_QUERY_LAYERS, BUILD_MAXZOOM, BUILD_MINZOOM, BUILD_PARAM, 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 Poi, type PoiCoverage, type PoiDataset, type PoiOptions, type PoiResponse, 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, sectorLimitToArcBearing, styleModeBand, tileTemplate, uncoveredSectorArcs, withinBboxFilter, worldMinusBboxPolygon };
package/dist/index.js CHANGED
@@ -410,7 +410,7 @@ function buildSources(opts = {}) {
410
410
  if (opts.base) {
411
411
  sources[BASE_REGION] = {
412
412
  type: "vector",
413
- tiles: [`${base}/v1/tiles/${BASE_REGION}/{z}/{x}/{y}.mvt`],
413
+ tiles: [tileTemplate(base, BASE_REGION, "mvt", buildFor(BASE_REGION))],
414
414
  minzoom: BASE_MINZOOM,
415
415
  maxzoom: BASE_MAXZOOM
416
416
  };
@@ -3166,13 +3166,54 @@ function buildFlashPattern(decoded) {
3166
3166
  const totalCycle = phases.reduce((sum, p) => sum + p.duration, 0);
3167
3167
  return { phases, totalCycle, notation };
3168
3168
  }
3169
+ function uncoveredSectorArcs(sectors) {
3170
+ const norm = (d) => (d % 360 + 360) % 360;
3171
+ const flat = [];
3172
+ for (const sec of sectors) {
3173
+ const a = norm(sec.sectorStart);
3174
+ let sweep = norm(sec.sectorEnd) - a;
3175
+ if (sweep <= 0) sweep += 360;
3176
+ if (sweep >= 360) return [];
3177
+ const b = a + sweep;
3178
+ if (b <= 360) flat.push([a, b]);
3179
+ else {
3180
+ flat.push([a, 360]);
3181
+ flat.push([0, b - 360]);
3182
+ }
3183
+ }
3184
+ if (flat.length === 0) return [{ start: 0, end: 0 }];
3185
+ flat.sort((x, y) => x[0] - y[0]);
3186
+ const merged = [];
3187
+ for (const [a, b] of flat) {
3188
+ const last = merged[merged.length - 1];
3189
+ if (last && a <= last[1]) last[1] = Math.max(last[1], b);
3190
+ else merged.push([a, b]);
3191
+ }
3192
+ const gaps = [];
3193
+ let cursor = 0;
3194
+ for (const [a, b] of merged) {
3195
+ if (a > cursor) gaps.push([cursor, a]);
3196
+ cursor = Math.max(cursor, b);
3197
+ }
3198
+ if (cursor < 360) gaps.push([cursor, 360]);
3199
+ if (gaps.length >= 2 && gaps[0][0] === 0 && gaps[gaps.length - 1][1] === 360) {
3200
+ const first = gaps.shift();
3201
+ const last = gaps.pop();
3202
+ gaps.push([last[0], first[1]]);
3203
+ }
3204
+ return gaps.filter(([a, b]) => Math.abs(b - a) >= 0.05 || b < a).map(([a, b]) => ({ start: norm(a), end: norm(b) }));
3205
+ }
3169
3206
  function buildSectorsFromFeatures(features) {
3170
3207
  const sectors = [];
3208
+ const allRound = [];
3171
3209
  for (const f of features) {
3172
3210
  const props = f.properties ?? {};
3173
3211
  const s1 = props.SECTR1 != null ? Number(props.SECTR1) : null;
3174
3212
  const s2 = props.SECTR2 != null ? Number(props.SECTR2) : null;
3175
- if (s1 == null || s2 == null || isNaN(s1) || isNaN(s2)) continue;
3213
+ if (s1 == null || s2 == null || isNaN(s1) || isNaN(s2)) {
3214
+ if (props.SECTR1 == null && props.SECTR2 == null && parseCode(props.COLOUR) != null) allRound.push(props);
3215
+ continue;
3216
+ }
3176
3217
  const colourCode = parseCode(props.COLOUR);
3177
3218
  const ce = colourCode ? COLOUR_TABLE[colourCode] : null;
3178
3219
  const litchrCode = parseCode(props.LITCHR);
@@ -3191,15 +3232,44 @@ function buildSectorsFromFeatures(features) {
3191
3232
  nominalRange
3192
3233
  });
3193
3234
  }
3235
+ if (sectors.length > 0 && allRound.length > 0) {
3236
+ const gaps = uncoveredSectorArcs(sectors);
3237
+ for (const props of allRound) {
3238
+ const colourCode = parseCode(props.COLOUR);
3239
+ const ce = colourCode ? COLOUR_TABLE[colourCode] : null;
3240
+ if (!ce) continue;
3241
+ const litchrCode = parseCode(props.LITCHR);
3242
+ const le = litchrCode ? LITCHR_TABLE[litchrCode] : null;
3243
+ const sigper = props.SIGPER != null ? Number(props.SIGPER) : null;
3244
+ const group = parseGroup(props.SIGGRP);
3245
+ const notation = buildNotation(le?.abbr ?? null, [ce.abbr], sigper, group);
3246
+ const valnmr = props.VALNMR != null ? Number(props.VALNMR) : null;
3247
+ const nominalRange = valnmr != null && !isNaN(valnmr) && valnmr > 0 ? valnmr : null;
3248
+ for (const gap of gaps) {
3249
+ sectors.push({
3250
+ sectorStart: gap.start,
3251
+ sectorEnd: gap.end,
3252
+ colour: ce.name,
3253
+ colourHex: ce.hex,
3254
+ notation,
3255
+ nominalRange,
3256
+ allRound: true
3257
+ });
3258
+ }
3259
+ }
3260
+ }
3194
3261
  return sectors;
3195
3262
  }
3263
+ function sectorLimitToArcBearing(limitDegFromSeaward) {
3264
+ return ((limitDegFromSeaward + 180) % 360 + 360) % 360;
3265
+ }
3196
3266
  function buildSectorArcGeoJSON(center, startBearing, endBearing, radiusNm = 0.5, innerRadiusNm = 0, steps = 64) {
3197
3267
  const radiusDeg = radiusNm / 60;
3198
3268
  const innerDeg = innerRadiusNm > 0 ? innerRadiusNm / 60 : 0;
3199
3269
  const [lng, lat] = center;
3200
3270
  const cosLat = Math.cos(lat * Math.PI / 180);
3201
- const s = (startBearing % 360 + 360) % 360;
3202
- const e = (endBearing % 360 + 360) % 360;
3271
+ const s = sectorLimitToArcBearing(startBearing);
3272
+ const e = sectorLimitToArcBearing(endBearing);
3203
3273
  let sweep = e - s;
3204
3274
  if (sweep <= 0) sweep += 360;
3205
3275
  const project = (bearingDeg, rDeg) => {
@@ -3254,7 +3324,7 @@ function buildSectorArcsFC(center, sectors, radiusNm = 0.4, innerRadiusFrac = 0.
3254
3324
  const TICK_INNER_OVERHANG = 0.93;
3255
3325
  for (const sec of sectors) {
3256
3326
  for (const bearing of [sec.sectorStart, sec.sectorEnd]) {
3257
- const rad = bearing * Math.PI / 180;
3327
+ const rad = sectorLimitToArcBearing(bearing) * Math.PI / 180;
3258
3328
  const radiusDeg = radiusNm / 60;
3259
3329
  const innerRadiusDeg = innerNm > 0 ? innerNm / 60 : 0;
3260
3330
  const cosLat = Math.cos(center[1] * Math.PI / 180);
@@ -31089,8 +31159,10 @@ export {
31089
31159
  sanitizeCustomStyleConfig,
31090
31160
  scaleSizeValue,
31091
31161
  scaminToMinZoom,
31162
+ sectorLimitToArcBearing,
31092
31163
  styleModeBand,
31093
31164
  tileTemplate,
31165
+ uncoveredSectorArcs,
31094
31166
  withinBboxFilter,
31095
31167
  worldMinusBboxPolygon
31096
31168
  };