@ofi-data-team/codar-map
v0.1.1
Published
Reusable MapLibre Web Component for CODAR coverage and surface-current data.
Readme
CODAR Map
A reusable MapLibre Web Component for CODAR coverage planning and, as the project grows,
radial (.ruv) and total (.tuv) surface-current data.
The current demonstration renders the theoretical combined coverage supplied in
data/radius.geojson, including the border, existing Nova Scotia
stations, and a proposed Sable Island site. It also includes
3,381 current vectors converted from the CODAR processor's matched 2026-04-08 09:00 UTC
KML snapshots:
- 1,158 combined total-current vectors;
- 1,031 SCOV radial vectors;
- 731 MEDH radial vectors; and
- 461 CLMH radial vectors.
The proposed Sable Island site is surrounded by a geodesic dashed ring derived from the supplied nominal 200 km radius. This individual potential range can be toggled separately from the combined coverage polygon.
Use the Current products multi-select to show any combination of those products. Arrow direction,
signed velocity, bearing, KML heading, and source colour remain available in
data/currents.geojson. The map uses absolute speed for symbol
size and its labelled colour classes. Vector symbols fade between zoom levels 8 and 10
and are hidden at closer zooms to avoid misleading apparent movement in detailed views.
Run locally
npm install
npm run devBuild the static demonstration and reusable library with:
npm run buildRun the Chromium end-to-end suite with:
npm testGitHub Actions runs the same build and browser tests for pull requests and pushes to
main. Failed runs retain the Playwright report for seven days.
Publishing to npm
The public package name is @ofi-data-team/codar-map. Publishing a GitHub release whose
tag exactly matches the package version (for example, v0.1.0) runs the npm publishing
workflow. The first release requires an npm granular access token stored in the GitHub
repository secret NPM_TOKEN. After the package exists, configure npm trusted publishing
for organization OFI-Data-Team, repository codar-map, and workflow filename
publish-package.yml; the workflow already grants the required OIDC permission.
Embed the component
import '@ofi-data-team/codar-map';<codar-current-map style="display:block; height:700px"></codar-current-map>Set src to load a different public GeoJSON FeatureCollection:
<codar-current-map src="https://example.org/codar-coverage.geojson"></codar-current-map>The data host must allow cross-origin browser requests. The bundled OpenStreetMap raster tiles are suitable for development and evaluation; select an approved production basemap before publishing a high-traffic deployment.
Refresh the visualization snapshot
The converter reads current-vector placemarks generated by codar_data_processor and
writes a MapLibre-ready GeoJSON FeatureCollection:
python3 scripts/convert_codar_kml.py \
--output data/currents.geojson \
../codar_data_processor/kml_files/totals_current_20260408T090000Z.kml \
../codar_data_processor/kml_files/station_scov_20260408T090000Z.kml \
../codar_data_processor/kml_files/station_medh_20260408T090000Z.kml \
../codar_data_processor/kml_files/station_clmh_20260408T090000Z.kmlThis is a fixed demonstration snapshot, not a live feed. Regenerate it only from reviewed,
time-matched products. The longer-term raw .ruv/.tuv ingestion contract remains in the
feature specification.
Data note
The supplied Sable Island longitude, 059°684’W, is not valid degrees-and-decimal-minutes
notation. The demonstration provisionally interprets it as 59.684°W because that agrees
with the supplied reference image. Confirm the intended longitude before scientific or
production use.
See the feature specification for the broader raw
.ruv/.tuv library plan and acceptance criteria.
