Skip to content

ElectronicChartCentre/ecc-s100-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

S-100 Viewer Workspace

This workspace contains the current S-100 Interoperability Project package baseline for an engine-neutral S-100 viewer API.

Release-target packages for the current phase:

  • @ecc/s100-viewer: viewer, scene, layer, product, time, picking, coordinate, and adapter contracts. This includes ENC builders for S-101 and S-57, S-102, S-111, simulated water-level, vessel, and map-overlay layer builders.
  • @ecc/s100-viewer-adapter-nasa-ammos: NASA-AMMOS/Three.js adapter.
  • @ecc/s100-viewer-adapter-cesium: Cesium adapter and initial globe-native integration target.

S-100 Explorer owns any application-specific migration bridge in the webapp. The public package contract is the main @ecc/s100-viewer entry point plus adapter packages.

The CogsEngine adapter remains in this workspace for now, but Phase 8 planning treats it as a separate local interoperability repo. It is not part of the future default release package set.

Quick Start Shape

Application code should normally use the core package and one renderer adapter:

npm install @ecc/s100-viewer @ecc/s100-viewer-adapter-nasa-ammos

Cesium applications use the Cesium adapter package plus the Cesium runtime:

npm install @ecc/s100-viewer @ecc/s100-viewer-adapter-cesium cesium
import {
  createS100Viewer,
  LayerBuilder,
  SceneBuilder,
  type S102LayerSpec,
} from "@ecc/s100-viewer";
import { createNasaAmmosAdapter } from "@ecc/s100-viewer-adapter-nasa-ammos";

const viewer = await createS100Viewer({
  container: document.getElementById("viewer"),
  adapter: createNasaAmmosAdapter(),
});

const scene = await viewer.createScene({
  georeference: SceneBuilder.projectedLocal({
    crs: "EPSG:32619",
    origin: { x: 331100, y: 5186420, z: 0 },
  }),
});

const s102: S102LayerSpec = LayerBuilder.createS102({
  url: "https://example.test/s102/tileset.json",
  crs: "EPSG:32619",
});

await scene.layers.add(s102);

LayerBuilder fills obvious S-100 boilerplate such as layer ids, product types, source kinds, roles, default styles, and the product-specification version policy. By default, product layers use latest-confirmed-supported; pass productSpecificationVersion only when a service exposes a concrete IHO product specification identifier or edition that the app wants to track explicitly.

For applications that want a more batteries-included surface, the core package also exports product sessions such as S102TerrainSession, S111SurfaceCurrentSession, EncWmsSession, and VesselFeatureSession. These sessions translate app-friendly inputs into canonical layer specs, including templated WMS map sources and provider defaults through PrimarServices. PRIMAR helpers also provide reusable service adapters such as ENC availability resolution, so apps can inject their request functions without duplicating provider response parsing. Sessions still use the same scene.layers kernel underneath.

The core package exports S100SupportedProductVersions, and each adapter reports its engine-specific matrix through adapter.capabilities.supportedProductVersions. Third-party engines integrate by implementing S100EngineAdapter; applications should not need NASA-AMMOS-specific code to use a different adapter.

Common Commands

npm run check
npm run test
npm run build

Release-target-only checks, excluding the Cogs adapter:

npm run check:release-target
npm run test:release-target
npm run build:release-target
npm run pack:release-target:dry-run

Documentation

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors