mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Merge origin/main into claude/hal-676-gev-fire-intensity-742bd1
Main moved the layer rows to Vue, so the fire confidence switch and minimum-FRP slider now render through RowSwitch and RowSlider on the kit's UiSegmented and UiSlider, with the same classes as before. The fire filter strings are translated into Arabic.
This commit is contained in:
commit
02953665de
665 files changed
+44368
-19993
No files matched your search
@@ -57,6 +57,7 @@ export const findSubmarineCables = defineTool({
|
||||
Number.isFinite(point.lat) &&
|
||||
(!area || areaContains(area, point)),
|
||||
);
|
||||
const seen = new Set();
|
||||
const rows = (cables?.features || [])
|
||||
.filter((feature) => {
|
||||
const name = String(feature.properties?.name || '');
|
||||
@@ -71,6 +72,11 @@ export const findSubmarineCables = defineTool({
|
||||
id: feature.properties.id ?? null,
|
||||
name: feature.properties.name,
|
||||
}))
|
||||
// TeleGeography splits some cables into several features under one id.
|
||||
.filter((row) => {
|
||||
const key = row.id ?? row.name;
|
||||
return !seen.has(key) && seen.add(key);
|
||||
})
|
||||
.sort((a, b) => a.name.localeCompare(b.name));
|
||||
const where = area ? ` in ${area.label}` : '';
|
||||
const what = wanted ? ` matching "${args.name}"` : '';
|
||||
|
||||
@@ -89,6 +89,59 @@ test('cables are found by area and name, with landing points and attribution', a
|
||||
);
|
||||
});
|
||||
|
||||
test('a cable split into several features is listed once', async () => {
|
||||
// TeleGeography splits a few cables (2Africa, Echo, Hawaiki) into several
|
||||
// features under one id.
|
||||
const cable = (id, name, coordinates) => ({
|
||||
properties: { id, name },
|
||||
geometry: { type: 'MultiLineString', coordinates: [coordinates] },
|
||||
});
|
||||
const split = {
|
||||
async fetch() {
|
||||
return {
|
||||
cables: {
|
||||
features: [
|
||||
cable('2africa', '2Africa', [
|
||||
[60, 18],
|
||||
[57, 22],
|
||||
]),
|
||||
cable('equiano', 'Equiano', [
|
||||
[-10, 5],
|
||||
[3, 6],
|
||||
]),
|
||||
cable('2africa', '2Africa', [
|
||||
[-21, 16],
|
||||
[-17, 14],
|
||||
]),
|
||||
],
|
||||
},
|
||||
landingPoints: { features: [] },
|
||||
};
|
||||
},
|
||||
};
|
||||
const catalog = composeCatalog({
|
||||
tools: coreTools,
|
||||
services: { cables: split },
|
||||
});
|
||||
const named = await catalog.call('find_submarine_cables', {
|
||||
name: '2africa',
|
||||
});
|
||||
assert.equal(named.summary, '1 submarine cable matching "2africa".');
|
||||
assert.deepEqual(named.data.rows, [{ id: '2africa', name: '2Africa' }]);
|
||||
const both = await catalog.call('find_submarine_cables', {
|
||||
area: { bbox: [-30, 0, 70, 30] },
|
||||
});
|
||||
assert.deepEqual(
|
||||
both.data.rows.map((row) => row.id),
|
||||
['2africa', 'equiano'],
|
||||
);
|
||||
// Only the second part crosses this box; the cable is still found.
|
||||
const west = await catalog.call('find_submarine_cables', {
|
||||
area: { bbox: [-25, 10, -10, 20] },
|
||||
});
|
||||
assert.deepEqual(west.data.rows, [{ id: '2africa', name: '2Africa' }]);
|
||||
});
|
||||
|
||||
test('the local fetch serves bundled data files and nothing outside them', async () => {
|
||||
const fetchImpl = createApiFetch({
|
||||
apiBase: 'http://127.0.0.1:1',
|
||||
|
||||
Reference in new issue
Block a user