feat(layers): add shipwrecks layer (EMODnet + Wikidata)

A new Events layer maps shipwrecks with a card per wreck:
- EMODnet Human Activities heritage shipwrecks (about 6,500 in European
  waters, CC BY 4.0), skipping rows taken from wrecksite.eu.
- Wikidata shipwrecks with a Wikipedia article plus sinking events
  (CC0); an event folds into its ship for the date and death toll.
- A same-origin /api/shipwrecks proxy refreshes once a day and serves
  the last snapshot as stale for up to a week.

Markers are a boat icon coloured by era and sized by deaths; four era
chips filter the layer. The card follows the air-accidents layout
(deaths first). Text that names people is dropped; victims appear as
a count only.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Itallo BrandãoandClaude Opus 5.5 committed 2026-11-05 04:42:59 -03:00
1 parent 7d8b80db0a
commit dcd0f2cccd
41 files changed
+2168 -73

No files matched your search

+23
View File
@@ -0,0 +1,23 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import { SHIPWRECK_ERAS, eraOf, normalizeEras } from './eras.js';
test('each wreck falls in one era', () => {
assert.equal(eraOf({ year: 1588 }), 'before-1900');
assert.equal(eraOf({ year: null, ancient: true }), 'before-1900');
assert.equal(eraOf({ year: 1900 }), '1900-1945');
assert.equal(eraOf({ year: 1945 }), '1900-1945');
assert.equal(eraOf({ year: 1946 }), 'after-1945');
assert.equal(eraOf({ year: null }), 'undated');
assert.equal(eraOf(null), 'undated');
});
test('era requests keep known eras only', () => {
const all = new Set(SHIPWRECK_ERAS);
assert.deepEqual(
[...normalizeEras(['after-1945', 'bogus'], all)],
['after-1945'],
);
assert.deepEqual([...normalizeEras('after-1945', all)], SHIPWRECK_ERAS);
assert.deepEqual([...normalizeEras([], all)], []);
});