/** * Typed S-57 Feature Access API. * * Provides strongly-typed interfaces for common S-57 object classes, * with attribute values parsed to their native types (number, string, enum). * Wraps the raw FeatureRecord with convenient typed accessors. */ import type { FeatureRecord } from './types.js'; export declare const OBJL: { readonly ACHARE: 3; readonly BCNCAR: 5; readonly BCNLAT: 8; readonly BOYCAR: 15; readonly BOYLAT: 17; readonly BOYSAW: 19; readonly BOYSPP: 20; readonly BRIDGE: 12; readonly BUAARE: 14; readonly COALNE: 30; readonly DEPARE: 42; readonly DEPCNT: 43; readonly LIGHTS: 75; readonly LNDARE: 71; readonly LNDMRK: 77; readonly OBSTRN: 86; readonly RESARE: 112; readonly SOUNDG: 129; readonly UWTROC: 154; readonly WRECKS: 159; }; /** Base for all typed features */ export interface TypedFeatureBase { /** S-57 OBJL code */ objl: number; /** Object class acronym */ objectClass: string; /** Record ID */ rcid: number; /** Object name (OBJNAM attribute) */ name?: string; /** National object name */ nationalName?: string; /** Information text */ information?: string; /** Scale minimum */ scaleMin?: number; /** Original raw feature record */ raw: FeatureRecord; } export interface DepthArea extends TypedFeatureBase { objectClass: 'DEPARE'; /** Minimum depth (metres) */ drval1?: number; /** Maximum depth (metres) */ drval2?: number; /** Depth units */ depthUnits?: number; } export interface DepthContour extends TypedFeatureBase { objectClass: 'DEPCNT'; /** Contour value (metres) */ valdco?: number; } export interface Sounding extends TypedFeatureBase { objectClass: 'SOUNDG'; /** Sounding value (metres) */ valsou?: number; /** Quality of sounding */ quasou?: number[]; /** Technique of sounding */ tecsou?: number[]; } export interface Coastline extends TypedFeatureBase { objectClass: 'COALNE'; /** Category of coastline */ catcoa?: number; } export interface LandArea extends TypedFeatureBase { objectClass: 'LNDARE'; /** Condition */ condition?: number; } export interface Light extends TypedFeatureBase { objectClass: 'LIGHTS'; /** Light characteristic (enum: 1=Fixed, 2=Flashing, etc.) */ litchr?: number; /** Light visibility */ litvis?: number; /** Signal period (seconds) */ sigper?: number; /** Signal group */ siggrp?: string; /** Colour */ colour?: number[]; /** Colour pattern */ colpat?: number[]; /** Sector limit one (degrees) */ sectr1?: number; /** Sector limit two (degrees) */ sectr2?: number; /** Height (metres) */ height?: number; /** Orientation (degrees) */ orient?: number; /** Exhibition condition */ exclit?: number; /** Status */ status?: number[]; } export interface Beacon extends TypedFeatureBase { objectClass: 'BCNCAR' | 'BCNLAT'; /** Beacon shape */ bcnshp?: number; /** Colour */ colour?: number[]; /** Topmark shape */ topshp?: number; /** Marks navigational system */ marsys?: number; /** Conspicuous visual */ convis?: number; } export interface Buoy extends TypedFeatureBase { objectClass: 'BOYCAR' | 'BOYLAT' | 'BOYSAW' | 'BOYSPP'; /** Buoy shape */ boyshp?: number; /** Colour */ colour?: number[]; /** Colour pattern */ colpat?: number[]; /** Topmark shape */ topshp?: number; /** Marks navigational system */ marsys?: number; } export interface Obstruction extends TypedFeatureBase { objectClass: 'OBSTRN'; /** Category of obstruction */ catobs?: number; /** Value of sounding */ valsou?: number; /** Water level effect */ watlev?: number; /** Condition */ condition?: number; } export interface Wreck extends TypedFeatureBase { objectClass: 'WRECKS'; /** Category of wreck */ catwrk?: number; /** Value of sounding */ valsou?: number; /** Water level effect */ watlev?: number; /** Condition */ condition?: number; } export interface UnderwaterRock extends TypedFeatureBase { objectClass: 'UWTROC'; /** Value of sounding */ valsou?: number; /** Water level effect */ watlev?: number; } export interface RestrictedArea extends TypedFeatureBase { objectClass: 'RESARE'; /** Category of restricted area */ catrea?: number; /** Restriction */ restrn?: number[]; /** Status */ status?: number[]; } export interface Bridge extends TypedFeatureBase { objectClass: 'BRIDGE'; /** Category of bridge */ catbrg?: number; /** Vertical clearance (metres) */ verclr?: number; /** Vertical clearance, closed (metres) */ verccl?: number; /** Vertical clearance, open (metres) */ vercop?: number; /** Horizontal clearance (metres) */ horclr?: number; /** Condition */ condition?: number; } export interface Landmark extends TypedFeatureBase { objectClass: 'LNDMRK'; /** Category of landmark */ catlmk?: number; /** Colour */ colour?: number[]; /** Conspicuous visual */ convis?: number; /** Height (metres) */ height?: number; /** Elevation (metres) */ elevation?: number; /** Condition */ condition?: number; } export interface AnchorageArea extends TypedFeatureBase { objectClass: 'ACHARE'; /** Category of anchorage */ catanc?: number; /** Restriction */ restrn?: number[]; /** Status */ status?: number[]; } /** Union of all typed features */ export type TypedFeature = DepthArea | DepthContour | Sounding | Coastline | LandArea | Light | Beacon | Buoy | Obstruction | Wreck | UnderwaterRock | RestrictedArea | Bridge | Landmark | AnchorageArea; /** * Convert a raw FeatureRecord to a typed feature with parsed attributes. * Returns undefined for unrecognized OBJL codes. */ export declare function typedFeature(f: FeatureRecord): TypedFeature | undefined; /** * Convert all features in a dataset to typed features. * Unrecognized object classes are skipped. */ export declare function typedFeatures(features: FeatureRecord[]): TypedFeature[]; /** * Filter typed features by object class. * Returns a narrowed array of the specific typed feature. * * @example * const lights = filterByClass(typed, 'LIGHTS'); * // lights is Light[], with litchr, sigper, etc. */ export declare function filterByClass(features: TypedFeature[], objectClass: C): Extract[]; //# sourceMappingURL=typed-features.d.ts.map