Central export tooling for the GOOS Report Card and simple-map globe.
Run these scripts before each report edition when refreshing OceanOPS platform data.
Repository: github.com/OceanOPS/oceanops-data-exports
Clone this repo next to the app repos:
OceanOPS/
oceanops-data-exports/ ← this repo
sql/ ← edition filters + @geojson / @partner (shared)
geojson-export/ ← layers.manifest.json, densify
partner-export/ ← country metadata, partner runners
oceanops-report-card/
oceanops-simple-map/
Output paths default to sibling folders (paths.mjs). Override when your clones live elsewhere:
| Variable | CLI flag | Default file / folder |
|---|---|---|
OCEANOPS_REPORT_CARD_ROOT |
--report-card-root= |
src/data/partnerCountries.ts |
OCEANOPS_SIMPLE_MAP_ROOT |
--simple-map-root= |
src/data/partnerCountries.json, public/geojson/ |
PARTNER_COUNTRIES_TS |
--partner-ts= |
full path to .ts |
PARTNER_COUNTRIES_JSON |
--partner-json= |
full path to .json |
GEOJSON_OUTPUT_DIR |
--geojson-dir= |
GeoJSON output directory |
Examples:
# Different parent folder names
OCEANOPS_REPORT_CARD_ROOT=~/work/report-card \
OCEANOPS_SIMPLE_MAP_ROOT=~/work/simple-map \
npm run export:partners
# Write only the map JSON (skip report-card repo check)
npm run export:partners -- --partner-json=/path/to/oceanops-simple-map/src/data/partnerCountries.json
# GeoJSON to a custom directory
npm run export:geojson -- --geojson-dir=/path/to/public/geojson| Script | Description |
|---|---|
npm run export:partners |
Partner counts → report-card TS + simple-map JSON |
npm run export:geojson |
Map layers → oceanops-simple-map/public/geojson/ |
npm run export:all |
Both exports + one combined summary (counts, filters for map + partners) |
npm run export:all:dry-run |
Same as export:all without writing TS/JSON/GeoJSON files |
npm run render:sql -- <file|all|geojson|partners> |
Print SQL with edition values (pgAdmin) |
*:dry-run |
Print SQL or preview without writing files |
../oceanops-report-card/src/data/partnerCountries.ts— report card (until “View full list” is removed).../oceanops-simple-map/src/data/partnerCountries.json— globe country metrics (byGeoCountryNamemapsCANADA→CA, etc.).
Configure edition values in edition.values.json (dates, line lists).
Configure filters and queries in sql/*.sql (-- @where, -- @geojson, -- @partner + {{tokens}}).
partner-export/countryMeta.mjs— EU and other editorial country metadata (display names only; ISO rollup is insql/_partner_country_iso.sql)geoCountryNames.mjs— ISO ↔ GeoJSONcountry_namefor the map
Both exports use the same database settings:
OCEANOPS_DATABASE_URL— Postgres (required;psqlon PATH)- Optional: copy
.env.example→.envin this repo (loaded automatically) - Edition label:
OCEANOPS_EXPORT_EDITION(orPARTNER_EXPORT_EDITION/GEOJSON_EXPORT_EDITION)
Important: assign the URL on the same command as npm, or export it first — otherwise only the first script in export:all may see it:
export OCEANOPS_DATABASE_URL='postgresql://...'
export OCEANOPS_EXPORT_EDITION=isival-test
npm run export:allPARTNER_EXPORT_EDITION— alias for edition label ifOCEANOPS_EXPORT_EDITIONunset
Options: --dry-run
Writes ../oceanops-simple-map/public/geojson/{layerId}.geojson.
- Edit
edition.values.jsonand SQL files undersql/. npm run export:geojson
Uses the same OCEANOPS_DATABASE_URL as partner export (see above).
GEOJSON_EXPORT_EDITION— alias for edition label ifOCEANOPS_EXPORT_EDITIONunset
Options: --dry-run, --layer=argo, --no-densify
Line densification (manual, after editing *_undensified.geojson in simple-map):
npm run densify:geojson -- ../oceanops-simple-map/public/geojson/goship_undensified.geojson ../oceanops-simple-map/public/geojson/goship.geojsonOptional 3rd/4th args: hybrid (default), rhumb, or geodesic, then stepKm (default 80). Implementation: geojson-export/densifyLayer.mjs.
npm run export:partners # in oceanops-report-card
npm run export:geojson # in oceanops-simple-map- Update
edition.values.jsonandsql/*.sqlfor the edition. - From this folder:
npm run export:all - Commit generated artifacts in report-card and simple-map as needed.