diff --git a/DATA_SOURCES.md b/DATA_SOURCES.md index cb9da66e43..695eb478c1 100644 --- a/DATA_SOURCES.md +++ b/DATA_SOURCES.md @@ -411,7 +411,7 @@ The [Bhote Koshi event pack](public/events/bhote-koshi-2026/README.md), under `p | Dataset | Folder | License | Commercial use? | Attribution | | --------------------------------------------------------------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | --------------------------------------------------------------------------- | | **Datacenters** (4,352) | `datacenters/` | **ODbL 1.0** (OpenStreetMap extract) | ✅ (attribution + share-alike on data) | © OpenStreetMap contributors (shared credit) | -| **Dams** (704) | `dams/` | **ODbL 1.0** (OpenInfraMap / OSM extract) | ✅ (attribution + share-alike on data) | © OpenStreetMap contributors (shared credit) + Open Infrastructure Map | +| **Dams** (706) | `dams/` | **ODbL 1.0** (OpenInfraMap / OSM extract + OSM API) | ✅ (attribution + share-alike on data) | © OpenStreetMap contributors (shared credit) + Open Infrastructure Map | | **Military area names** (36,466) | `osm_military_names/` | **ODbL 1.0** (OpenStreetMap, via Overture Maps) | ✅ (attribution + share-alike on data) | © OpenStreetMap contributors (shared credit) + Overture Maps Foundation | | **Ukraine outline** (Rail layer no-positions rule; 1 ring, 7,801 points) | `src/data/railNoPositions.js` | **ODbL 1.0** (OpenStreetMap, via geoBoundaries gbOpen UKR ADM0, commit 9469f09; simplified to 0.0005°) | ✅ (attribution + share-alike on data) | © OpenStreetMap contributors (shared credit) + geoBoundaries | | **Québec CCTV source catalog** (1,120 locations) | `public/quebec-cameras.json` | Mixed: MTQ locations CC BY 4.0; Montréal camera nodes ODbL 1.0; scenic records retain per-record provenance. No video files are bundled or cached. | Location data is per-record; video remains hosted by Québec 511 and its platform terms apply; scenic source pages may have separate terms | MTQ / Données Québec CC BY 4.0; © OpenStreetMap contributors (ODbL); scenic operator and position source shown in the selected-camera panel | @@ -485,7 +485,7 @@ credits it anyway as `SPECS: CCTV-DATABASE.COM` beside any spec line it renders. ### Bundled OpenStreetMap data -Bundled OSM-derived data is distributed under [ODbL 1.0](https://opendatacommons.org/licenses/odbl/1-0/), separately from the MIT code: [datacenters](src/data/local_data/datacenters/), [dams](src/data/local_data/dams/) (via Open Infrastructure Map), [military names](src/data/local_data/osm_military_names/), the Rail layer's Ukraine outline in [`railNoPositions.js`](src/data/railNoPositions.js) (OpenStreetMap via geoBoundaries gbOpen, Runfola et al. 2020, simplified; the module's code stays MIT), and [OSM test fixtures](src/data/fixtures/). Keep © OpenStreetMap contributors and offer modified databases under ODbL. +Bundled OSM-derived data is distributed under [ODbL 1.0](https://opendatacommons.org/licenses/odbl/1-0/), separately from the MIT code: [datacenters](src/data/local_data/datacenters/), [dams](src/data/local_data/dams/) (from Open Infrastructure Map and the OpenStreetMap API), [military names](src/data/local_data/osm_military_names/), the Rail layer's Ukraine outline in [`railNoPositions.js`](src/data/railNoPositions.js) (OpenStreetMap via geoBoundaries gbOpen, Runfola et al. 2020, simplified; the module's code stays MIT), and [OSM test fixtures](src/data/fixtures/). Keep © OpenStreetMap contributors and offer modified databases under ODbL. ### NASA FIRMS acknowledgement diff --git a/README.md b/README.md index dce218cccb..277b76e785 100644 --- a/README.md +++ b/README.md @@ -480,7 +480,7 @@ In the app, **Data Layers** groups them as Movement, Cameras, Infrastructure, Ev | 🟡 A free Cesium ion token | **Google Photorealistic 3D cities** and world terrain — eligible personal, non-commercial use; current ion terms and quotas apply | | 🔴 A Google Maps key | The same 3D direct from Google, plus Google place search — the billing-enabled, metered route | -**Also on the globe:** neighborhood overlays · an optional cockpit WX cloud effect. **Bundled static infrastructure:** Datacenters (4,352), Dams (704), and Submarine Cables (712). +**Also on the globe:** neighborhood overlays · an optional cockpit WX cloud effect. **Bundled static infrastructure:** Datacenters (4,352), Dams (706), and Submarine Cables (712). **Missing a layer you want?** Open an issue — or add it and send the PR. diff --git a/changelog.d/1152-acaray-yacyreta-dams.md b/changelog.d/1152-acaray-yacyreta-dams.md new file mode 100644 index 0000000000..01b99c6c70 --- /dev/null +++ b/changelog.d/1152-acaray-yacyreta-dams.md @@ -0,0 +1,3 @@ +- Add the Acaray and Yacyretá dams from OpenStreetMap to the Dams layer, and + credit the layer to OpenStreetMap / OpenInfraMap instead of USACE (radianx, + #1152). diff --git a/docs/INFRASTRUCTURE-LAYERS.md b/docs/INFRASTRUCTURE-LAYERS.md index f8f9b48623..bcfece2df4 100644 --- a/docs/INFRASTRUCTURE-LAYERS.md +++ b/docs/INFRASTRUCTURE-LAYERS.md @@ -83,6 +83,6 @@ Consumers use the package exports, which do not import standalone application globals. Dataset files and source/license notices remain under `src/data/local_data/`. -Their input counts are 4,352 datacenter features and 704 dam features. A multipart +Their input counts are 4,352 datacenter features and 706 dam features. A multipart geometry draws as several parts, each with its own stem; part and stem counts are -different measurements from feature counts. This change does not refresh or relicense the datasets. +different measurements from feature counts. diff --git a/src/data/infrastructure.js b/src/data/infrastructure.js index 348d4bfb44..ba80ad0a2c 100644 --- a/src/data/infrastructure.js +++ b/src/data/infrastructure.js @@ -32,7 +32,7 @@ export function createInfrastructureLayers(services) { name: 'Dams', color: '#0088ff', // Blue icon: '▰', - source: 'USACE', + source: 'OpenStreetMap / OpenInfraMap', osmDerived: true, labels: true, labelMax: 900, diff --git a/src/data/infrastructure.test.mjs b/src/data/infrastructure.test.mjs index ff72d790f5..677bde3131 100644 --- a/src/data/infrastructure.test.mjs +++ b/src/data/infrastructure.test.mjs @@ -6,6 +6,7 @@ import { createInfrastructureLayers } from 'gods-eye-view/infrastructure'; import { createLocalGeoJsonLayer } from 'gods-eye-view/infrastructure/geojson'; import { fakeInput } from '../input/testDoubles.mjs'; import { bindFakeGroundRenderer } from '../testSupport/fakeGroundRenderer.mjs'; +import { parseGeojsonLines } from '../sources/infrastructureData.js'; function services() { const records = new Map(); @@ -34,6 +35,20 @@ function services() { }; } +// Added from the OSM API, not the OpenInfraMap extract: [id, name, OSM +// object, version]. Both must stay polygons: the Dams layer skips +// LineStrings. +const OSM_API_DAMS = [ + [262532166, 'Acaray', 'way/262532166', 7], + [-5671745, 'Represa Yacyretá-Apipé', 'relation/5671745', 2], +]; +const DAMS = parseGeojsonLines( + readFileSync( + new URL('./local_data/dams/dams.geojsonl', import.meta.url), + 'utf8', + ), +); + test('package exports import without an application, DOM, fetch, or timers', () => { const result = spawnSync( process.execPath, @@ -66,7 +81,11 @@ test('infrastructure factory preserves identity and creates independent state wi first.map(({ id, name, source }) => ({ id, name, source })), [ { id: 'local-datacenters', name: 'Datacenters', source: 'Local' }, - { id: 'local-dams', name: 'Dams', source: 'USACE' }, + { + id: 'local-dams', + name: 'Dams', + source: 'OpenStreetMap / OpenInfraMap', + }, ], ); first.forEach((layer, index) => { @@ -84,7 +103,7 @@ test('infrastructure factory preserves identity and creates independent state wi test('dataset URLs still name the complete bundled sources', () => { for (const [file, count] of [ ['datacenters', 4352], - ['dams', 704], + ['dams', 706], ]) { const lines = readFileSync( new URL(`./local_data/${file}/${file}.geojsonl`, import.meta.url), @@ -96,6 +115,64 @@ test('dataset URLs still name the complete bundled sources', () => { } }); +test('Acaray and Yacyretá appear once each with OSM provenance', () => { + for (const [id, name, object, version] of OSM_API_DAMS) { + const matches = DAMS.filter((feature) => feature.id === id); + assert.equal(matches.length, 1); + const { properties } = matches[0]; + assert.equal(properties.name, name); + assert.equal(properties.osm_id, id); + assert.equal(properties.source_version, version); + assert.equal( + properties.source_url, + `https://www.openstreetmap.org/${object}`, + ); + assert.equal(properties.retrieved_at, '2026-10-15'); + } +}); + +test('Acaray and Yacyretá each get a stem, a selection context and an analyst record', async (t) => { + const added = DAMS.filter((feature) => + OSM_API_DAMS.some(([id]) => id === feature.id), + ); + t.mock.method(globalThis, 'fetch', async () => ({ + ok: true, + text: async () => + added.map((feature) => JSON.stringify(feature)).join('\n'), + })); + const host = services(); + const layer = createLocalGeoJsonLayer( + { + id: 'local-dams', + name: 'Dams', + osmDerived: true, + color: '#0088ff', + url: '/dams.geojsonl', + }, + host, + ); + const viewer = { + scene: { screenSpaceCameraController: { enableInputs: true } }, + }; + const fake = bindFakeGroundRenderer(viewer); + fakeInput(viewer); + t.after(() => layer.destroy(viewer)); + await layer.enable(viewer); + const names = OSM_API_DAMS.map(([, name]) => name).sort(); + assert.equal(fake.set('stems').items.size, 2, 'both dams get a stem'); + assert.deepEqual( + [...host.records.values()].map((record) => record.label).sort(), + names, + ); + assert.deepEqual( + layer + .getAnalystRecords() + .map((record) => record.name) + .sort(), + names, + ); +}); + test('two viewers use their supplied contexts and dispose independently', async (t) => { t.mock.method(globalThis, 'fetch', async () => ({ ok: true, diff --git a/src/data/local_data/dams/README.md b/src/data/local_data/dams/README.md index 8bff208e24..6695ccde5d 100644 --- a/src/data/local_data/dams/README.md +++ b/src/data/local_data/dams/README.md @@ -4,7 +4,7 @@ Extracted from local decoded OpenInfraMap/PostGIS layers. Filters: `waterway=dam`, `man_made=dam`, or `building=dam`. -Feature count: 704 +Feature count: 706 Runtime output: `dams.geojsonl` @@ -15,3 +15,16 @@ this derived database. The public-release snapshot removes contact-oriented fields and note values that contain email or phone identifiers. The runtime layer does not display or depend on those fields. + +## OSM API additions + +Two dams come from the public OpenStreetMap API rather than the extract: + +- Acaray: [way 262532166](https://www.openstreetmap.org/way/262532166), its closed outline of nine nodes. +- Represa Yacyretá-Apipé: [relation 5671745](https://www.openstreetmap.org/relation/5671745), its eight outer ways joined into one closed outline. + +Both are under the same ODbL 1.0; the relation keeps the extract's negative ID (-5671745). +Keep both as polygons: the Dams layer skips LineStrings. + +The layer puts a polygon's marker at the centre of its bounding sphere. The Yacyretá outline is L-shaped, so its +marker sits about 1.6 km from the outline, over the reservoir. diff --git a/src/data/local_data/dams/dams.geojsonl b/src/data/local_data/dams/dams.geojsonl index 4a8fa39d7e..8b0ec86652 100644 --- a/src/data/local_data/dams/dams.geojsonl +++ b/src/data/local_data/dams/dams.geojsonl @@ -702,3 +702,5 @@ {"id":1415605139,"type":"Feature","geometry":{"type":"LineString","coordinates":[[169.362055788,-45.423612051],[169.360158461,-45.423276272],[169.358642426,-45.4229907],[169.357633077,-45.422794061],[169.356944755,-45.42275366],[169.356044036,-45.422764473]]},"properties":{"id":2377429,"line":"","tags":{"power":"minor_line","voltage":"11000","operator":"Aurora Energy","waterway":"dam","operator:wikidata":"Q4822522"},"type":"minor_line","osm_id":1415605139,"tunnel":false,"disused":"","voltage":"11000","circuits":null,"location":"","frequency":"","construction":"","source_layer":"osm_power_line"}} {"id":405007988,"type":"Feature","geometry":{"type":"Polygon","coordinates":[[[51.592068922,43.199413946],[51.59684602,43.199885177],[51.59724064,43.197759191],[51.593578084,43.197397847],[51.59272137,43.197675623],[51.592397577,43.197643772],[51.592068922,43.199413946]]]},"properties":{"id":33090,"name":"","tags":{"man_made":"wastewater_plant","waterway":"dam"},"type":"wastewater_plant","osm_id":405007988,"source_layer":"osm_wastewater_plant"}} {"id":-19953989,"type":"Feature","geometry":{"type":"MultiLineString","coordinates":[[[14.292237283,46.169084857],[14.292230326,46.169090389],[14.292224878,46.169096341],[14.292219346,46.169103549],[14.292216999,46.169113188],[14.292215322,46.169122744],[14.29221658,46.169131796],[14.292221273,46.169138334],[14.292231918,46.169148225],[14.29223963,46.169150823]],[[14.292171736,46.168911268],[14.292167462,46.168929289],[14.29216654,46.168975893],[14.292183555,46.169023083],[14.292186321,46.169030124],[14.292204593,46.169025933],[14.292237283,46.169084857]],[[14.293466824,46.169211843],[14.293464394,46.169201869],[14.293090644,46.16923657],[14.293067678,46.169224248],[14.293022583,46.169223662],[14.292636178,46.169247718],[14.292563842,46.169209496],[14.292558394,46.169207988],[14.292478766,46.169186446],[14.292457643,46.169185021],[14.292426882,46.169183429],[14.29241347,46.169186446],[14.292388492,46.169203545],[14.292448842,46.169220477],[14.292470384,46.169226428],[14.292521681,46.169242772],[14.292532661,46.169225673],[14.292546659,46.169229529],[14.29256468,46.169234558],[14.292535679,46.169293483],[14.292533499,46.169297925],[14.292576582,46.169300859],[14.292619162,46.169286191],[14.293023422,46.169262554],[14.293072791,46.169259536],[14.293092321,46.169248388],[14.293466824,46.169211843]],[[14.292535679,46.169293483],[14.29249905,46.169285185],[14.292510198,46.169267248],[14.292313977,46.169211927],[14.292318755,46.169203042],[14.29232546,46.169190721],[14.292333256,46.169176472],[14.292290089,46.169164653],[14.292276175,46.169192062],[14.292257986,46.169227769],[14.29231163,46.169241767],[14.292303919,46.169254842],[14.292294196,46.169271439],[14.292207024,46.169244868],[14.292170647,46.169314522],[14.29248589,46.169394736],[14.292518496,46.169328436],[14.292526123,46.169312845],[14.292533499,46.169297925],[14.292535679,46.169293483]],[[14.292426882,46.169183429],[14.292448172,46.169103549],[14.292476838,46.169107153],[14.292457643,46.169185021],[14.292426882,46.169183429]],[[14.292237283,46.169084857],[14.292246922,46.169084941],[14.292247257,46.169081086],[14.292319845,46.169084857],[14.292448172,46.169103549],[14.292476838,46.169107153],[14.292575074,46.169109333],[14.292575493,46.169095838],[14.292480777,46.169093156],[14.292326383,46.169069099],[14.292247341,46.169065747],[14.292242228,46.169055269],[14.292266117,46.169050324],[14.292263099,46.169041858],[14.292231835,46.169048899],[14.292217418,46.169022161],[14.292267374,46.16901336],[14.292264943,46.169006235],[14.292183555,46.169023083],[14.292186321,46.169030124],[14.292204593,46.169025933],[14.292237283,46.169084857]]]},"properties":{"name":"HE Podlubnik - Centrala","tags":{"name":"HE Podlubnik - Centrala","type":"site","power":"plant","alt_name":"HE Škofja Loka","operator":"Elektro Gorenjska","waterway":"dam","start_date":"1969","plant:method":"run-of-the-river","plant:source":"hydro","plant:output:electricity":"330KW"},"osm_id":-19953989,"output":"330KW","source":"hydro","construction":"","source_layer":"power_plant_relation_by_geom_type"}} +{"type":"Feature","id":-5671745,"geometry":{"type":"Polygon","coordinates":[[[-56.7356385,-27.4830326],[-56.7356372,-27.4836817],[-56.7356918,-27.4837745],[-56.7356509,-27.4838875],[-56.7355326,-27.4837665],[-56.7354735,-27.4836131],[-56.7353507,-27.4835526],[-56.7353552,-27.4830522],[-56.7354053,-27.483032],[-56.7354041,-27.4829378],[-56.7350345,-27.4826704],[-56.7321442,-27.4826598],[-56.7319588,-27.4828659],[-56.7018972,-27.4827418],[-56.7018797,-27.4821358],[-56.706089,-27.4821869],[-56.7060921,-27.4821089],[-56.7063455,-27.482095],[-56.7063734,-27.4821649],[-56.7090948,-27.482163],[-56.7091818,-27.4821095],[-56.7093995,-27.4820799],[-56.7094201,-27.4821854],[-56.7106196,-27.4821876],[-56.7109955,-27.4820628],[-56.7121754,-27.4820408],[-56.7121751,-27.4817168],[-56.712209,-27.4817165],[-56.7122144,-27.4803221],[-56.7121755,-27.4803209],[-56.7121781,-27.4793322],[-56.7122425,-27.4793286],[-56.7122439,-27.4791204],[-56.7121688,-27.479118],[-56.7121795,-27.4788039],[-56.7122371,-27.4788007],[-56.7122492,-27.4788015],[-56.7122948,-27.4790038],[-56.7123002,-27.4793441],[-56.7123005,-27.4796668],[-56.7124411,-27.4796679],[-56.7125759,-27.4796689],[-56.7125765,-27.47935],[-56.7125805,-27.4792477],[-56.7125939,-27.4790371],[-56.7126422,-27.4788016],[-56.7126649,-27.4788009],[-56.7127186,-27.4788051],[-56.7127213,-27.4791216],[-56.7126462,-27.4791276],[-56.7126516,-27.4793274],[-56.7127079,-27.4793263],[-56.7127072,-27.4803126],[-56.7126744,-27.4803132],[-56.712673,-27.4817118],[-56.7127239,-27.481713],[-56.7127247,-27.4820404],[-56.7132439,-27.4820594],[-56.7135349,-27.4821853],[-56.716431,-27.4821918],[-56.7166924,-27.4821402],[-56.7169096,-27.482192],[-56.7354167,-27.4822992],[-56.7432767,-27.4822775],[-56.7432829,-27.4821624],[-56.7433092,-27.4820925],[-56.7433441,-27.4820092],[-56.743387,-27.4819117],[-56.7433977,-27.481826],[-56.7434058,-27.481362],[-56.743385,-27.4806888],[-56.7435047,-27.4806879],[-56.7435053,-27.480804],[-56.7517581,-27.4808023],[-56.7519858,-27.4807842],[-56.7522074,-27.4807224],[-56.7529074,-27.4805122],[-56.7530675,-27.4804512],[-56.753188,-27.4804018],[-56.7536873,-27.4801667],[-56.7539035,-27.480035],[-56.7540186,-27.4799455],[-56.7546428,-27.4793125],[-56.7548624,-27.4789803],[-56.755134,-27.4784449],[-56.7553243,-27.4776504],[-56.7553385,-27.4775558],[-56.7553453,-27.4773839],[-56.7553663,-27.453364],[-56.756278,-27.4533505],[-56.7566902,-27.4545407],[-56.7565699,-27.4671653],[-56.7566153,-27.4769172],[-56.7565098,-27.4782975],[-56.7561882,-27.4791614],[-56.7557343,-27.4797995],[-56.7548315,-27.4808659],[-56.7541622,-27.4813087],[-56.753515,-27.4815729],[-56.7529038,-27.4817915],[-56.7522708,-27.4819086],[-56.7486914,-27.4820093],[-56.7480953,-27.4820155],[-56.7478466,-27.4820264],[-56.747675,-27.4820455],[-56.7475127,-27.4820919],[-56.7469953,-27.4823096],[-56.7450435,-27.4829093],[-56.7443696,-27.4830283],[-56.7436163,-27.4830891],[-56.7434021,-27.483068],[-56.7396907,-27.4830592],[-56.7396861,-27.4833826],[-56.7394399,-27.4833826],[-56.739439,-27.4830604],[-56.7356385,-27.4830326]]]},"properties":{"name":"Represa Yacyretá-Apipé","tags":{"name":"Represa Yacyretá-Apipé","type":"multipolygon","waterway":"dam"},"osm_id":-5671745,"source_layer":"osm_relation","source_url":"https://www.openstreetmap.org/relation/5671745","source_version":2,"retrieved_at":"2026-10-15"}} +{"type":"Feature","id":262532166,"geometry":{"type":"Polygon","coordinates":[[[-54.6285064,-25.4587626],[-54.628456,-25.4586556],[-54.6286513,-25.458535],[-54.6287352,-25.4587382],[-54.6292971,-25.459876],[-54.6290649,-25.4599721],[-54.6285037,-25.4588762],[-54.6285459,-25.4588065],[-54.6285064,-25.4587626]]]},"properties":{"name":"Acaray","tags":{"name":"Acaray","waterway":"dam","wikidata":"Q3433454"},"osm_id":262532166,"source_layer":"osm_way","source_url":"https://www.openstreetmap.org/way/262532166","source_version":7,"retrieved_at":"2026-10-15"}} diff --git a/src/tools/queries/infrastructure.js b/src/tools/queries/infrastructure.js index 8f80fa4418..5689fee547 100644 --- a/src/tools/queries/infrastructure.js +++ b/src/tools/queries/infrastructure.js @@ -17,7 +17,7 @@ const KINDS = { }; const ATTRIBUTION = { datacenters: '© OpenStreetMap contributors (ODbL 1.0)', - dams: '© OpenStreetMap contributors (ODbL 1.0), via Open Infrastructure Map', + dams: '© OpenStreetMap contributors (ODbL 1.0) + Open Infrastructure Map', }; const round = (value, digits) => diff --git a/src/tools/queries/infrastructure.test.mjs b/src/tools/queries/infrastructure.test.mjs index d2f209793c..3c4d8a275d 100644 --- a/src/tools/queries/infrastructure.test.mjs +++ b/src/tools/queries/infrastructure.test.mjs @@ -119,6 +119,10 @@ test('datacenters and dams are listed nearest first with their own fields', asyn lon: -114.737, distance_km: 3.8, }); + assert.equal( + dams.data.attribution, + '© OpenStreetMap contributors (ODbL 1.0) + Open Infrastructure Map', + ); }); test('the bundled datasets load through the local fetch', async () => { @@ -135,6 +139,8 @@ test('the bundled datasets load through the local fetch', async () => { (record) => Number.isFinite(record.lat) && Number.isFinite(record.lon), ), ); + for (const name of ['Acaray', 'Represa Yacyretá-Apipé']) + assert.equal(dams.filter((record) => record.name === name).length, 1, name); assert.equal(await source.getRecords('local-dams'), dams); await assert.rejects( source.getRecords('local-other'),