mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
Merge main into feat/rio-transit-gtfs-rt
Resolves the DATA_SOURCES.md conflict by keeping main's rewritten Transit and Radio bullets and restating the count for this branch: eighteen feeds covering seventeen regions (the two Rio feeds share one region). Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
commit
1b0b4a10dc
1278 files changed
+108256
-21963
No files matched your search
+167
-14
@@ -123,7 +123,7 @@ export function decodeRing(encoded, decimals) {
|
||||
}
|
||||
|
||||
/** Even-odd point-in-ring test; ring is [[lon, lat], …], open or closed. */
|
||||
function pointInRing(ring, lat, lon) {
|
||||
export function pointInRing(ring, lat, lon) {
|
||||
if (!Array.isArray(ring) || ring.length < 3) return false;
|
||||
let inside = false;
|
||||
for (let i = 0, j = ring.length - 1; i < ring.length; j = i, i += 1) {
|
||||
@@ -150,17 +150,60 @@ export function polygonsContain(polygons, lat, lon) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether polygons contain a point. A part whose outer ring crosses the
|
||||
* antimeridian ([179.99, …], [-179.99, …]) is read contiguously in its own
|
||||
* longitude frame, with the point moved into that frame; every other part,
|
||||
* including one genuinely wider than 180°, is tested as stored. Crossing is
|
||||
* read from an edge jumping more than 180°, which assumes densely noded rings
|
||||
* (OSM, Nominatim, tiles); a ring that is both wider than 180° and crossing, or
|
||||
* a non-crossing ring with a single edge over 180°, is not supported.
|
||||
*/
|
||||
export function containsAnchor(polygons, lat, lon) {
|
||||
if (!Number.isFinite(lon)) return false;
|
||||
for (const part of polygons || []) {
|
||||
const outer = part?.[0];
|
||||
if (!Array.isArray(outer) || !outer.length) continue;
|
||||
const reference = outer[0][0];
|
||||
const shift = (x) => x - 360 * Math.round((x - reference) / 360);
|
||||
const span = (ring, f) => {
|
||||
let west = Infinity;
|
||||
let east = -Infinity;
|
||||
for (const [x] of ring) {
|
||||
west = Math.min(west, f(x));
|
||||
east = Math.max(east, f(x));
|
||||
}
|
||||
return east - west;
|
||||
};
|
||||
// An edge jumping more than 180° wraps the line; a polar ring whose
|
||||
// edges run along ±180 collapses when reframed and is read as stored.
|
||||
const jumps = outer.some(
|
||||
([x], i) => i > 0 && Math.abs(x - outer[i - 1][0]) > 180,
|
||||
);
|
||||
const framedSpan = jumps ? span(outer, shift) : 0;
|
||||
const crosses = framedSpan > 0 && framedSpan < 180;
|
||||
const framed = crosses
|
||||
? part.map((ring) => ring.map(([x, y]) => [shift(x), y]))
|
||||
: part;
|
||||
if (polygonsContain([framed], lat, crosses ? shift(lon) : lon)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* A unit's geometry, decoded on first use. Longitudes are unwrapped around
|
||||
* the largest part for the box so units cut at the antimeridian (Alaska,
|
||||
* Chukotka) get a box on the right side of the globe.
|
||||
* Chukotka) get a box on the right side of the globe. An entry from another
|
||||
* encoding supplies `decode()` returning the same `[outer, ...holes][]`.
|
||||
*/
|
||||
function geometryOf(entry) {
|
||||
export function geometryOf(entry) {
|
||||
if (entry.geometry) return entry.geometry;
|
||||
const decimals = entry.feature.d ?? entry.decimals;
|
||||
const polygons = entry.feature.polygons.map((poly) =>
|
||||
poly.map((ring) => decodeRing(ring, decimals)),
|
||||
);
|
||||
const polygons = entry.decode
|
||||
? entry.decode()
|
||||
: entry.feature.polygons.map((poly) =>
|
||||
poly.map((ring) => decodeRing(ring, decimals)),
|
||||
);
|
||||
const ref = polygons[0]?.[0]?.[0]?.[0] ?? 0;
|
||||
let west = Infinity;
|
||||
let south = Infinity;
|
||||
@@ -178,7 +221,7 @@ function geometryOf(entry) {
|
||||
if (lat > north) north = lat;
|
||||
}
|
||||
}
|
||||
const label = entry.feature.label
|
||||
const label = Array.isArray(entry.feature.label)
|
||||
? { lon: entry.feature.label[0], lat: entry.feature.label[1] }
|
||||
: ringCentroid(polygons[0][0]);
|
||||
entry.geometry = {
|
||||
@@ -208,7 +251,7 @@ function ringCentroid(ring) {
|
||||
}
|
||||
|
||||
/** Km from a point to a unit's box (0 inside it). */
|
||||
function boxDistanceKm(bbox, lat, lon) {
|
||||
export function boxDistanceKm(bbox, lat, lon) {
|
||||
const [west, south, east, north] = bbox;
|
||||
const mid = (west + east) / 2;
|
||||
const x = lon - 360 * Math.round((lon - mid) / 360);
|
||||
@@ -378,6 +421,49 @@ const COUNTRY_TARGET_ALIASES = new Map([
|
||||
['drc', 'democratic republic of the congo'],
|
||||
]);
|
||||
|
||||
/**
|
||||
* Country aliases that are another name for the very same unit. "Great
|
||||
* Britain" and "Britain" are islands, "America" is also two continents and
|
||||
* "Korea" two countries, so those find a country without naming it.
|
||||
*/
|
||||
const COUNTRY_IDENTITY_ALIASES = new Set([
|
||||
'usa',
|
||||
'us',
|
||||
'u s',
|
||||
'u s a',
|
||||
'united states',
|
||||
'uk',
|
||||
'u k',
|
||||
'russian federation',
|
||||
'czechia',
|
||||
'tanzania',
|
||||
'drc',
|
||||
]);
|
||||
|
||||
/**
|
||||
* The unit an ask names in the matcher's own terms, when its words differ
|
||||
* from the unit's name: "State of Texas" names Texas at admin level 1, and
|
||||
* "USA" or "Country of USA" names United States of America. Null when the
|
||||
* ask is just a name. Names are folded with `normalizeAdminName`.
|
||||
* @param {string} text
|
||||
* @returns {{name: string, level: 'country'|'admin1'}|null}
|
||||
*/
|
||||
export function adminQueryIdentity(text) {
|
||||
const parsed = parseAdminQuery(text);
|
||||
if (!parsed?.name) return null;
|
||||
if (parsed.kind === 'state' && parsed.form === 'prefix')
|
||||
return { name: parsed.name, level: 'admin1' };
|
||||
if (parsed.kind !== 'country' && parsed.kind !== 'any') return null;
|
||||
if (COUNTRY_IDENTITY_ALIASES.has(parsed.name))
|
||||
return {
|
||||
name: COUNTRY_TARGET_ALIASES.get(parsed.name),
|
||||
level: 'country',
|
||||
};
|
||||
return parsed.kind === 'country'
|
||||
? { name: parsed.name, level: 'country' }
|
||||
: null;
|
||||
}
|
||||
|
||||
const COUNTRY_ALIASES = new Map([
|
||||
...COUNTRY_TARGET_ALIASES,
|
||||
['england', 'united kingdom'],
|
||||
@@ -399,8 +485,8 @@ const COUNTY_WORDS = [
|
||||
];
|
||||
const COUNTY_WORD_RE = new RegExp(`\\b(${COUNTY_WORDS.join('|')})\\b`);
|
||||
const STATE_PREFIX_RE =
|
||||
/^(?:free state|state|commonwealth|province|territory|prefecture|region|land|canton|department) of (.+)$/;
|
||||
const STATE_SUFFIX_RE = /^(.+) (?:state|province|prefecture|territory)$/;
|
||||
/^(free state|state|commonwealth|province|territory|prefecture|region|land|canton|department) of (.+)$/;
|
||||
const STATE_SUFFIX_RE = /^(.+) (state|province|prefecture|territory)$/;
|
||||
|
||||
/**
|
||||
* Split an ask into what it names and how.
|
||||
@@ -461,14 +547,17 @@ export function parseAdminQuery(text) {
|
||||
if (prefix)
|
||||
return {
|
||||
kind: 'state',
|
||||
name: prefix[1],
|
||||
name: prefix[2],
|
||||
qualifiers,
|
||||
postal: null,
|
||||
countyWord: null,
|
||||
full: head,
|
||||
form: 'prefix',
|
||||
adminType: prefix[1],
|
||||
};
|
||||
const suffix = STATE_SUFFIX_RE.exec(head);
|
||||
// South Africa's canonical province name is literally "Free State"; do not
|
||||
// strip its final word as though the ask explicitly named an admin type.
|
||||
const suffix = head === 'free state' ? null : STATE_SUFFIX_RE.exec(head);
|
||||
if (suffix)
|
||||
return {
|
||||
kind: 'state',
|
||||
@@ -478,6 +567,7 @@ export function parseAdminQuery(text) {
|
||||
countyWord: null,
|
||||
full: head,
|
||||
form: 'suffix',
|
||||
adminType: suffix[2],
|
||||
};
|
||||
return {
|
||||
kind: 'any',
|
||||
@@ -489,6 +579,30 @@ export function parseAdminQuery(text) {
|
||||
};
|
||||
}
|
||||
|
||||
/** Explicit wording is stronger than a stale same-name geometry. */
|
||||
function explicitStateTypeFits(entry, parsed) {
|
||||
if (!parsed.adminType) return true;
|
||||
const words = new Set(
|
||||
normalizeAdminName(entry.feature?.type)
|
||||
.split(/[^a-z]+/)
|
||||
.filter(Boolean),
|
||||
);
|
||||
const accepted =
|
||||
{
|
||||
'free state': ['state'],
|
||||
state: ['state'],
|
||||
commonwealth: ['state'],
|
||||
province: ['province'],
|
||||
territory: ['territory'],
|
||||
prefecture: ['prefecture'],
|
||||
region: ['region'],
|
||||
land: ['state'],
|
||||
canton: ['canton'],
|
||||
department: ['department', 'departamento'],
|
||||
}[parsed.adminType] || [];
|
||||
return accepted.some((word) => words.has(word));
|
||||
}
|
||||
|
||||
/** A qualifier names the unit's country ("Bavaria, Germany") or the unit
|
||||
* itself ("Washington, DC"). */
|
||||
function qualifierMatches(entry, qualifier) {
|
||||
@@ -505,7 +619,7 @@ function qualifierMatches(entry, qualifier) {
|
||||
* Rank candidates: a unit containing `near` first, then the match tier,
|
||||
* then distance from `near`, then larger area. Returns the ranked list.
|
||||
*/
|
||||
function rank(candidates, near) {
|
||||
export function rank(candidates, near) {
|
||||
const hasNear = Number.isFinite(near?.lat) && Number.isFinite(near?.lon);
|
||||
const scored = candidates.map(({ entry, tier }) => {
|
||||
const geometry = geometryOf(entry);
|
||||
@@ -626,6 +740,10 @@ async function stateCandidates(parsed, { allowAmbiguous = false } = {}) {
|
||||
list = list.filter((i) =>
|
||||
parsed.qualifiers.every((q) => qualifierMatches(i.entry, q)),
|
||||
);
|
||||
// Preserve explicit identity at the selector seam. In particular,
|
||||
// "Bagmati Province" must not select Natural Earth's historical NP-BA
|
||||
// Bagmati Zone merely because the point and normalized name overlap.
|
||||
list = list.filter((i) => explicitStateTypeFits(i.entry, parsed));
|
||||
if (allowAmbiguous) return list;
|
||||
// A bare name answers alone only for a prominent unit — a US state, a
|
||||
// Canadian province, Bavaria — never a French département, an English
|
||||
@@ -721,6 +839,35 @@ export async function findAdminArea(query, { near = null } = {}) {
|
||||
return toResult(ranked[0], candidates.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Every prominent unit an ask's words could mean — countries, and states or
|
||||
* provinces that would answer a bare name (see `stateCandidates`) — for a
|
||||
* caller that asks the user which one ("Georgia", "Punjab") instead of
|
||||
* letting the camera decide. Qualifiers narrow the list as in
|
||||
* `findAdminArea`; minor units ("Kent", "Santa Barbara") are left out.
|
||||
*
|
||||
* @param {string} query
|
||||
* @returns {Promise<AdminArea[]>} Largest first; empty when none.
|
||||
*/
|
||||
export async function findAdminCandidates(query) {
|
||||
const parsed = parseAdminQuery(query);
|
||||
if (!parsed?.name || parsed.kind === 'county') return [];
|
||||
const prominent = ({ entry }) =>
|
||||
entry.kind === 'country' ||
|
||||
(entry.feature.rank ?? Infinity) <= BARE_NAME_MAX_RANK ||
|
||||
Boolean(entry.feature.cityState);
|
||||
const candidates = [
|
||||
...(await countryCandidates(parsed)),
|
||||
...(parsed.kind === 'country'
|
||||
? []
|
||||
: await stateCandidates(parsed, { allowAmbiguous: true })),
|
||||
].filter(prominent);
|
||||
const seen = new Set();
|
||||
return rank(candidates, null)
|
||||
.filter(({ entry }) => !seen.has(entry) && seen.add(entry))
|
||||
.map((scored) => toResult(scored, candidates.length));
|
||||
}
|
||||
|
||||
/**
|
||||
* Geocoder-confirmed lookup: the geocoder typed a country, state or
|
||||
* county, so the unit must carry one of `names` AND contain the geocoded
|
||||
@@ -738,6 +885,12 @@ export async function findAdminAreaAt(names, lat, lon, scope) {
|
||||
.map(parseAdminQuery)
|
||||
.filter((p) => p?.name);
|
||||
if (!parsedList.length) return null;
|
||||
// If the ask explicitly names an admin type, do not let the geocoder's
|
||||
// untyped alias reopen an incompatible historical same-name boundary.
|
||||
const explicitStates = parsedList.filter(
|
||||
(parsed) => parsed.kind === 'state' && parsed.adminType,
|
||||
);
|
||||
const stateParses = explicitStates.length ? explicitStates : parsedList;
|
||||
const containing = (items) => {
|
||||
const out = [];
|
||||
for (const item of items)
|
||||
@@ -782,7 +935,7 @@ export async function findAdminAreaAt(names, lat, lon, scope) {
|
||||
return toResult(rank(found, { lat, lon })[0], found.length);
|
||||
}
|
||||
const states = [];
|
||||
for (const parsed of parsedList)
|
||||
for (const parsed of stateParses)
|
||||
states.push(
|
||||
...(await stateCandidates(
|
||||
{ ...parsed, qualifiers: [] },
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
decodeRing,
|
||||
findAdminArea,
|
||||
findAdminAreaAt,
|
||||
findAdminCandidates,
|
||||
normalizeAdminName,
|
||||
packLoads,
|
||||
parseAdminQuery,
|
||||
@@ -225,6 +226,29 @@ test('geocoder-confirmed lookup: the named unit that contains the point', async
|
||||
assert.equal(await findAdminAreaAt(['Georgia'], 41.7, 44.8, 'state'), null);
|
||||
const newYork = await findAdminAreaAt(['New York'], 42.9, -75.5, 'state');
|
||||
assert.equal(newYork?.id, 'US-NY');
|
||||
assert.equal(
|
||||
(
|
||||
await findAdminAreaAt(
|
||||
['Ontario Province', 'Ontario'],
|
||||
43.6532,
|
||||
-79.3832,
|
||||
'state',
|
||||
)
|
||||
)?.id,
|
||||
'CA-ON',
|
||||
);
|
||||
// Natural Earth still carries the historical NP-BA Bagmati Zone. An ask
|
||||
// for today's province must not silently select that incompatible geometry.
|
||||
assert.equal(
|
||||
await findAdminAreaAt(
|
||||
['Bagmati Province', 'Bagmati'],
|
||||
27.7172,
|
||||
85.324,
|
||||
'state',
|
||||
),
|
||||
null,
|
||||
);
|
||||
assert.deepEqual(await findAdminCandidates('Bagmati Province'), []);
|
||||
// A county the geocoder typed, named without the county word.
|
||||
const travis = await findAdminAreaAt(
|
||||
['Travis', 'Travis County'],
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { readAdsbVerticalRateFpm } from '../sources/adsbFields.js';
|
||||
|
||||
const KNOT_TO_MPS = 0.514444;
|
||||
const FOOT_TO_M = 0.3048;
|
||||
const FPM_TO_MPS = 0.00508;
|
||||
@@ -61,8 +63,7 @@ export function normalizeAdsbLolAircraftState(aircraft, nowSeconds) {
|
||||
const barometricFeet = onGround ? null : finiteNumber(aircraft?.alt_baro);
|
||||
const geometricFeet = finiteNumber(aircraft?.alt_geom);
|
||||
const groundSpeedKnots = finiteNumber(aircraft?.gs);
|
||||
const verticalRateFpm =
|
||||
finiteNumber(aircraft?.baro_rate) ?? finiteNumber(aircraft?.geom_rate);
|
||||
const verticalRateFpm = readAdsbVerticalRateFpm(aircraft);
|
||||
const track = finiteNumber(aircraft?.track);
|
||||
|
||||
return [
|
||||
|
||||
@@ -35,6 +35,10 @@ import { ensureGeoidReady, geoidHeight } from './geoid.js';
|
||||
import { registerPickOwner, unregisterPickOwner } from './pickRegistry.js';
|
||||
import { applyVesselOverlayPolicy } from './vesselLabels.js';
|
||||
import { layerFeedState } from './manager.js';
|
||||
import {
|
||||
presentSelectedVessel,
|
||||
subscribeSelectedVessel,
|
||||
} from '../hudReadouts.js';
|
||||
|
||||
test('open feed with vessels is healthy (null)', () => {
|
||||
assert.equal(deriveAisFeedError({ status: 'open', lastMessageAt: 1, error: null }, 42), null);
|
||||
@@ -856,15 +860,6 @@ function makeTrailSpy() {
|
||||
};
|
||||
}
|
||||
|
||||
function makeClassList(...initial) {
|
||||
const classes = new Set(initial);
|
||||
return {
|
||||
add(value) { classes.add(value); },
|
||||
remove(value) { classes.delete(value); },
|
||||
contains(value) { return classes.has(value); },
|
||||
};
|
||||
}
|
||||
|
||||
function makeInteractionHandler() {
|
||||
return {
|
||||
click: null,
|
||||
@@ -934,14 +929,20 @@ function installWireHarness(picked, stateOverrides = {}) {
|
||||
};
|
||||
const record = makeRecord();
|
||||
const trail = makeTrailSpy();
|
||||
presentSelectedVessel({ text: `AIS: ${record.name}` });
|
||||
let vesselReadout;
|
||||
const stopReadout = subscribeSelectedVessel(
|
||||
(readout) => (vesselReadout = readout),
|
||||
);
|
||||
const hud = {
|
||||
textContent: `AIS: ${record.name}`,
|
||||
classList: makeClassList('active'),
|
||||
get readout() {
|
||||
return vesselReadout;
|
||||
},
|
||||
};
|
||||
|
||||
globalThis.window = windowTarget;
|
||||
globalThis.document = {
|
||||
getElementById: (id) => (id === 'hud-ais-vessel' ? hud : null),
|
||||
getElementById: () => null,
|
||||
};
|
||||
_setVesselStateForTest({
|
||||
records: [record],
|
||||
@@ -966,6 +967,7 @@ function installWireHarness(picked, stateOverrides = {}) {
|
||||
reinstalledHandlers,
|
||||
interactionHandlerFactory,
|
||||
cleanup() {
|
||||
stopReadout();
|
||||
aisLiveVesselsLayer.destroy();
|
||||
if (hadWindow) globalThis.window = priorWindow;
|
||||
else delete globalThis.window;
|
||||
@@ -1091,8 +1093,7 @@ test('vessel interaction wire: id-less 3D Tiles pick deselects and resets the HU
|
||||
harness.handler.click({ position: { x: 10, y: 20 } });
|
||||
|
||||
assert.equal(aisLiveVesselsLayer.getSelectedInfo(), null);
|
||||
assert.equal(harness.hud.textContent, 'AIS: --');
|
||||
assert.equal(harness.hud.classList.contains('active'), false);
|
||||
assert.equal(harness.hud.readout, null);
|
||||
// Clicking away is a deliberate deselect, not the vessel aging out of the
|
||||
// feed. Consumers that keep a readout on screen (the Cockpit Contact
|
||||
// panel) tear down on 'deliberate' and hold last-known on 'evicted'.
|
||||
@@ -1119,8 +1120,7 @@ test('vessel interaction wire: empty pick deselects and emits gev:entity-selecti
|
||||
harness.handler.click({ position: { x: 10, y: 20 } });
|
||||
|
||||
assert.equal(aisLiveVesselsLayer.getSelectedInfo(), null);
|
||||
assert.equal(harness.hud.textContent, 'AIS: --');
|
||||
assert.equal(harness.hud.classList.contains('active'), false);
|
||||
assert.equal(harness.hud.readout, null);
|
||||
// Empty pick is a deliberate deselect — see the note above.
|
||||
assert.deepEqual(cleared, [{ layerId: 'ais-live-vessels', reason: 'deliberate' }]);
|
||||
} finally {
|
||||
@@ -1133,8 +1133,7 @@ test('vessel interaction wire: Escape deselects the selected vessel', () => {
|
||||
try {
|
||||
harness.keyTarget.dispatch({ key: 'Escape' });
|
||||
assert.equal(aisLiveVesselsLayer.getSelectedInfo(), null);
|
||||
assert.equal(harness.hud.textContent, 'AIS: --');
|
||||
assert.equal(harness.hud.classList.contains('active'), false);
|
||||
assert.equal(harness.hud.readout, null);
|
||||
} finally {
|
||||
harness.cleanup();
|
||||
}
|
||||
@@ -1322,6 +1321,27 @@ test('buildVesselCard: heading falls back to course; missing parts are omitted',
|
||||
assert.deepEqual(bare.details, []);
|
||||
});
|
||||
|
||||
test('vessel cards read a course that rounds to north as 0°, not 360°', () => {
|
||||
const card = (course) => buildVesselCard(makeRecord({ heading: null, course })).details[0];
|
||||
assert.equal(card(359.4), 'CONTAINER SHIP · 14.5KT · 359°');
|
||||
assert.equal(card(359.7), 'CONTAINER SHIP · 14.5KT · 0°');
|
||||
assert.equal(
|
||||
buildSelectedVesselCard(makeRecord({ heading: null, course: 359.7 })).details[0],
|
||||
'CONTAINER SHIP · 14.5KT · 0°',
|
||||
);
|
||||
});
|
||||
|
||||
test('the vessel HUD reads a course that rounds to north as HDG 0DEG', () => {
|
||||
const harness = installWireHarness(undefined, { selectedRecord: null });
|
||||
try {
|
||||
Object.assign(harness.record, { heading: null, course: 359.7 });
|
||||
assert.equal(aisLiveVesselsLayer.selectById(harness.record.mmsi), true);
|
||||
assert.match(harness.hud.readout.text, /HDG: 0DEG/);
|
||||
} finally {
|
||||
harness.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test('buildVesselCard: unnamed vessels title as MMSI; long names truncate', () => {
|
||||
const unnamed = buildVesselCard(makeRecord({ name: 'VESSEL' }));
|
||||
assert.equal(unnamed.title, 'MMSI 353136000');
|
||||
|
||||
+230
-47
@@ -18,7 +18,11 @@
|
||||
*
|
||||
* Providers (injected — keeps the engine pure and node-testable):
|
||||
* getRecords(layerKey) → Array<record> (layer accessor snapshot)
|
||||
* resolveRegionRing(name, signal?) → Promise<{ring, name}|{error:'region-timeout'}|null>
|
||||
* resolveRegionRing(name, {signal}?) → Promise<{name, geometry|ring, prepared?, source?}
|
||||
* |{error:'region-timeout'}|{needsClarification, candidates}|null>
|
||||
* (geometry = MultiPolygon coordinates; islands and holes all count)
|
||||
* resolveAreaScope(scope) → Promise<{ok:true, area:{areaId, name, prepared,
|
||||
* source, approximate}}|{ok:false, code, error}> (area/drawn/annotation)
|
||||
* getViewContext() → {lat, lon, viewRadiusKm, bounds?} (camera-derived)
|
||||
*
|
||||
* @module data/analystEngine
|
||||
@@ -26,6 +30,7 @@
|
||||
|
||||
import { feedProvenanceEnvelope } from './layerSnapshot.js';
|
||||
import { pointInRing } from './naturalEarthRegions.js';
|
||||
import { pointInPreparedArea, prepareArea } from './areaGeometry.js';
|
||||
import { VOICE_LAYER_MANIFEST, voiceLayer } from '../voice/layerManifest.js';
|
||||
import { greatCircleKm } from '../geoDistance.js';
|
||||
|
||||
@@ -67,6 +72,9 @@ const ANALYST_SCOPE_KINDS = Object.freeze([
|
||||
'region',
|
||||
'radius',
|
||||
'anywhere',
|
||||
'area',
|
||||
'drawn',
|
||||
'annotation',
|
||||
]);
|
||||
|
||||
/**
|
||||
@@ -104,9 +112,14 @@ export function haversineKm(lat1, lon1, lat2, lon2) {
|
||||
return greatCircleKm({ lat: lat1, lon: lon1 }, { lat: lat2, lon: lon2 });
|
||||
}
|
||||
|
||||
/** Scope records spatially. scope: {kind:'view'|'region'|'radius'|'anywhere', …}. */
|
||||
/** Scope records spatially. scope: {kind:'view'|'region'|'radius'|'anywhere'|'area', …}. */
|
||||
export function applyScope(records, scope, resolved) {
|
||||
if (!scope || scope.kind === 'anywhere') return records;
|
||||
if (resolved?.prepared) {
|
||||
return records.filter((r) =>
|
||||
pointInPreparedArea(resolved.prepared, r.lat, r.lon),
|
||||
);
|
||||
}
|
||||
if (scope.kind === 'region' && resolved?.ring) {
|
||||
return records.filter(
|
||||
(r) =>
|
||||
@@ -320,6 +333,24 @@ function normalizeSpec(spec, layerKeys) {
|
||||
return {
|
||||
refusal: refusal('BAD_SCOPE', 'A region scope needs a place name.'),
|
||||
};
|
||||
if (
|
||||
kind === 'area' &&
|
||||
(typeof scope.areaId !== 'string' || !scope.areaId.trim())
|
||||
)
|
||||
return {
|
||||
refusal: refusal(
|
||||
'BAD_SCOPE',
|
||||
'An area scope needs the areaId resolve_area returned.',
|
||||
),
|
||||
};
|
||||
if (
|
||||
kind === 'annotation' &&
|
||||
scope.id !== undefined &&
|
||||
(typeof scope.id !== 'string' || !scope.id.trim())
|
||||
)
|
||||
return {
|
||||
refusal: refusal('BAD_SCOPE', 'scope.id must be an annotation id.'),
|
||||
};
|
||||
if (scope.center !== undefined && scope.center !== null) {
|
||||
if (!validLat(scope.center.lat) || !validLon(scope.center.lon))
|
||||
return {
|
||||
@@ -456,7 +487,16 @@ const ANSWERABLE = new Set(['ok', 'empty']);
|
||||
|
||||
/** Rows per scan slice before yielding to the page. */
|
||||
const SCAN_CHUNK = 20_000;
|
||||
/**
|
||||
* A slice also ends after this long: a row inside a large area pays a ray
|
||||
* cast over every edge (a 6,000-vertex outline takes ~200 ms per 20,000 rows),
|
||||
* so the row count alone would still make long tasks.
|
||||
*/
|
||||
const SCAN_BUDGET_MS = 8;
|
||||
/** Rows between clock checks. */
|
||||
const SCAN_CLOCK_EVERY = 256;
|
||||
const yieldToPage = () => new Promise((resolve) => setTimeout(resolve, 0));
|
||||
const clockMs = () => globalThis.performance?.now?.() ?? Date.now();
|
||||
|
||||
/**
|
||||
* Compile the filters into one predicate over (layerKey, row).
|
||||
@@ -597,12 +637,19 @@ export async function selectAnalystRows(
|
||||
let min = Infinity;
|
||||
let max = -Infinity;
|
||||
let seen = 0;
|
||||
let sliceStart = clockMs();
|
||||
for (const { key, rows } of groups) {
|
||||
const kept = [];
|
||||
for (const row of rows) {
|
||||
if (++seen % SCAN_CHUNK === 0) {
|
||||
seen += 1;
|
||||
if (
|
||||
seen % SCAN_CHUNK === 0 ||
|
||||
(seen % SCAN_CLOCK_EVERY === 0 &&
|
||||
clockMs() - sliceStart >= SCAN_BUDGET_MS)
|
||||
) {
|
||||
await yieldToPage();
|
||||
if (!isCurrent()) return null;
|
||||
sliceStart = clockMs();
|
||||
}
|
||||
if (inScope && !inScope(row)) continue;
|
||||
if (!passes(key, row)) continue;
|
||||
@@ -650,9 +697,8 @@ export function createAnalystEngine(providers) {
|
||||
/**
|
||||
* Run one query.
|
||||
* @param {object} spec Query arguments (see the analyst_query tool).
|
||||
* @param {{isCurrent?: () => boolean, signal?: AbortSignal,
|
||||
* beforeCommit?: (result: object) => Promise<object|void>}} [options]
|
||||
* A query that is no longer current
|
||||
* @param {{signal?: AbortSignal, isCurrent?: () => boolean, beforeCommit?: (result: object) =>
|
||||
* Promise<object|void>}} [options] A query that is no longer current
|
||||
* (cancelled or superseded while awaiting a boundary or between scan
|
||||
* slices) returns CANCELLED and never replaces the follow-up memory.
|
||||
* `beforeCommit` lets a caller finish required async projection work and
|
||||
@@ -662,7 +708,7 @@ export function createAnalystEngine(providers) {
|
||||
*/
|
||||
async function query(
|
||||
spec = {},
|
||||
{ isCurrent = () => true, signal = undefined, beforeCommit = null } = {},
|
||||
{ signal = null, isCurrent = () => true, beforeCommit = null } = {},
|
||||
) {
|
||||
const cancelled = () =>
|
||||
refusal('CANCELLED', 'This query was superseded.', { cancelled: true });
|
||||
@@ -673,6 +719,7 @@ export function createAnalystEngine(providers) {
|
||||
{ coverage: { layersQueried: [], scope: 'none' } },
|
||||
);
|
||||
const followUp = Boolean(spec.followUp);
|
||||
const inheritsRememberedScope = followUp && spec.scope == null;
|
||||
// A follow-up re-filters the remembered set. Layers named explicitly
|
||||
// must be that set: "those hospitals" after an aircraft answer is a new
|
||||
// question, never a filter over the old aircraft.
|
||||
@@ -815,25 +862,37 @@ export function createAnalystEngine(providers) {
|
||||
}
|
||||
|
||||
// 2) Spatial scope
|
||||
const rememberedScope =
|
||||
followUp && !spec.scope ? lastResult.scopePresentation || null : null;
|
||||
const rememberedDistanceOf =
|
||||
followUp && !spec.scope ? lastResult.distanceOf || null : null;
|
||||
const rememberedPresentation = inheritsRememberedScope
|
||||
? lastResult.presentation || null
|
||||
: null;
|
||||
const rememberedCoverageNote =
|
||||
rememberedPresentation?.coverageNote ||
|
||||
(inheritsRememberedScope ? lastResult.coverage?.note : null);
|
||||
const rememberedDistanceOf = inheritsRememberedScope
|
||||
? lastResult.distanceOf || null
|
||||
: null;
|
||||
let resolvedScope = null;
|
||||
let scopeNote = rememberedScope?.coverage || 'anywhere';
|
||||
let scopeSource = rememberedScope?.source || null;
|
||||
let scopeNote =
|
||||
rememberedPresentation?.coverageScope ||
|
||||
(inheritsRememberedScope ? lastResult.coverage?.scope : null) ||
|
||||
'anywhere';
|
||||
let scopeSource =
|
||||
rememberedPresentation?.coverageScopeSource ||
|
||||
(inheritsRememberedScope ? lastResult.coverage?.scopeSource : null) ||
|
||||
null;
|
||||
// Human phrasing for the same scope, so every spoken count can name what it
|
||||
// measured ("8 in view", "about 30 within 250 km of Austin") instead of
|
||||
// arriving as a bare number that contradicts the panel.
|
||||
let scopeLabel = rememberedScope?.label || 'anywhere in the loaded data';
|
||||
let scopeDetail = rememberedScope?.detail || scopeLabel;
|
||||
let scopeLabel =
|
||||
rememberedPresentation?.scopeLabel || 'anywhere in the loaded data';
|
||||
let scopeDetail = rememberedPresentation?.display?.scope || scopeLabel;
|
||||
// A follow-up re-filters a set that was already scoped, so it only narrows
|
||||
// further when a new scope is given.
|
||||
const scope = spec.scope || { kind: followUp ? 'anywhere' : 'view' };
|
||||
if (scope.kind === 'region') {
|
||||
let region;
|
||||
try {
|
||||
region = await providers.resolveRegionRing(scope.name, signal);
|
||||
region = await providers.resolveRegionRing(scope.name, { signal });
|
||||
} catch (error) {
|
||||
// Cancellation belongs to the query owner, not an error's name: a
|
||||
// resource-local AbortError from a current lookup still propagates.
|
||||
@@ -849,7 +908,32 @@ export function createAnalystEngine(providers) {
|
||||
coverage: { layersQueried, scope: `region:${scope.name}:timeout` },
|
||||
};
|
||||
}
|
||||
if (!region?.ring) {
|
||||
if (region?.needsClarification) {
|
||||
return refusal(
|
||||
'NEEDS_CLARIFICATION',
|
||||
region.error ||
|
||||
`"${scope.name}" names more than one place — ask which one.`,
|
||||
{
|
||||
needsClarification: true,
|
||||
query: scope.name,
|
||||
candidates: region.candidates || [],
|
||||
// The way back once the user picks: count over that area.
|
||||
then: 'After the user picks, call resolve_area with that candidateId, then analyst_query with scope {kind:"area", areaId}.',
|
||||
coverage: {
|
||||
layersQueried,
|
||||
scope: `region:${scope.name}:ambiguous`,
|
||||
},
|
||||
},
|
||||
);
|
||||
}
|
||||
const prepared =
|
||||
region?.prepared ||
|
||||
(region?.geometry
|
||||
? prepareArea(region.geometry)
|
||||
: region?.ring
|
||||
? prepareArea([[region.ring]])
|
||||
: null);
|
||||
if (!prepared) {
|
||||
return {
|
||||
ok: false,
|
||||
code: 'REGION_UNRESOLVED',
|
||||
@@ -857,11 +941,39 @@ export function createAnalystEngine(providers) {
|
||||
coverage: { layersQueried, scope: `region:${scope.name}:unresolved` },
|
||||
};
|
||||
}
|
||||
resolvedScope = region;
|
||||
resolvedScope = { ...region, prepared };
|
||||
scopeNote = `region:${region.name}`;
|
||||
scopeSource = region.source || null;
|
||||
scopeLabel = `over ${region.name}`;
|
||||
scopeDetail = scopeLabel;
|
||||
const regionSource = region.sourceLabel || region.source;
|
||||
scopeDetail = `${scopeLabel}${region.approximate ? ' (approximate outline)' : ''}${regionSource ? ` · ${regionSource}` : ''}`;
|
||||
} else if (
|
||||
scope.kind === 'area' ||
|
||||
scope.kind === 'drawn' ||
|
||||
scope.kind === 'annotation'
|
||||
) {
|
||||
const found = providers.resolveAreaScope
|
||||
? await providers.resolveAreaScope(scope)
|
||||
: {
|
||||
ok: false,
|
||||
code: 'AREA_UNAVAILABLE',
|
||||
error: 'Area scopes are not available here.',
|
||||
};
|
||||
if (!isCurrent()) return cancelled();
|
||||
if (!found?.ok || !found.area?.prepared) {
|
||||
return refusal(
|
||||
found?.code || 'AREA_UNKNOWN',
|
||||
found?.error || 'That area is not available.',
|
||||
{ coverage: { layersQueried, scope: `${scope.kind}:unresolved` } },
|
||||
);
|
||||
}
|
||||
const area = found.area;
|
||||
resolvedScope = { prepared: area.prepared, name: area.name };
|
||||
scopeNote = `area:${area.areaId || scope.kind}`;
|
||||
scopeLabel = `inside ${area.name}`;
|
||||
const sourceLabel = area.sourceLabel || area.source;
|
||||
scopeDetail = `${scopeLabel}${area.approximate ? ' (approximate outline)' : ''}${sourceLabel ? ` · ${sourceLabel}` : ''}`;
|
||||
if (area.areaId) resolvedScope.areaId = area.areaId;
|
||||
} else if (scope.kind === 'radius') {
|
||||
// An explicit center always wins. Otherwise, when Contacts is active its
|
||||
// SUBJECT is the centre the operator is actually reasoning about: the
|
||||
@@ -906,25 +1018,21 @@ export function createAnalystEngine(providers) {
|
||||
scopeLabel = 'in view';
|
||||
scopeDetail = `within ${Math.round(view.viewRadiusKm)} km of the view centre`;
|
||||
}
|
||||
const inScope =
|
||||
scope.kind === 'region' && resolvedScope?.ring
|
||||
const inScope = resolvedScope?.prepared
|
||||
? (row) => pointInPreparedArea(resolvedScope.prepared, row.lat, row.lon)
|
||||
: (scope.kind === 'radius' || scope.kind === 'view') &&
|
||||
resolvedScope?.center &&
|
||||
Number.isFinite(resolvedScope.km)
|
||||
? (row) =>
|
||||
Number.isFinite(row.lat) &&
|
||||
Number.isFinite(row.lon) &&
|
||||
pointInRing(resolvedScope.ring, row.lat, row.lon)
|
||||
: (scope.kind === 'radius' || scope.kind === 'view') &&
|
||||
resolvedScope?.center &&
|
||||
Number.isFinite(resolvedScope.km)
|
||||
? (row) =>
|
||||
Number.isFinite(row.lat) &&
|
||||
Number.isFinite(row.lon) &&
|
||||
haversineKm(
|
||||
resolvedScope.center.lat,
|
||||
resolvedScope.center.lon,
|
||||
row.lat,
|
||||
row.lon,
|
||||
) <= resolvedScope.km
|
||||
: null;
|
||||
haversineKm(
|
||||
resolvedScope.center.lat,
|
||||
resolvedScope.center.lon,
|
||||
row.lat,
|
||||
row.lon,
|
||||
) <= resolvedScope.km
|
||||
: null;
|
||||
|
||||
// 3) Filter, count and rank in one pass, yielding between slices.
|
||||
const selection = await selectAnalystRows(groups, {
|
||||
@@ -992,15 +1100,25 @@ export function createAnalystEngine(providers) {
|
||||
// For on-screen text; the model speaks the count and scopeLabel only.
|
||||
display: {
|
||||
scope: scopeDetail,
|
||||
...(windows.length ? { window: windows.join('; ') } : {}),
|
||||
...(caveats.length ? { caveat: caveats.join('; ') } : {}),
|
||||
...(rememberedPresentation?.display?.window || windows.length
|
||||
? {
|
||||
window:
|
||||
rememberedPresentation?.display?.window || windows.join('; '),
|
||||
}
|
||||
: {}),
|
||||
...(rememberedPresentation?.display?.caveat || caveats.length
|
||||
? {
|
||||
caveat:
|
||||
rememberedPresentation?.display?.caveat || caveats.join('; '),
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
coverage: {
|
||||
layersQueried,
|
||||
records: totals,
|
||||
scope: scopeNote,
|
||||
...(scopeSource ? { scopeSource } : {}),
|
||||
...(rememberedScope?.note ? { note: rememberedScope.note } : {}),
|
||||
...(rememberedCoverageNote ? { note: rememberedCoverageNote } : {}),
|
||||
...(queriedSnapshots.length
|
||||
? { feedProvenance: feedProvenanceEnvelope(queriedSnapshots) }
|
||||
: {}),
|
||||
@@ -1010,37 +1128,102 @@ export function createAnalystEngine(providers) {
|
||||
// than implying a view-centred answer.
|
||||
...(resolvedScope?.centeredOn
|
||||
? { centeredOn: resolvedScope.centeredOn }
|
||||
: rememberedPresentation?.centeredOn
|
||||
? { centeredOn: rememberedPresentation.centeredOn }
|
||||
: {}),
|
||||
...(rememberedPresentation?.window
|
||||
? { window: structuredClone(rememberedPresentation.window) }
|
||||
: {}),
|
||||
...(resolvedScope?.areaId
|
||||
? { areaId: resolvedScope.areaId }
|
||||
: rememberedPresentation?.areaId
|
||||
? { areaId: rememberedPresentation.areaId }
|
||||
: {}),
|
||||
};
|
||||
const memoryOverride =
|
||||
typeof beforeCommit === 'function'
|
||||
? (await beforeCommit(result)) || null
|
||||
: null;
|
||||
if (!isCurrent()) return cancelled();
|
||||
const committedCoverage = memoryOverride?.coverage || result.coverage;
|
||||
lastResult = {
|
||||
matched: memoryOverride?.matched || selection.matched,
|
||||
distanceOf: memoryOverride?.distanceOf || rememberedDistanceOf,
|
||||
layerKeys: [...(memoryOverride?.layerKeys || layers)],
|
||||
coverage: committedCoverage,
|
||||
coverage: memoryOverride?.coverage || result.coverage,
|
||||
unanswered: [
|
||||
...(memoryOverride?.unanswered === undefined
|
||||
? unanswered
|
||||
: memoryOverride.unanswered),
|
||||
],
|
||||
scopePresentation: {
|
||||
label: memoryOverride?.scopeLabel || result.scopeLabel,
|
||||
detail: memoryOverride?.scopeDetail || result.display.scope,
|
||||
coverage: committedCoverage.scope,
|
||||
source: committedCoverage.scopeSource || null,
|
||||
note: committedCoverage.note || null,
|
||||
},
|
||||
presentation: structuredClone(
|
||||
memoryOverride?.presentation || {
|
||||
scopeLabel: result.scopeLabel,
|
||||
display: result.display,
|
||||
coverageScope: result.coverage?.scope,
|
||||
...(result.coverage?.scopeSource
|
||||
? { coverageScopeSource: result.coverage.scopeSource }
|
||||
: {}),
|
||||
...(result.coverage?.note
|
||||
? { coverageNote: result.coverage.note }
|
||||
: {}),
|
||||
...(result.centeredOn ? { centeredOn: result.centeredOn } : {}),
|
||||
...(result.window ? { window: result.window } : {}),
|
||||
...(result.areaId ? { areaId: result.areaId } : {}),
|
||||
},
|
||||
),
|
||||
};
|
||||
return result;
|
||||
}
|
||||
|
||||
return {
|
||||
query,
|
||||
/**
|
||||
* Make another tool's result set "the last answer" (osm_query's places),
|
||||
* so a follow-up filters exactly what the user just heard about.
|
||||
* @param {string} layerKey Queryable layer the rows belong to.
|
||||
* @param {Array<object>} rows Records in that layer's analyst shape.
|
||||
* @param {{scope?: string, presentation?: object|null, truncated?: boolean}} [options]
|
||||
* `presentation` is how the set was scoped ("inside Kathmandu"), so a
|
||||
* follow-up names the same scope instead of "anywhere". `truncated`
|
||||
* says the set is only the first part of a larger one, so follow-ups
|
||||
* stay incomplete (a count is a floor) rather than claiming the whole.
|
||||
*/
|
||||
remember(
|
||||
layerKey,
|
||||
rows,
|
||||
{ scope = 'handoff', presentation = null, truncated = false } = {},
|
||||
) {
|
||||
if (!ANALYST_LAYERS[layerKey] || !Array.isArray(rows)) return false;
|
||||
const capped = truncated === true;
|
||||
// A capped set's true size is unknown.
|
||||
const total = capped ? null : rows.length;
|
||||
lastResult = {
|
||||
...(presentation
|
||||
? { presentation: structuredClone(presentation) }
|
||||
: {}),
|
||||
matched: [{ key: layerKey, rows: rows.slice() }],
|
||||
layerKeys: [layerKey],
|
||||
coverage: {
|
||||
layersQueried: [
|
||||
{
|
||||
layerKey,
|
||||
status: rows.length ? 'ok' : 'empty',
|
||||
returned: rows.length,
|
||||
total,
|
||||
truncated: capped,
|
||||
},
|
||||
],
|
||||
records: {
|
||||
returned: rows.length,
|
||||
total,
|
||||
truncated: capped,
|
||||
},
|
||||
scope,
|
||||
followUp: false,
|
||||
},
|
||||
};
|
||||
return true;
|
||||
},
|
||||
reset() {
|
||||
lastResult = null;
|
||||
},
|
||||
|
||||
@@ -275,14 +275,18 @@ for (const [label, committedScope, scopeSource] of [
|
||||
const { scopeSource: _originalSource, ...coverage } = result.coverage;
|
||||
return {
|
||||
matched: [{ key: 'flights', rows: [FLIGHTS[1]] }],
|
||||
scopeLabel: 'the presented cohort',
|
||||
scopeDetail: 'the presented cohort window',
|
||||
coverage: {
|
||||
...coverage,
|
||||
scope: committedScope,
|
||||
...(scopeSource ? { scopeSource } : {}),
|
||||
feedProvenance: { layers: [committedSnapshot] },
|
||||
},
|
||||
presentation: {
|
||||
scopeLabel: 'the presented cohort',
|
||||
display: { scope: 'the presented cohort window' },
|
||||
coverageScope: committedScope,
|
||||
...(scopeSource ? { coverageScopeSource: scopeSource } : {}),
|
||||
},
|
||||
};
|
||||
},
|
||||
},
|
||||
@@ -436,6 +440,87 @@ test('analyst: failed pre-commit work cannot replace follow-up memory', async ()
|
||||
assert.deepEqual(followUp.items.map((item) => item.id), ['SWA1']);
|
||||
});
|
||||
|
||||
test('analyst: follow-ups preserve partial and unanswered coverage', async () => {
|
||||
const eng = createAnalystEngine({
|
||||
getRecords: (key) => (key === 'flights' ? FLIGHTS : []),
|
||||
getLayerSnapshot: (key) => ({
|
||||
enabled: key === 'flights',
|
||||
feedState: key === 'flights' ? 'nominal' : 'off',
|
||||
}),
|
||||
getViewContext: () => ({ lat: 30.27, lon: -97.74, viewRadiusKm: 150 }),
|
||||
});
|
||||
const first = await eng.query({
|
||||
layers: ['flights', 'military'],
|
||||
scope: { kind: 'anywhere' },
|
||||
});
|
||||
assert.equal(first.partial, true);
|
||||
assert.deepEqual(first.unanswered, ['military']);
|
||||
|
||||
const followUp = await eng.query({ followUp: true, limit: 1 });
|
||||
assert.equal(followUp.partial, true);
|
||||
assert.deepEqual(followUp.unanswered, ['military']);
|
||||
assert.deepEqual(
|
||||
followUp.coverage.layersQueried.map(({ layerKey, status }) => [
|
||||
layerKey,
|
||||
status,
|
||||
]),
|
||||
first.coverage.layersQueried.map(({ layerKey, status }) => [
|
||||
layerKey,
|
||||
status,
|
||||
]),
|
||||
);
|
||||
});
|
||||
|
||||
test('analyst: cancelled pre-commit work cannot replace follow-up memory', async () => {
|
||||
const eng = makeEngine();
|
||||
await eng.query({
|
||||
layers: ['flights'],
|
||||
scope: { kind: 'anywhere' },
|
||||
filters: [{ field: 'id', op: 'eq', value: 'SWA1' }],
|
||||
});
|
||||
let current = true;
|
||||
const stale = await eng.query(
|
||||
{ layers: ['local-firms'], scope: { kind: 'anywhere' } },
|
||||
{
|
||||
isCurrent: () => current,
|
||||
beforeCommit: async () => {
|
||||
current = false;
|
||||
},
|
||||
},
|
||||
);
|
||||
assert.equal(stale.code, 'CANCELLED');
|
||||
const followUp = await eng.query({ followUp: true });
|
||||
assert.deepEqual(
|
||||
followUp.items.map((item) => item.id),
|
||||
['SWA1'],
|
||||
);
|
||||
});
|
||||
|
||||
test('analyst: failed pre-commit work cannot replace follow-up memory', async () => {
|
||||
const eng = makeEngine();
|
||||
await eng.query({
|
||||
layers: ['flights'],
|
||||
scope: { kind: 'anywhere' },
|
||||
filters: [{ field: 'id', op: 'eq', value: 'SWA1' }],
|
||||
});
|
||||
await assert.rejects(
|
||||
eng.query(
|
||||
{ layers: ['local-firms'], scope: { kind: 'anywhere' } },
|
||||
{
|
||||
beforeCommit: async () => {
|
||||
throw new Error('projection failed');
|
||||
},
|
||||
},
|
||||
),
|
||||
/projection failed/,
|
||||
);
|
||||
const followUp = await eng.query({ followUp: true });
|
||||
assert.deepEqual(
|
||||
followUp.items.map((item) => item.id),
|
||||
['SWA1'],
|
||||
);
|
||||
});
|
||||
|
||||
test('analyst: unresolved region is an honest failure, not empty success', async () => {
|
||||
const r = await makeEngine().query({ layers: ['flights'], scope: { kind: 'region', name: 'Atlantis' } });
|
||||
assert.equal(r.ok, false);
|
||||
@@ -460,7 +545,7 @@ test('analyst: region lookup receives and obeys the owning action signal', async
|
||||
let receivedSignal = null;
|
||||
const eng = createAnalystEngine({
|
||||
getRecords: () => FLIGHTS,
|
||||
resolveRegionRing: async (_name, signal) => {
|
||||
resolveRegionRing: async (_name, { signal }) => {
|
||||
receivedSignal = signal;
|
||||
await new Promise((resolve) =>
|
||||
signal.addEventListener('abort', resolve, { once: true }),
|
||||
@@ -514,7 +599,7 @@ for (const [label, reason, trackAuthority] of [
|
||||
};
|
||||
const engine = createAnalystEngine({
|
||||
getRecords: () => FLIGHTS,
|
||||
resolveRegionRing: (name, signal) => resolveRegionRingForQuery(
|
||||
resolveRegionRing: (name, { signal } = {}) => resolveRegionRingForQuery(
|
||||
name, signal, placeSearch, { budgetMs: Infinity },
|
||||
),
|
||||
});
|
||||
@@ -720,7 +805,9 @@ test('unknown fields, operators, scopes and wrong-typed values are refused with
|
||||
assert.equal(num.code, 'BAD_VALUE');
|
||||
const scope = await engine.query({ layers: ['flights'], scope: { kind: 'polygon' } });
|
||||
assert.equal(scope.code, 'UNKNOWN_SCOPE');
|
||||
assert.deepEqual(scope.allowed, ['view', 'region', 'radius', 'anywhere']);
|
||||
assert.deepEqual(scope.allowed, ['view', 'region', 'radius', 'anywhere', 'area', 'drawn', 'annotation']);
|
||||
const noId = await engine.query({ layers: ['flights'], scope: { kind: 'area' } });
|
||||
assert.equal(noId.code, 'BAD_SCOPE', 'an area scope needs its areaId');
|
||||
const sort = await engine.query({ layers: ['flights'], sortBy: 'loudness' });
|
||||
assert.equal(sort.code, 'UNKNOWN_FIELD');
|
||||
assert.equal(engine.hasMemory(), false, 'refusals never become follow-up memory');
|
||||
@@ -963,3 +1050,193 @@ test('analyst: a follow-up naming other layers than the last answer is refused',
|
||||
assert.equal(r.code, 'FOLLOW_UP_MISMATCH');
|
||||
assert.equal(engine.hasMemory(), true, 'the earlier answer is still the last answer');
|
||||
});
|
||||
|
||||
// ── Area handles: region multipolygons and the area / drawn / annotation scopes ──
|
||||
|
||||
const box = (w, s, e, n) => [[w, s], [e, s], [e, n], [w, n], [w, s]];
|
||||
|
||||
function makeAreaEngine(overrides = {}) {
|
||||
return createAnalystEngine({
|
||||
getRecords: (key) => ({ flights: FLIGHTS, 'local-firms': FIRES }[key] || []),
|
||||
resolveRegionRing: async () => null,
|
||||
getViewContext: () => ({ lat: 30.27, lon: -97.74, viewRadiusKm: 150 }),
|
||||
...overrides,
|
||||
});
|
||||
}
|
||||
|
||||
test('analyst: a region counts every part of a multipolygon and skips its holes', async () => {
|
||||
// Main part around Austin with a hole over the airport ground traffic, and a
|
||||
// separate island over Oregon: the old largest-ring shortcut dropped N123.
|
||||
const engine = makeAreaEngine({
|
||||
resolveRegionRing: async () => ({
|
||||
name: 'Archipelago',
|
||||
geometry: [
|
||||
[box(-100, 28, -94, 33), box(-97.7, 30.1, -97.6, 30.25)],
|
||||
[box(-123, 44, -121, 46)],
|
||||
],
|
||||
source: 'osm',
|
||||
}),
|
||||
});
|
||||
const r = await engine.query({ layers: ['flights'], scope: { kind: 'region', name: 'Archipelago' }, limit: 10 });
|
||||
assert.equal(r.ok, true);
|
||||
assert.deepEqual(r.items.map((i) => i.id).sort(), ['N123', 'RCH01']);
|
||||
assert.equal(r.count, 2, 'SWA1 and GND1 sit in the hole');
|
||||
assert.match(r.display.scope, /over Archipelago · osm/);
|
||||
});
|
||||
|
||||
test('analyst: an ambiguous region asks instead of counting', async () => {
|
||||
const engine = makeAreaEngine({
|
||||
resolveRegionRing: async () => ({
|
||||
ok: false,
|
||||
needsClarification: true,
|
||||
candidates: [{ candidateId: 'osm:r1', name: 'Georgia', level: 'country' }],
|
||||
error: '"Georgia" matches 2 places — ask which one.',
|
||||
}),
|
||||
});
|
||||
const r = await engine.query({ layers: ['flights'], scope: { kind: 'region', name: 'Georgia' } });
|
||||
assert.equal(r.ok, false);
|
||||
assert.equal(r.code, 'NEEDS_CLARIFICATION');
|
||||
assert.equal(r.candidates.length, 1);
|
||||
assert.match(r.then, /resolve_area.*candidateId.*analyst_query.*kind.*area/, 'the model gets a route back');
|
||||
assert.equal(engine.hasMemory(), false);
|
||||
});
|
||||
|
||||
test('analyst: region lookup receives the caller lifetime signal', async () => {
|
||||
const controller = new AbortController();
|
||||
let received;
|
||||
const engine = makeAreaEngine({
|
||||
resolveRegionRing: async (_name, options) => {
|
||||
received = options?.signal;
|
||||
return { error: 'region-timeout' };
|
||||
},
|
||||
});
|
||||
const result = await engine.query(
|
||||
{
|
||||
layers: ['flights'],
|
||||
scope: { kind: 'region', name: 'Signal Region' },
|
||||
},
|
||||
{ signal: controller.signal },
|
||||
);
|
||||
assert.equal(received, controller.signal);
|
||||
assert.equal(result.code, 'region-timeout');
|
||||
});
|
||||
|
||||
test('analyst: an area scope counts inside the stored handle and names it', async () => {
|
||||
const { prepareArea } = await import('./areaGeometry.js');
|
||||
const prepared = prepareArea([[box(-99, 30, -97.5, 31)]]);
|
||||
const seen = [];
|
||||
const engine = makeAreaEngine({
|
||||
resolveAreaScope: async (scope) => {
|
||||
seen.push(scope);
|
||||
if (scope.kind === 'area' && scope.areaId === 'osm:r42')
|
||||
return { ok: true, area: { areaId: 'osm:r42', name: 'Hill Country', prepared, source: 'osm' } };
|
||||
if (scope.kind === 'drawn')
|
||||
return { ok: true, area: { areaId: 'anno:anno-7', name: 'the drawn area', prepared, source: 'drawn' } };
|
||||
return { ok: false, code: 'AREA_UNKNOWN', error: 'No such area' };
|
||||
},
|
||||
});
|
||||
const fires = await engine.query({ layers: ['local-firms'], scope: { kind: 'area', areaId: 'osm:r42' } });
|
||||
assert.equal(fires.ok, true);
|
||||
assert.equal(fires.count, 2);
|
||||
assert.equal(fires.scopeLabel, 'inside Hill Country');
|
||||
assert.equal(fires.areaId, 'osm:r42');
|
||||
assert.equal(fires.coverage.scope, 'area:osm:r42');
|
||||
const followUp = await engine.query({ followUp: true, limit: 1 });
|
||||
assert.equal(followUp.scopeLabel, 'inside Hill Country');
|
||||
assert.match(followUp.display.scope, /inside Hill Country/);
|
||||
assert.equal(followUp.coverage.scope, 'area:osm:r42');
|
||||
assert.equal(followUp.areaId, 'osm:r42');
|
||||
const drawn = await engine.query({ layers: ['flights'], scope: { kind: 'drawn' } });
|
||||
assert.equal(drawn.ok, true);
|
||||
assert.equal(drawn.count, 2, 'SWA1 and GND1 sit inside the drawn box');
|
||||
const missing = await engine.query({ layers: ['flights'], scope: { kind: 'area', areaId: 'osm:r0' } });
|
||||
assert.equal(missing.ok, false);
|
||||
assert.equal(missing.code, 'AREA_UNKNOWN');
|
||||
assert.deepEqual(seen.map((s) => s.kind), ['area', 'drawn', 'area']);
|
||||
});
|
||||
|
||||
test('analyst: an area scope superseded while resolving is cancelled and leaves no memory', async () => {
|
||||
const { prepareArea } = await import('./areaGeometry.js');
|
||||
let current = true;
|
||||
const engine = makeAreaEngine({
|
||||
resolveAreaScope: async () => {
|
||||
current = false; // a newer turn arrived while the area was looked up
|
||||
return { ok: true, area: { name: 'X', prepared: prepareArea([[box(-100, 28, -94, 33)]]) } };
|
||||
},
|
||||
});
|
||||
const r = await engine.query(
|
||||
{ layers: ['flights'], scope: { kind: 'annotation' } },
|
||||
{ isCurrent: () => current },
|
||||
);
|
||||
assert.equal(r.code, 'CANCELLED');
|
||||
assert.equal(engine.hasMemory(), false);
|
||||
});
|
||||
|
||||
test('analyst: without an area provider the area scopes refuse plainly', async () => {
|
||||
const r = await makeAreaEngine().query({ layers: ['flights'], scope: { kind: 'drawn' } });
|
||||
assert.equal(r.ok, false);
|
||||
assert.equal(r.code, 'AREA_UNAVAILABLE');
|
||||
});
|
||||
|
||||
test('a follow-up on handed-off places keeps the area they were found in', async () => {
|
||||
const rows = [
|
||||
{ id: 'node/1', lat: 27.7, lon: 85.3, name: 'Bir Hospital', kind: 'hospital', emergency: 'yes' },
|
||||
{ id: 'node/2', lat: 27.71, lon: 85.31, name: 'Teaching Hospital', kind: 'hospital', emergency: 'no' },
|
||||
];
|
||||
const engine = createAnalystEngine({
|
||||
getRecords: (key) => (key === 'osm-places' ? rows : []),
|
||||
resolveRegionRing: async () => null,
|
||||
getViewContext: () => ({ lat: 27.7, lon: 85.3, viewRadiusKm: 20 }),
|
||||
});
|
||||
assert.equal(
|
||||
engine.remember('osm-places', rows, {
|
||||
presentation: { scopeLabel: 'inside Kathmandu', coverageScope: 'area:area-1', areaId: 'area-1' },
|
||||
}),
|
||||
true,
|
||||
);
|
||||
const result = await engine.query({
|
||||
layers: ['osm-places'],
|
||||
followUp: true,
|
||||
filters: [{ field: 'emergency', op: 'eq', value: 'yes' }],
|
||||
});
|
||||
assert.equal(result.count, 1);
|
||||
assert.equal(result.scopeLabel, 'inside Kathmandu');
|
||||
assert.equal(result.coverage.scope, 'area:area-1');
|
||||
});
|
||||
|
||||
test('a follow-up on a capped handed-off set is not complete', async () => {
|
||||
const rows = [
|
||||
{ id: 'node/1', lat: 27.7, lon: 85.3, name: 'Bir Hospital', kind: 'hospital', emergency: 'yes' },
|
||||
];
|
||||
const engine = createAnalystEngine({
|
||||
getRecords: (key) => (key === 'osm-places' ? rows : []),
|
||||
resolveRegionRing: async () => null,
|
||||
getViewContext: () => ({ lat: 27.7, lon: 85.3, viewRadiusKm: 20 }),
|
||||
});
|
||||
engine.remember('osm-places', rows, { truncated: true });
|
||||
const result = await engine.query({ layers: ['osm-places'], followUp: true });
|
||||
assert.equal(result.count, 1);
|
||||
assert.equal(result.complete, false);
|
||||
assert.equal(result.coverage.records.truncated, true);
|
||||
assert.equal(result.coverage.records.total, null, 'the true size is unknown');
|
||||
});
|
||||
|
||||
test('a slow scan yields on a time budget, not only every 20,000 rows', async () => {
|
||||
// 4,000 rows that each cost ~0.05 ms to read: ~200 ms of work in one slice
|
||||
// under a row-count budget alone.
|
||||
const slow = () => {
|
||||
const until = performance.now() + 0.05;
|
||||
while (performance.now() < until);
|
||||
return 5;
|
||||
};
|
||||
const rows = Array.from({ length: 4_000 }, (_, i) => ({ id: `S${i}`, lat: 0, lon: 0, get frp() { return slow(); } }));
|
||||
const engine = createAnalystEngine({ getRecords: () => rows, getViewContext: () => ({ lat: 0, lon: 0, viewRadiusKm: 25 }) });
|
||||
// Count the scan's yields (other timers run only when it yields), not wall
|
||||
// gaps, so a loaded machine cannot fail it.
|
||||
let ticks = 0;
|
||||
const timer = setInterval(() => ticks++, 0);
|
||||
const result = await engine.query({ layers: ['local-firms'], scope: { kind: 'anywhere' }, filters: [{ field: 'frp', op: 'gt', value: 1 }] });
|
||||
clearInterval(timer);
|
||||
assert.equal(result.count, 4_000);
|
||||
assert.ok(ticks >= 5, `the scan yielded ${ticks} times in ~200 ms of work`);
|
||||
});
|
||||
@@ -0,0 +1,397 @@
|
||||
/**
|
||||
* Area geometry for voice area handles: normalization, containment, size and
|
||||
* display simplification over full MultiPolygons (islands and holes kept).
|
||||
*
|
||||
* Coordinates follow GeoJSON: a MultiPolygon is `Array<Polygon>`, a Polygon is
|
||||
* `Array<Ring>` with the outer ring first and holes after it, a Ring is
|
||||
* `Array<[lon, lat]>`.
|
||||
*
|
||||
* Counting uses the geometry exactly as resolved. Display simplification
|
||||
* (`displayParts`) makes a separate copy for drawing and never feeds back into
|
||||
* containment.
|
||||
*
|
||||
* Antimeridian: a ring whose consecutive longitudes jump by more than 180° is
|
||||
* unwrapped into one continuous span (e.g. 170..190) when the jumps cancel
|
||||
* out. Containment then tests the point at lon, lon + 360 and lon − 360. A ring
|
||||
* that circles a pole (jumps that do not cancel) is used as given.
|
||||
*
|
||||
* Pure: no Cesium, DOM or network.
|
||||
* @module data/areaGeometry
|
||||
*/
|
||||
|
||||
const EARTH_RADIUS_KM = 6371;
|
||||
const toRad = (degrees) => (degrees * Math.PI) / 180;
|
||||
|
||||
const validPair = (p) =>
|
||||
Array.isArray(p) &&
|
||||
Number.isFinite(p[0]) &&
|
||||
Number.isFinite(p[1]) &&
|
||||
Math.abs(p[0]) <= 540 &&
|
||||
Math.abs(p[1]) <= 90;
|
||||
|
||||
const samePoint = (a, b, eps = 1e-9) =>
|
||||
Math.abs(a[0] - b[0]) <= eps && Math.abs(a[1] - b[1]) <= eps;
|
||||
|
||||
/** A ring as closed [lon, lat] pairs, or null with fewer than 3 distinct points. */
|
||||
function cleanRing(ring) {
|
||||
if (!Array.isArray(ring)) return null;
|
||||
const out = [];
|
||||
for (const p of ring) {
|
||||
if (!validPair(p)) continue;
|
||||
const pair = [Number(p[0]), Number(p[1])];
|
||||
if (out.length && samePoint(out[out.length - 1], pair)) continue;
|
||||
out.push(pair);
|
||||
}
|
||||
if (out.length && samePoint(out[0], out[out.length - 1])) out.pop();
|
||||
if (out.length < 3) return null;
|
||||
out.push([out[0][0], out[0][1]]);
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* GeoJSON Polygon/MultiPolygon geometry (or bare coordinates) → MultiPolygon
|
||||
* coordinates with closed rings; null when nothing usable remains. Degenerate
|
||||
* holes are dropped; a polygon whose outer ring is degenerate is dropped whole.
|
||||
* @param {object|Array} geometry
|
||||
* @returns {Array|null}
|
||||
*/
|
||||
export function normalizeMultiPolygon(geometry) {
|
||||
let polygons;
|
||||
if (Array.isArray(geometry)) {
|
||||
// Bare coordinates: a ring, a polygon or a multipolygon, by nesting depth.
|
||||
const depth = (value) => (Array.isArray(value) ? 1 + depth(value[0]) : 0);
|
||||
const d = depth(geometry);
|
||||
polygons = d === 2 ? [[geometry]] : d === 3 ? [geometry] : geometry;
|
||||
} else if (geometry?.type === 'Polygon') polygons = [geometry.coordinates];
|
||||
else if (geometry?.type === 'MultiPolygon') polygons = geometry.coordinates;
|
||||
else return null;
|
||||
const out = [];
|
||||
for (const polygon of Array.isArray(polygons) ? polygons : []) {
|
||||
if (!Array.isArray(polygon)) continue;
|
||||
const outer = cleanRing(polygon[0]);
|
||||
if (!outer) continue;
|
||||
const holes = polygon.slice(1).map(cleanRing).filter(Boolean);
|
||||
out.push([outer, ...holes]);
|
||||
}
|
||||
return out.length ? out : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Longitudes made continuous across the antimeridian. Returns the ring as
|
||||
* given when it has no jump, or when its jumps do not cancel (a ring that
|
||||
* circles a pole).
|
||||
*/
|
||||
export function unwrapRing(ring) {
|
||||
let shift = 0;
|
||||
let jumped = false;
|
||||
const out = [[ring[0][0], ring[0][1]]];
|
||||
for (let i = 1; i < ring.length; i += 1) {
|
||||
const delta = ring[i][0] - ring[i - 1][0];
|
||||
if (delta > 180) {
|
||||
shift -= 360;
|
||||
jumped = true;
|
||||
} else if (delta < -180) {
|
||||
shift += 360;
|
||||
jumped = true;
|
||||
}
|
||||
out.push([ring[i][0] + shift, ring[i][1]]);
|
||||
}
|
||||
if (!jumped) return ring;
|
||||
return shift === 0 ? out : ring;
|
||||
}
|
||||
|
||||
function ringBbox(ring) {
|
||||
let w = Infinity;
|
||||
let s = Infinity;
|
||||
let e = -Infinity;
|
||||
let n = -Infinity;
|
||||
for (const [lon, lat] of ring) {
|
||||
if (lon < w) w = lon;
|
||||
if (lon > e) e = lon;
|
||||
if (lat < s) s = lat;
|
||||
if (lat > n) n = lat;
|
||||
}
|
||||
return [w, s, e, n];
|
||||
}
|
||||
|
||||
/** Even-odd ray cast. */
|
||||
function pointInRingXY(ring, lon, lat) {
|
||||
let inside = false;
|
||||
for (let i = 0, j = ring.length - 1; i < ring.length; j = i, i += 1) {
|
||||
const xi = ring[i][0];
|
||||
const yi = ring[i][1];
|
||||
const xj = ring[j][0];
|
||||
const yj = ring[j][1];
|
||||
if (
|
||||
yi > lat !== yj > lat &&
|
||||
lon < ((xj - xi) * (lat - yi)) / (yj - yi) + xi
|
||||
)
|
||||
inside = !inside;
|
||||
}
|
||||
return inside;
|
||||
}
|
||||
|
||||
const wrap180 = (lon) => ((((lon + 180) % 360) + 360) % 360) - 180;
|
||||
const wrap360 = (lon) => {
|
||||
const wrapped = lon % 360;
|
||||
return wrapped < 0 ? wrapped + 360 : wrapped;
|
||||
};
|
||||
|
||||
/** The shortest circular longitude interval containing every outer-ring vertex. */
|
||||
function longitudeEnvelope(parts) {
|
||||
const values = parts
|
||||
.flatMap(({ outer }) => outer.map(([lon]) => wrap360(lon)))
|
||||
.sort((a, b) => a - b);
|
||||
if (values.length === 0) return null;
|
||||
let gapIndex = values.length - 1;
|
||||
let largestGap = values[0] + 360 - values.at(-1);
|
||||
for (let i = 0; i < values.length - 1; i += 1) {
|
||||
const gap = values[i + 1] - values[i];
|
||||
if (gap > largestGap) {
|
||||
largestGap = gap;
|
||||
gapIndex = i;
|
||||
}
|
||||
}
|
||||
const start = values[(gapIndex + 1) % values.length];
|
||||
let end = values[gapIndex];
|
||||
if (end < start) end += 360;
|
||||
const span = end - start;
|
||||
if (span >= 360 - 1e-9) return { west: -180, east: 180, crosses: false };
|
||||
const west = start > 180 ? start - 360 : start;
|
||||
const endOnCircle = end >= 360 ? end - 360 : end;
|
||||
const east = endOnCircle > 180 ? endOnCircle - 360 : endOnCircle;
|
||||
return { west, east, crosses: west > east };
|
||||
}
|
||||
|
||||
/**
|
||||
* Index a MultiPolygon for repeated containment tests: unwrapped rings with
|
||||
* per-part bounding boxes, plus the overall bbox as [west, south, east, north]
|
||||
* in −180..180 (west > east when it crosses the antimeridian).
|
||||
* @param {Array} coordinates MultiPolygon coordinates.
|
||||
* @returns {{parts: Array, bbox: number[], vertexCount: number, crossesAntimeridian: boolean}|null}
|
||||
*/
|
||||
export function prepareArea(coordinates) {
|
||||
const multi = normalizeMultiPolygon(coordinates);
|
||||
if (!multi) return null;
|
||||
let vertexCount = 0;
|
||||
let crosses = false;
|
||||
const parts = multi.map((polygon) => {
|
||||
const outer = unwrapRing(polygon[0]);
|
||||
if (outer !== polygon[0]) crosses = true;
|
||||
const holes = polygon.slice(1).map((ring) => {
|
||||
let hole = unwrapRing(ring);
|
||||
// Keep a hole in the same longitude frame as its outer ring.
|
||||
const hb = ringBbox(hole);
|
||||
const ob = ringBbox(outer);
|
||||
const mid = (hb[0] + hb[2]) / 2;
|
||||
if (mid < ob[0]) hole = hole.map(([x, y]) => [x + 360, y]);
|
||||
else if (mid > ob[2]) hole = hole.map(([x, y]) => [x - 360, y]);
|
||||
return hole;
|
||||
});
|
||||
for (const ring of polygon) vertexCount += ring.length;
|
||||
return { outer, holes, bbox: ringBbox(outer) };
|
||||
});
|
||||
let south = Infinity;
|
||||
let north = -Infinity;
|
||||
for (const { bbox } of parts) {
|
||||
south = Math.min(south, bbox[1]);
|
||||
north = Math.max(north, bbox[3]);
|
||||
}
|
||||
const envelope = longitudeEnvelope(parts);
|
||||
const bbox = [envelope.west, south, envelope.east, north];
|
||||
crosses ||= envelope.crosses;
|
||||
return { parts, bbox, vertexCount, crossesAntimeridian: crosses };
|
||||
}
|
||||
|
||||
function inPart(part, lon, lat) {
|
||||
const [w, s, e, n] = part.bbox;
|
||||
if (lat < s || lat > n || lon < w || lon > e) return false;
|
||||
if (!pointInRingXY(part.outer, lon, lat)) return false;
|
||||
for (const hole of part.holes)
|
||||
if (pointInRingXY(hole, lon, lat)) return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a point lies inside the area: inside some part's outer ring and in
|
||||
* none of that part's holes. Points exactly on an edge follow the ray-cast
|
||||
* convention and may land either side.
|
||||
* @param {object} prepared From prepareArea.
|
||||
* @param {number} lat
|
||||
* @param {number} lon
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function pointInPreparedArea(prepared, lat, lon) {
|
||||
if (!prepared || !Number.isFinite(lat) || !Number.isFinite(lon)) return false;
|
||||
for (const part of prepared.parts) {
|
||||
if (inPart(part, lon, lat)) return true;
|
||||
if (inPart(part, lon + 360, lat)) return true;
|
||||
if (inPart(part, lon - 360, lat)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Spherical-excess ring area in km² (unsigned). */
|
||||
export function ringAreaKm2(ring) {
|
||||
const n = ring.length;
|
||||
if (n < 3) return 0;
|
||||
let sum = 0;
|
||||
for (let i = 0; i < n - 1; i += 1) {
|
||||
const [lon1, lat1] = ring[i];
|
||||
const [lon2, lat2] = ring[i + 1];
|
||||
sum +=
|
||||
toRad(lon2 - lon1) * (2 + Math.sin(toRad(lat1)) + Math.sin(toRad(lat2)));
|
||||
}
|
||||
return Math.abs((sum * EARTH_RADIUS_KM * EARTH_RADIUS_KM) / 2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Area of a MultiPolygon in km², holes subtracted.
|
||||
* @param {Array} coordinates
|
||||
* @returns {number}
|
||||
*/
|
||||
export function multiPolygonAreaKm2(coordinates) {
|
||||
const multi = normalizeMultiPolygon(coordinates);
|
||||
if (!multi) return 0;
|
||||
let total = 0;
|
||||
for (const polygon of multi) {
|
||||
total += ringAreaKm2(unwrapRing(polygon[0]));
|
||||
for (const hole of polygon.slice(1)) total -= ringAreaKm2(unwrapRing(hole));
|
||||
}
|
||||
return Math.max(0, total);
|
||||
}
|
||||
|
||||
/** Counts of parts and holes. */
|
||||
export function multiPolygonCounts(coordinates) {
|
||||
const multi = normalizeMultiPolygon(coordinates) || [];
|
||||
return {
|
||||
parts: multi.length,
|
||||
holes: multi.reduce((sum, polygon) => sum + polygon.length - 1, 0),
|
||||
};
|
||||
}
|
||||
|
||||
/** Mean of the largest part's outer ring vertices, wrapped to −180..180. */
|
||||
export function areaAnchor(coordinates) {
|
||||
const multi = normalizeMultiPolygon(coordinates);
|
||||
if (!multi) return null;
|
||||
let best = null;
|
||||
let bestArea = -1;
|
||||
for (const polygon of multi) {
|
||||
const ring = unwrapRing(polygon[0]);
|
||||
const area = ringAreaKm2(ring);
|
||||
if (area > bestArea) {
|
||||
bestArea = area;
|
||||
best = ring;
|
||||
}
|
||||
}
|
||||
let lon = 0;
|
||||
let lat = 0;
|
||||
const pts = best.slice(0, -1);
|
||||
for (const [x, y] of pts) {
|
||||
lon += x;
|
||||
lat += y;
|
||||
}
|
||||
return { lon: wrap180(lon / pts.length), lat: lat / pts.length };
|
||||
}
|
||||
|
||||
// ── Display copies ────────────────────────────────────────────
|
||||
|
||||
function dpRing(ring, tol) {
|
||||
const n = ring.length;
|
||||
if (n <= 5) return ring;
|
||||
const keep = new Uint8Array(n);
|
||||
keep[0] = 1;
|
||||
keep[n - 1] = 1;
|
||||
const stack = [[0, n - 1]];
|
||||
while (stack.length) {
|
||||
const [a, b] = stack.pop();
|
||||
if (b - a < 2) continue;
|
||||
const [ax, ay] = ring[a];
|
||||
const vx = ring[b][0] - ax;
|
||||
const vy = ring[b][1] - ay;
|
||||
const c2 = vx * vx + vy * vy;
|
||||
let worst = -1;
|
||||
let worstD = tol;
|
||||
for (let i = a + 1; i < b; i += 1) {
|
||||
const wx = ring[i][0] - ax;
|
||||
const wy = ring[i][1] - ay;
|
||||
const t =
|
||||
c2 === 0 ? 0 : Math.max(0, Math.min(1, (vx * wx + vy * wy) / c2));
|
||||
const d = Math.hypot(wx - t * vx, wy - t * vy);
|
||||
if (d > worstD) {
|
||||
worstD = d;
|
||||
worst = i;
|
||||
}
|
||||
}
|
||||
if (worst >= 0) {
|
||||
keep[worst] = 1;
|
||||
stack.push([a, worst], [worst, b]);
|
||||
}
|
||||
}
|
||||
const out = [];
|
||||
for (let i = 0; i < n; i += 1) if (keep[i]) out.push(ring[i]);
|
||||
return out.length >= 4 ? out : ring;
|
||||
}
|
||||
|
||||
/**
|
||||
* A simplified copy of the area for drawing only: the largest `maxParts`
|
||||
* parts, each ring Douglas-Peucker simplified until the whole copy fits in
|
||||
* `maxVertices`. Rings keep their antimeridian-unwrapped longitudes so a
|
||||
* crossing part draws as one shape.
|
||||
* @param {Array} coordinates MultiPolygon coordinates.
|
||||
* @param {{maxVertices?: number, maxParts?: number}} [options]
|
||||
* @returns {{parts: Array<{outer: Array, holes: Array}>, drawnParts: number, totalParts: number}}
|
||||
*/
|
||||
export function displayParts(
|
||||
coordinates,
|
||||
{ maxVertices = 6000, maxParts = 40 } = {},
|
||||
) {
|
||||
const multi = normalizeMultiPolygon(coordinates) || [];
|
||||
const ranked = multi
|
||||
.map((polygon) => ({
|
||||
rings: polygon.map((ring) => unwrapRing(ring)),
|
||||
area: ringAreaKm2(unwrapRing(polygon[0])),
|
||||
}))
|
||||
.sort((a, b) => b.area - a.area)
|
||||
.slice(0, maxParts);
|
||||
const bbox = ranked.length ? ringBbox(ranked[0].rings[0]) : [0, 0, 0, 0];
|
||||
let tol = Math.max(
|
||||
1e-6,
|
||||
Math.max(bbox[2] - bbox[0], bbox[3] - bbox[1]) / 1500,
|
||||
);
|
||||
let parts = [];
|
||||
for (let attempt = 0; attempt < 12; attempt += 1) {
|
||||
parts = ranked.map(({ rings }) => ({
|
||||
outer: dpRing(rings[0], tol),
|
||||
holes: rings.slice(1).map((ring) => dpRing(ring, tol)),
|
||||
}));
|
||||
const total = parts.reduce(
|
||||
(sum, p) =>
|
||||
sum + p.outer.length + p.holes.reduce((h, r) => h + r.length, 0),
|
||||
0,
|
||||
);
|
||||
if (total <= maxVertices) break;
|
||||
tol *= 2;
|
||||
}
|
||||
return { parts, drawnParts: parts.length, totalParts: multi.length };
|
||||
}
|
||||
|
||||
/**
|
||||
* A circle as a closed ring (planar metres around the centre — accurate for
|
||||
* the few-kilometre buffers it is used for).
|
||||
* @returns {Array<[number, number]>}
|
||||
*/
|
||||
export function circleRing(lat, lon, radiusM, segments = 48) {
|
||||
const mPerDegLat = 111_320;
|
||||
const mPerDegLon = mPerDegLat * Math.max(0.01, Math.cos(toRad(lat)));
|
||||
const ring = [];
|
||||
for (let i = 0; i < segments; i += 1) {
|
||||
const a = (i / segments) * Math.PI * 2;
|
||||
ring.push([
|
||||
lon + (Math.cos(a) * radiusM) / mPerDegLon,
|
||||
lat + (Math.sin(a) * radiusM) / mPerDegLat,
|
||||
]);
|
||||
}
|
||||
ring.push([ring[0][0], ring[0][1]]);
|
||||
return ring;
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
// Area geometry: containment over full MultiPolygons (islands, holes, the
|
||||
// antimeridian), OSM relation assembly and display copies that never touch the
|
||||
// counting geometry.
|
||||
//
|
||||
// Run with: npm test
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {
|
||||
circleRing,
|
||||
displayParts,
|
||||
multiPolygonAreaKm2,
|
||||
multiPolygonCounts,
|
||||
normalizeMultiPolygon,
|
||||
pointInPreparedArea,
|
||||
prepareArea,
|
||||
} from './areaGeometry.js';
|
||||
|
||||
const square = (w, s, e, n) => [
|
||||
[w, s],
|
||||
[e, s],
|
||||
[e, n],
|
||||
[w, n],
|
||||
[w, s],
|
||||
];
|
||||
|
||||
test('a point on an island counts, not only on the largest part', () => {
|
||||
// Mainland 0..10, island 20..22: the old largest-ring shortcut dropped the island.
|
||||
const area = prepareArea([[square(0, 0, 10, 10)], [square(20, 0, 22, 2)]]);
|
||||
assert.equal(pointInPreparedArea(area, 5, 5), true);
|
||||
assert.equal(pointInPreparedArea(area, 1, 21), true);
|
||||
assert.equal(pointInPreparedArea(area, 1, 15), false);
|
||||
});
|
||||
|
||||
test('a point inside a hole is outside the area', () => {
|
||||
const area = prepareArea([[square(0, 0, 10, 10), square(4, 4, 6, 6)]]);
|
||||
assert.equal(pointInPreparedArea(area, 5, 5), false);
|
||||
assert.equal(pointInPreparedArea(area, 2, 2), true);
|
||||
// An island inside the hole (an enclave within an enclave) counts again.
|
||||
const nested = prepareArea([
|
||||
[square(0, 0, 10, 10), square(3, 3, 7, 7)],
|
||||
[square(4, 4, 6, 6)],
|
||||
]);
|
||||
assert.equal(pointInPreparedArea(nested, 5, 5), true);
|
||||
assert.equal(pointInPreparedArea(nested, 3.5, 3.5), false);
|
||||
});
|
||||
|
||||
test('a ring crossing the antimeridian contains points on both sides', () => {
|
||||
// 175E → 175W as one continuous ring (a drawn box over Fiji).
|
||||
const ring = [
|
||||
[175, -20],
|
||||
[-175, -20],
|
||||
[-175, -15],
|
||||
[175, -15],
|
||||
[175, -20],
|
||||
];
|
||||
const area = prepareArea([[ring]]);
|
||||
assert.equal(area.crossesAntimeridian, true);
|
||||
assert.equal(pointInPreparedArea(area, -17, 178), true);
|
||||
assert.equal(pointInPreparedArea(area, -17, -178), true);
|
||||
assert.equal(pointInPreparedArea(area, -17, 0), false);
|
||||
assert.equal(pointInPreparedArea(area, -17, 170), false);
|
||||
// bbox is west > east across the line.
|
||||
assert.deepEqual(area.bbox, [175, -20, -175, -15]);
|
||||
// Area of a 10°×5° box near 17°S, not the 350° long way round.
|
||||
const km2 = multiPolygonAreaKm2([[ring]]);
|
||||
assert.ok(km2 > 500_000 && km2 < 620_000, `area ${km2}`);
|
||||
});
|
||||
|
||||
test('a multipolygon split at ±180 keeps a tight bbox', () => {
|
||||
const area = prepareArea([
|
||||
[square(177, -19, 180, -16)],
|
||||
[square(-180, -19, -178, -16)],
|
||||
]);
|
||||
assert.equal(area.crossesAntimeridian, true);
|
||||
assert.deepEqual(area.bbox, [177, -19, -178, -16]);
|
||||
assert.equal(pointInPreparedArea(area, -17, -179), true);
|
||||
assert.equal(pointInPreparedArea(area, -17, 179), true);
|
||||
});
|
||||
|
||||
test('a crossing part and a separate island share one tight longitude frame', () => {
|
||||
const crossing = [
|
||||
[175, -20],
|
||||
[-175, -20],
|
||||
[-175, -15],
|
||||
[175, -15],
|
||||
[175, -20],
|
||||
];
|
||||
const area = prepareArea([[crossing], [square(-170, -19, -160, -16)]]);
|
||||
assert.equal(area.crossesAntimeridian, true);
|
||||
assert.deepEqual(area.bbox, [175, -20, -160, -15]);
|
||||
assert.equal(pointInPreparedArea(area, -17, 178), true);
|
||||
assert.equal(pointInPreparedArea(area, -17, -165), true);
|
||||
assert.equal(pointInPreparedArea(area, -17, 0), false);
|
||||
});
|
||||
|
||||
test('normalization closes rings and drops degenerate parts', () => {
|
||||
const multi = normalizeMultiPolygon({
|
||||
type: 'Polygon',
|
||||
coordinates: [
|
||||
[
|
||||
[0, 0],
|
||||
[1, 0],
|
||||
[1, 1],
|
||||
],
|
||||
[
|
||||
[0.2, 0.2],
|
||||
[0.2, 0.2],
|
||||
],
|
||||
],
|
||||
});
|
||||
assert.equal(multi.length, 1);
|
||||
assert.equal(multi[0].length, 1, 'degenerate hole dropped');
|
||||
assert.deepEqual(multi[0][0][0], multi[0][0][3]);
|
||||
assert.equal(
|
||||
normalizeMultiPolygon({ type: 'LineString', coordinates: [] }),
|
||||
null,
|
||||
);
|
||||
assert.equal(
|
||||
normalizeMultiPolygon([
|
||||
[
|
||||
[0, 0],
|
||||
[1, 1],
|
||||
],
|
||||
]),
|
||||
null,
|
||||
);
|
||||
});
|
||||
|
||||
test('area subtracts holes and counts parts', () => {
|
||||
const coords = [
|
||||
[square(0, 0, 1, 1), square(0.25, 0.25, 0.75, 0.75)],
|
||||
[square(5, 5, 6, 6)],
|
||||
];
|
||||
const whole = multiPolygonAreaKm2([[square(0, 0, 1, 1)]]);
|
||||
const km2 = multiPolygonAreaKm2(coords);
|
||||
assert.ok(km2 < whole * 2 && km2 > whole * 1.7, `${km2} vs ${whole}`);
|
||||
assert.deepEqual(multiPolygonCounts(coords), { parts: 2, holes: 1 });
|
||||
});
|
||||
|
||||
test('display copies are bounded and leave the counting geometry intact', () => {
|
||||
const dense = [];
|
||||
for (let i = 0; i < 20_000; i += 1) {
|
||||
const a = (i / 20_000) * Math.PI * 2;
|
||||
dense.push([
|
||||
Math.cos(a) * (1 + 0.01 * Math.sin(a * 200)),
|
||||
Math.sin(a) * (1 + 0.01 * Math.sin(a * 200)),
|
||||
]);
|
||||
}
|
||||
dense.push(dense[0].slice());
|
||||
const coords = [[dense]];
|
||||
const snapshot = JSON.stringify(coords);
|
||||
const shown = displayParts(coords, { maxVertices: 2000 });
|
||||
const total = shown.parts.reduce((sum, p) => sum + p.outer.length, 0);
|
||||
assert.ok(total <= 2000, `${total} vertices`);
|
||||
assert.equal(JSON.stringify(coords), snapshot, 'input untouched');
|
||||
// A point the simplified copy might shave off still counts on the original.
|
||||
const area = prepareArea(coords);
|
||||
assert.equal(pointInPreparedArea(area, 0, 0), true);
|
||||
});
|
||||
|
||||
test('display copies keep the largest parts first', () => {
|
||||
const coords = [
|
||||
[square(0, 0, 1, 1)],
|
||||
[square(10, 10, 15, 15)],
|
||||
[square(20, 20, 20.1, 20.1)],
|
||||
];
|
||||
const shown = displayParts(coords, { maxParts: 2 });
|
||||
assert.equal(shown.totalParts, 3);
|
||||
assert.equal(shown.drawnParts, 2);
|
||||
assert.equal(shown.parts[0].outer[0][0], 10);
|
||||
});
|
||||
|
||||
test('a circle ring is closed and about the requested radius', () => {
|
||||
const ring = circleRing(37.8, -122.39, 500);
|
||||
assert.deepEqual(ring[0], ring[ring.length - 1]);
|
||||
const km2 = multiPolygonAreaKm2([[ring]]);
|
||||
assert.ok(Math.abs(km2 - Math.PI * 0.25) < 0.02, `${km2}`);
|
||||
});
|
||||
@@ -0,0 +1,668 @@
|
||||
/**
|
||||
* Named place → area handle, through the outline ladder that needs no public
|
||||
* Overpass:
|
||||
*
|
||||
* 1. the area store (a query already resolved this session);
|
||||
* 2. bundled Natural Earth physical/marine regions;
|
||||
* 3. bundled countries and states/provinces by name — a name several
|
||||
* prominent units share ("Georgia", "Punjab") asks which one, unless
|
||||
* the view is inside exactly one of them;
|
||||
* 4. the annotation outline ladder (`resolveNamedOutline`): bundled
|
||||
* counties, US Census places and neighbourhood packs, then the guarded
|
||||
* Nominatim outline route, then Overpass only when an operator
|
||||
* configured it.
|
||||
*
|
||||
* Providers are injected, so the ladder runs under node:test:
|
||||
* findNaturalRegion(query) → {name, polygons, kind}|null
|
||||
* findAdminCandidates(query) → Array<AdminArea> (see data/adminBoundaries.js)
|
||||
* resolveNamedOutline(query, {level, levelHint, signal}) →
|
||||
* {ok:true, name, polygons, source, rung, approximate?, country?}
|
||||
* |{ok:false, code, error}
|
||||
* viewCenter() → {lat, lon}|null
|
||||
*
|
||||
* @module data/areaResolver
|
||||
*/
|
||||
|
||||
import { AREA_LEVELS } from './areaStore.js';
|
||||
import { pointInPreparedArea, prepareArea } from './areaGeometry.js';
|
||||
import { adminQueryIdentity, normalizeAdminName } from './adminBoundaries.js';
|
||||
import {
|
||||
isAreaCandidateId,
|
||||
MAX_AREA_CANDIDATE_ID_LENGTH,
|
||||
} from '../voice/areaCandidateContract.js';
|
||||
export {
|
||||
AREA_CANDIDATE_ID_PATTERN,
|
||||
isAreaCandidateId,
|
||||
MAX_AREA_CANDIDATE_ID_LENGTH,
|
||||
} from '../voice/areaCandidateContract.js';
|
||||
|
||||
/** Most candidates a clarification offers. */
|
||||
export const MAX_AREA_CANDIDATES = 4;
|
||||
/** Candidates remembered for a follow-up `candidateId`. */
|
||||
const CANDIDATE_MEMORY = 24;
|
||||
|
||||
/**
|
||||
* A place name as a cache and matching key: case-folded and NFKC-normalized,
|
||||
* punctuation dropped, letters, marks and digits in every script kept (東京
|
||||
* and 大阪 are different keys). Empty when the text names nothing.
|
||||
*/
|
||||
export function normalizeAreaQuery(text) {
|
||||
return String(text || '')
|
||||
.normalize('NFKC')
|
||||
.toLowerCase()
|
||||
.replace(/[^\p{L}\p{M}\p{N} ]+/gu, ' ')
|
||||
.replace(/\s+/g, ' ')
|
||||
.trim()
|
||||
.replace(/^the /, '');
|
||||
}
|
||||
|
||||
/** Words that name the kind of area rather than the area. */
|
||||
const LEVEL_WORDS = [
|
||||
[/\b(province|state|region|oblast|prefecture|canton|governorate)$/, 'admin1'],
|
||||
[/\b(county|district|department)$/, 'admin2'],
|
||||
[/\b(city|town|municipality|metropolitan city)$/, 'city'],
|
||||
[/\b(neighbou?rhood|borough|suburb|quarter)$/, 'district'],
|
||||
[/\b(country|nation)$/, 'country'],
|
||||
];
|
||||
|
||||
/**
|
||||
* Strip a trailing level word ("Bagmati province" → "bagmati", admin1). The
|
||||
* word is kept as a hint, not a filter, since names often contain it.
|
||||
*/
|
||||
export function splitLevelWord(query) {
|
||||
const norm = normalizeAreaQuery(query);
|
||||
for (const [re, level] of LEVEL_WORDS) {
|
||||
if (re.test(norm)) {
|
||||
const bare = norm.replace(re, '').trim();
|
||||
if (bare) return { bare, level };
|
||||
}
|
||||
}
|
||||
return { bare: norm, level: null };
|
||||
}
|
||||
|
||||
/** Area level of a bundled admin unit. */
|
||||
const ADMIN_LEVEL = Object.freeze({
|
||||
country: 'country',
|
||||
state: 'admin1',
|
||||
county: 'admin2',
|
||||
natural: 'natural',
|
||||
});
|
||||
|
||||
/**
|
||||
* One of several same-name natural places as a clarification choice, located
|
||||
* by its rough centre ("39 N 31 W") since it has no country.
|
||||
*/
|
||||
function naturalCandidate(place, kind) {
|
||||
const { lat, lon } = place.center || {};
|
||||
const locator = Number.isFinite(lat)
|
||||
? `${Math.abs(Math.round(lat))} ${lat >= 0 ? 'N' : 'S'} ${Math.abs(Math.round(lon))} ${lon >= 0 ? 'E' : 'W'}`
|
||||
: '';
|
||||
return {
|
||||
kind: 'natural',
|
||||
name: place.name,
|
||||
country: '',
|
||||
regionCode: locator,
|
||||
polygons: place.polygons.map((ring) => [ring]),
|
||||
source: 'natural-earth',
|
||||
meta: { kind },
|
||||
};
|
||||
}
|
||||
|
||||
const ADMIN_NAME_LEVEL = Object.freeze({
|
||||
country: 'country',
|
||||
nation: 'country',
|
||||
province: 'admin1',
|
||||
state: 'admin1',
|
||||
region: 'admin1',
|
||||
oblast: 'admin1',
|
||||
prefecture: 'admin1',
|
||||
canton: 'admin1',
|
||||
governorate: 'admin1',
|
||||
county: 'admin2',
|
||||
district: 'admin2',
|
||||
department: 'admin2',
|
||||
});
|
||||
|
||||
/**
|
||||
* Drop accents from Latin letters only, for comparing names: speech often
|
||||
* loses them ("Quebec" for "Québec"), while a Thai or Devanagari mark changes
|
||||
* the name and is kept.
|
||||
*/
|
||||
export function foldLatinMarks(text) {
|
||||
return String(text || '')
|
||||
.normalize('NFD')
|
||||
.replace(/(\p{Script=Latin})\p{M}+/gu, '$1')
|
||||
.normalize('NFC');
|
||||
}
|
||||
|
||||
function explicitAdminName(text) {
|
||||
const normalized = normalizeAreaQuery(String(text).split(',')[0]);
|
||||
const match = normalized.match(
|
||||
/\b(country|nation|province|state|region|zone|oblast|prefecture|canton|governorate|county|district|department)$/,
|
||||
);
|
||||
return {
|
||||
normalized,
|
||||
bare: foldLatinMarks(
|
||||
match ? normalized.slice(0, -match[0].length).trim() : normalized,
|
||||
),
|
||||
word: match?.[1] || null,
|
||||
level: match ? ADMIN_NAME_LEVEL[match[1]] || null : null,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Fail closed when a bundled unit's own name contradicts the requested unit.
|
||||
* With `aliases`, an ask the administrative matcher reads as naming this very
|
||||
* unit at its level ("State of Texas", "USA") also matches; the natural-region
|
||||
* check leaves it off, since "Great Britain" is not the United Kingdom.
|
||||
*/
|
||||
function bundledAdminIdentityRefusal(
|
||||
admin,
|
||||
query,
|
||||
wantedLevel,
|
||||
{ aliases = true } = {},
|
||||
) {
|
||||
const source = explicitAdminName(admin?.name || '');
|
||||
const requested = explicitAdminName(query);
|
||||
const expectedLevel = wantedLevel || requested.level;
|
||||
const emittedLevel = ADMIN_LEVEL[admin?.kind] || null;
|
||||
if (!source.normalized || source.word === 'zone')
|
||||
return {
|
||||
ok: false,
|
||||
code: 'AREA_IDENTITY_UNVERIFIED',
|
||||
error: `The bundled boundary is ${admin?.name || 'an unverified administrative unit'}, not a verified current match for "${query}".`,
|
||||
};
|
||||
const alias = aliases ? adminQueryIdentity(query) : null;
|
||||
const named =
|
||||
source.bare === requested.bare ||
|
||||
Boolean(
|
||||
alias &&
|
||||
alias.level === emittedLevel &&
|
||||
alias.name === normalizeAdminName(admin.name),
|
||||
);
|
||||
if (
|
||||
!named ||
|
||||
(source.level && expectedLevel && source.level !== expectedLevel) ||
|
||||
(expectedLevel && emittedLevel !== expectedLevel)
|
||||
)
|
||||
return {
|
||||
ok: false,
|
||||
code: 'AREA_IDENTITY_MISMATCH',
|
||||
error: `The bundled boundary is ${admin.name}, not the requested administrative area "${query}".`,
|
||||
};
|
||||
return null;
|
||||
}
|
||||
|
||||
function stableCandidateHash(value) {
|
||||
let hash = 0x811c9dc5;
|
||||
for (const char of String(value)) {
|
||||
hash ^= char.codePointAt(0);
|
||||
hash = Math.imul(hash, 0x01000193);
|
||||
}
|
||||
return (hash >>> 0).toString(16).padStart(8, '0');
|
||||
}
|
||||
|
||||
function candidateIdOf(admin) {
|
||||
const prefix = `ne:${admin.kind}:`;
|
||||
// The region code keeps same-named units apart: "Washington" is both WA
|
||||
// and DC, which would otherwise share one candidate and one stored area.
|
||||
const slug = normalizeAreaQuery(
|
||||
`${admin.country} ${admin.name} ${admin.regionCode || ''}`,
|
||||
).replace(/ /g, '-');
|
||||
const full = `${prefix}${slug}`;
|
||||
if (full.length <= MAX_AREA_CANDIDATE_ID_LENGTH) return full;
|
||||
const suffix = `-${stableCandidateHash(slug)}`;
|
||||
let shortened = '';
|
||||
for (const char of slug) {
|
||||
if (
|
||||
`${prefix}${shortened}${char}${suffix}`.length >
|
||||
MAX_AREA_CANDIDATE_ID_LENGTH
|
||||
)
|
||||
break;
|
||||
shortened += char;
|
||||
}
|
||||
return `${prefix}${shortened.replace(/-+$/u, '')}${suffix}`;
|
||||
}
|
||||
|
||||
/** Short, speakable identity for a clarification choice. */
|
||||
function describeCandidate(admin) {
|
||||
return {
|
||||
candidateId: candidateIdOf(admin),
|
||||
name: admin.name,
|
||||
level: ADMIN_LEVEL[admin.kind] || null,
|
||||
// Tells same-named units apart when spoken: Washington WA vs DC.
|
||||
...(admin.regionCode && admin.kind !== 'country'
|
||||
? { region: String(admin.regionCode) }
|
||||
: {}),
|
||||
...(admin.country && admin.kind !== 'country'
|
||||
? { country: admin.country }
|
||||
: {}),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Distinct places among bundled candidates. Within one country, the country
|
||||
* itself stands for its same-named state ("Mexico" is the country, not the
|
||||
* State of Mexico); across countries each name is its own place.
|
||||
*/
|
||||
/** A coarse ~2° cell of the view, or "none", for keying view-picked answers. */
|
||||
function viewCell(center) {
|
||||
if (!Number.isFinite(center?.lat) || !Number.isFinite(center?.lon))
|
||||
return 'none';
|
||||
return `${Math.floor(center.lat / 2)},${Math.floor(center.lon / 2)}`;
|
||||
}
|
||||
|
||||
export function distinctAdminPlaces(candidates) {
|
||||
const byCountry = new Map();
|
||||
for (const admin of candidates) {
|
||||
const list = byCountry.get(admin.country) || [];
|
||||
list.push(admin);
|
||||
byCountry.set(admin.country, list);
|
||||
}
|
||||
const out = [];
|
||||
for (const list of byCountry.values()) {
|
||||
const country = list.find((admin) => admin.kind === 'country');
|
||||
out.push(...(country ? [country] : list));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a resolver bound to an area store and providers.
|
||||
* @param {object} options
|
||||
*/
|
||||
export function createAreaResolver({
|
||||
store,
|
||||
findNaturalRegion = async () => null,
|
||||
findAdminCandidates = async () => [],
|
||||
resolveNamedOutline = async () => ({
|
||||
ok: false,
|
||||
code: 'AREA_UNAVAILABLE',
|
||||
error: 'Boundary lookup is unavailable here.',
|
||||
}),
|
||||
viewCenter = () => null,
|
||||
onCredit = () => {},
|
||||
now = () => Date.now(),
|
||||
maxInFlight = 8,
|
||||
} = {}) {
|
||||
if (!store) throw new TypeError('An area store is required');
|
||||
/** candidateId → bundled unit and original ask, for a clarification answered later. */
|
||||
const candidateMemory = new Map();
|
||||
/** query key → in-flight lookup, so a repeat joins the first. */
|
||||
const inFlight = new Map();
|
||||
const lifetime = new AbortController();
|
||||
const inFlightLimit = Number.isFinite(maxInFlight)
|
||||
? Math.max(1, Math.floor(maxInFlight))
|
||||
: 8;
|
||||
let activeLookups = 0;
|
||||
let disposed = false;
|
||||
|
||||
const assertActive = () => lifetime.signal.throwIfAborted();
|
||||
|
||||
const remember = (admin, identity) => {
|
||||
const id = candidateIdOf(admin);
|
||||
candidateMemory.delete(id);
|
||||
candidateMemory.set(id, { admin, identity });
|
||||
while (candidateMemory.size > CANDIDATE_MEMORY)
|
||||
candidateMemory.delete(candidateMemory.keys().next().value);
|
||||
};
|
||||
|
||||
function storeAdmin(admin, confidence, identity) {
|
||||
assertActive();
|
||||
const refused = bundledAdminIdentityRefusal(
|
||||
admin,
|
||||
identity?.query,
|
||||
identity?.wantedLevel,
|
||||
);
|
||||
if (refused) return refused;
|
||||
const record = store.put({
|
||||
geometry: admin.polygons,
|
||||
name: admin.name,
|
||||
level: ADMIN_LEVEL[admin.kind] || null,
|
||||
source: admin.source,
|
||||
sourceId: candidateIdOf(admin),
|
||||
meta: {
|
||||
...(admin.kind !== 'country' && admin.country
|
||||
? { country: admin.country }
|
||||
: {}),
|
||||
rung: 'bundled',
|
||||
},
|
||||
});
|
||||
if (!record)
|
||||
return {
|
||||
ok: false,
|
||||
code: 'AREA_NOT_FOUND',
|
||||
error: `The boundary for ${admin.name} is not a usable polygon.`,
|
||||
};
|
||||
onCredit(admin.source);
|
||||
return { ok: true, record, confidence, rung: 'bundled' };
|
||||
}
|
||||
|
||||
async function lookup({ query, level, within }, { signal }) {
|
||||
const { level: levelHint } = splitLevelWord(query);
|
||||
const searchText = within ? `${query}, ${within}` : query;
|
||||
let bundledRefusal = null;
|
||||
// Offline first: a named natural region, unless an admin level or a
|
||||
// country/state qualifier was given (the pack cannot check `within`).
|
||||
if ((!level || level === 'natural') && !within) {
|
||||
const ne = await findNaturalRegion(query, { signal }).catch(() => null);
|
||||
signal?.throwIfAborted?.();
|
||||
// A region named like a country or state ("India" the peninsula,
|
||||
// "Punjab" the desert) never hides it; asked for by level, it answers.
|
||||
// Only a unit that really has this name counts: "Great Britain" finds
|
||||
// the United Kingdom by alias, which is not a Great Britain.
|
||||
// A feature split into parts is one place with every part; distant
|
||||
// namesakes (Flores in the Azores and Indonesia) are asked about.
|
||||
const places = ne?.places?.length
|
||||
? ne.places
|
||||
: ne?.polygons?.length
|
||||
? [{ name: ne.name, polygons: ne.polygons }]
|
||||
: [];
|
||||
const shadowsAdmin =
|
||||
places.length > 0 &&
|
||||
level !== 'natural' &&
|
||||
(await findAdminCandidates(query, { signal }).catch(() => [])).some(
|
||||
(admin) =>
|
||||
!bundledAdminIdentityRefusal(admin, query, null, {
|
||||
aliases: false,
|
||||
}),
|
||||
);
|
||||
signal?.throwIfAborted?.();
|
||||
if (places.length > 1 && !shadowsAdmin) {
|
||||
const offered = places
|
||||
.slice(0, MAX_AREA_CANDIDATES)
|
||||
.map((place) => naturalCandidate(place, ne.kind));
|
||||
const identity = { query, wantedLevel: 'natural' };
|
||||
offered.forEach((admin) => remember(admin, identity));
|
||||
return {
|
||||
ok: false,
|
||||
needsClarification: true,
|
||||
code: 'AMBIGUOUS_AREA',
|
||||
candidates: offered.map(describeCandidate),
|
||||
error: `"${query}" names ${offered.length} places — ask which one.`,
|
||||
};
|
||||
}
|
||||
if (places.length === 1 && !shadowsAdmin) {
|
||||
const record = store.put({
|
||||
geometry: places[0].polygons.map((ring) => [ring]),
|
||||
name: ne.name,
|
||||
level: 'natural',
|
||||
source: 'natural-earth',
|
||||
sourceId: `ne:${normalizeAreaQuery(ne.name).replace(/ /g, '-')}`,
|
||||
meta: { kind: ne.kind, rung: 'bundled' },
|
||||
});
|
||||
if (record) {
|
||||
onCredit('natural-earth');
|
||||
return { ok: true, record, confidence: 0.95, rung: 'bundled' };
|
||||
}
|
||||
}
|
||||
}
|
||||
signal?.throwIfAborted?.();
|
||||
// Bundled countries and states by name. A name prominent units share is
|
||||
// asked about, never guessed — except when the view is inside one.
|
||||
const wanted = level || levelHint;
|
||||
if (!wanted || wanted === 'country' || wanted === 'admin1') {
|
||||
let admins = await findAdminCandidates(searchText, { signal }).catch(
|
||||
() => [],
|
||||
);
|
||||
signal?.throwIfAborted?.();
|
||||
if (wanted) admins = admins.filter((a) => ADMIN_LEVEL[a.kind] === wanted);
|
||||
let places = distinctAdminPlaces(admins);
|
||||
const identity = { query, wantedLevel: wanted };
|
||||
const checked = places.map((admin) => ({
|
||||
admin,
|
||||
refused: bundledAdminIdentityRefusal(admin, query, wanted),
|
||||
}));
|
||||
places = checked
|
||||
.filter(({ refused }) => !refused)
|
||||
.map(({ admin }) => admin);
|
||||
if (!places.length && checked.length) {
|
||||
const refused = checked.find((entry) => entry.refused)?.refused;
|
||||
// A retired or unverifiable unit is final. A different unit that
|
||||
// merely shares the name ("Azad Kashmir" for "Kashmir") is not an
|
||||
// answer, so the outline ladder still gets to look.
|
||||
if (refused?.code !== 'AREA_IDENTITY_MISMATCH') return refused;
|
||||
bundledRefusal = refused;
|
||||
}
|
||||
if (places.length === 1) {
|
||||
return storeAdmin(places[0], 0.95, identity);
|
||||
}
|
||||
if (places.length > 1) {
|
||||
const center = viewCenter();
|
||||
const holding = center
|
||||
? places.filter((admin) => {
|
||||
const prepared = prepareArea(admin.polygons);
|
||||
return (
|
||||
prepared &&
|
||||
pointInPreparedArea(prepared, center.lat, center.lon)
|
||||
);
|
||||
})
|
||||
: [];
|
||||
// Chosen by the view, so never remembered for the name: asked again
|
||||
// over the other one, it answers the other one.
|
||||
if (holding.length === 1)
|
||||
return { ...storeAdmin(holding[0], 0.85, identity), byView: true };
|
||||
const offered = places.slice(0, MAX_AREA_CANDIDATES);
|
||||
offered.forEach((admin) => remember(admin, identity));
|
||||
return {
|
||||
ok: false,
|
||||
needsClarification: true,
|
||||
code: 'AMBIGUOUS_AREA',
|
||||
candidates: offered.map(describeCandidate),
|
||||
error: `"${query}" names ${offered.length} places — ask which one.`,
|
||||
};
|
||||
}
|
||||
}
|
||||
signal?.throwIfAborted?.();
|
||||
// Everything else: the annotation outline ladder.
|
||||
const outline = await resolveNamedOutline(searchText, {
|
||||
level,
|
||||
levelHint,
|
||||
signal,
|
||||
});
|
||||
signal?.throwIfAborted?.();
|
||||
if (!outline?.ok)
|
||||
return (
|
||||
bundledRefusal || {
|
||||
ok: false,
|
||||
code: outline?.code || 'AREA_NOT_FOUND',
|
||||
error: outline?.error || `No boundary found for "${query}".`,
|
||||
}
|
||||
);
|
||||
const record = store.put({
|
||||
geometry: outline.polygons,
|
||||
name: outline.name || query,
|
||||
level: level || levelHint || outline.adminLevel || null,
|
||||
source: outline.approximate ? 'approximate' : outline.source,
|
||||
approximate: Boolean(outline.approximate),
|
||||
meta: {
|
||||
...(outline.country ? { country: outline.country } : {}),
|
||||
...(outline.adminName ? { adminName: outline.adminName } : {}),
|
||||
...(outline.adminLevel ? { adminLevel: outline.adminLevel } : {}),
|
||||
rung: outline.rung || null,
|
||||
...(outline.basis ? { basis: outline.basis } : {}),
|
||||
},
|
||||
});
|
||||
if (!record)
|
||||
return {
|
||||
ok: false,
|
||||
code: 'AREA_NOT_FOUND',
|
||||
error: `The boundary for ${query} is not a usable polygon.`,
|
||||
};
|
||||
return {
|
||||
ok: true,
|
||||
record,
|
||||
confidence: outline.approximate ? 0.5 : 0.8,
|
||||
rung: outline.rung || null,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a place to an area handle.
|
||||
* @param {{query?: string, level?: string, within?: string, candidateId?: string}} args
|
||||
* @param {{signal?: AbortSignal, budgetMs?: number}} [options] Past the
|
||||
* budget the call answers AREA_TIMEOUT while the lookup continues and
|
||||
* fills the caches, so asking again shortly is fast.
|
||||
* @returns {Promise<object>}
|
||||
*/
|
||||
async function resolve(args = {}, { signal, budgetMs = 8000 } = {}) {
|
||||
const started = now();
|
||||
const level = AREA_LEVELS.includes(args.level) ? args.level : null;
|
||||
const within = String(args.within || '').trim();
|
||||
const candidateId = String(args.candidateId || '').trim();
|
||||
const finish = (result, cached = false) => ({
|
||||
...result,
|
||||
cached,
|
||||
ms: now() - started,
|
||||
});
|
||||
|
||||
if (disposed)
|
||||
return finish({
|
||||
ok: false,
|
||||
code: 'CANCELLED',
|
||||
cancelled: true,
|
||||
error: 'Area resolver has been disposed.',
|
||||
});
|
||||
|
||||
if (candidateId) {
|
||||
if (!isAreaCandidateId(candidateId))
|
||||
return finish({
|
||||
ok: false,
|
||||
code: 'BAD_CANDIDATE',
|
||||
error:
|
||||
'candidateId is malformed or too long. Resolve the name again.',
|
||||
});
|
||||
const remembered = candidateMemory.get(candidateId);
|
||||
if (!remembered)
|
||||
return finish({
|
||||
ok: false,
|
||||
code: 'UNKNOWN_CANDIDATE',
|
||||
error: `Unknown candidateId "${candidateId}". Resolve the name again.`,
|
||||
});
|
||||
if (signal?.aborted)
|
||||
return finish({
|
||||
ok: false,
|
||||
code: 'CANCELLED',
|
||||
cancelled: true,
|
||||
error: 'This request was superseded.',
|
||||
});
|
||||
return finish(storeAdmin(remembered.admin, 0.9, remembered.identity));
|
||||
}
|
||||
|
||||
const query = String(args.query || '').trim();
|
||||
if (!query)
|
||||
return finish({
|
||||
ok: false,
|
||||
code: 'BAD_AREA',
|
||||
error: 'Name a place to resolve.',
|
||||
});
|
||||
const nameKey = normalizeAreaQuery(query);
|
||||
// The outline ladder and geocoder pick by the view ("Springfield" over
|
||||
// Illinois), so an answer is reused or shared only within the same
|
||||
// ~2° view cell. A name that normalizes to nothing is never cached.
|
||||
const key = nameKey
|
||||
? `${nameKey}|${level || ''}|${normalizeAreaQuery(within)}|${viewCell(viewCenter())}`
|
||||
: null;
|
||||
const recalled = key ? store.recallQuery(key) : null;
|
||||
if (recalled)
|
||||
return finish(
|
||||
{ ok: true, record: recalled, confidence: 0.95, rung: 'store' },
|
||||
true,
|
||||
);
|
||||
|
||||
let pending = key ? inFlight.get(key) : null;
|
||||
if (!pending) {
|
||||
if (activeLookups >= inFlightLimit)
|
||||
return finish({
|
||||
ok: false,
|
||||
code: 'AREA_BUSY',
|
||||
error:
|
||||
'Too many area lookups are already running — try again shortly.',
|
||||
});
|
||||
// The shared lookup outlives any one caller's signal: a superseded turn
|
||||
// must not cancel the answer a repeat is waiting on. The resolver's own
|
||||
// lifetime still owns the provider work, so final teardown stops it.
|
||||
activeLookups += 1;
|
||||
pending = lookup({ query, level, within }, { signal: lifetime.signal })
|
||||
.then((result) => {
|
||||
assertActive();
|
||||
if (result.ok && key && !result.byView)
|
||||
store.rememberQuery(key, result.record.areaId);
|
||||
return result;
|
||||
})
|
||||
.catch((error) =>
|
||||
lifetime.signal.aborted
|
||||
? {
|
||||
ok: false,
|
||||
code: 'CANCELLED',
|
||||
cancelled: true,
|
||||
error: 'Area resolver has been disposed.',
|
||||
}
|
||||
: {
|
||||
ok: false,
|
||||
code: 'AREA_UNAVAILABLE',
|
||||
error: error?.message || 'Boundary lookup failed.',
|
||||
},
|
||||
)
|
||||
.finally(() => {
|
||||
activeLookups -= 1;
|
||||
if (key) inFlight.delete(key);
|
||||
});
|
||||
if (key) inFlight.set(key, pending);
|
||||
}
|
||||
let timer;
|
||||
const racers = [pending];
|
||||
if (Number.isFinite(budgetMs))
|
||||
racers.push(
|
||||
new Promise((resolveTimeout) => {
|
||||
timer = setTimeout(
|
||||
() =>
|
||||
resolveTimeout({
|
||||
ok: false,
|
||||
code: 'AREA_TIMEOUT',
|
||||
error: `Looking up "${query}" is taking a while — ask again in a moment.`,
|
||||
}),
|
||||
budgetMs,
|
||||
);
|
||||
}),
|
||||
);
|
||||
// Detached once this call settles: a caller's long-lived signal must not
|
||||
// collect one listener per completed lookup.
|
||||
let cancelled = null;
|
||||
if (signal)
|
||||
racers.push(
|
||||
new Promise((resolveAbort) => {
|
||||
const superseded = {
|
||||
ok: false,
|
||||
code: 'CANCELLED',
|
||||
cancelled: true,
|
||||
error: 'Superseded.',
|
||||
};
|
||||
if (signal.aborted) return resolveAbort(superseded);
|
||||
cancelled = () => resolveAbort(superseded);
|
||||
signal.addEventListener?.('abort', cancelled, { once: true });
|
||||
return undefined;
|
||||
}),
|
||||
);
|
||||
try {
|
||||
return finish(await Promise.race(racers));
|
||||
} finally {
|
||||
clearTimeout(timer);
|
||||
if (cancelled) signal.removeEventListener?.('abort', cancelled);
|
||||
}
|
||||
}
|
||||
|
||||
function dispose() {
|
||||
if (disposed) return;
|
||||
disposed = true;
|
||||
lifetime.abort();
|
||||
inFlight.clear();
|
||||
candidateMemory.clear();
|
||||
}
|
||||
|
||||
return {
|
||||
resolve,
|
||||
dispose,
|
||||
candidate: (id) => candidateMemory.get(id) || null,
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,896 @@
|
||||
// Area handles: the session store and the resolution ladder (bundled Natural
|
||||
// Earth regions → bundled countries and states → the annotation outline
|
||||
// ladder), with every rung mocked. Pins the clarification contract for
|
||||
// ambiguous names and the fast cached path.
|
||||
//
|
||||
// Run with: npm test
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { createAreaStore, summarizeArea } from './areaStore.js';
|
||||
import {
|
||||
AREA_CANDIDATE_ID_PATTERN,
|
||||
createAreaResolver,
|
||||
distinctAdminPlaces,
|
||||
isAreaCandidateId,
|
||||
MAX_AREA_CANDIDATE_ID_LENGTH,
|
||||
splitLevelWord,
|
||||
} from './areaResolver.js';
|
||||
import { pointInPreparedArea } from './areaGeometry.js';
|
||||
import { findAdminCandidates } from './adminBoundaries.js';
|
||||
|
||||
const square = (w, s, e, n) => [
|
||||
[w, s],
|
||||
[e, s],
|
||||
[e, n],
|
||||
[w, n],
|
||||
[w, s],
|
||||
];
|
||||
|
||||
const admin = (kind, name, country, box, extra = {}) => ({
|
||||
kind,
|
||||
name,
|
||||
country,
|
||||
source: 'natural-earth',
|
||||
polygons: [[square(...box)]],
|
||||
...extra,
|
||||
});
|
||||
const GEORGIA_COUNTRY = admin(
|
||||
'country',
|
||||
'Georgia',
|
||||
'Georgia',
|
||||
[40, 41, 46.7, 43.6],
|
||||
);
|
||||
const GEORGIA_STATE = admin(
|
||||
'state',
|
||||
'Georgia',
|
||||
'United States of America',
|
||||
[-85.6, 30.4, -80.8, 35],
|
||||
);
|
||||
const PUNJAB_IN = admin('state', 'Punjab', 'India', [73.8, 29.5, 77, 32.5]);
|
||||
const PUNJAB_PK = admin('state', 'Punjab', 'Pakistan', [69.3, 27.7, 73.7, 34]);
|
||||
const TEXAS = admin(
|
||||
'state',
|
||||
'Texas',
|
||||
'United States of America',
|
||||
[-106, 26, -94, 36],
|
||||
);
|
||||
|
||||
const BAGMATI = {
|
||||
ok: true,
|
||||
name: 'Bagmati Province',
|
||||
polygons: [[square(84.4, 26.9, 86.6, 28.4), square(85.3, 27.6, 85.4, 27.7)]],
|
||||
source: 'osm',
|
||||
rung: 'nominatim',
|
||||
adminName: 'Bagmati Province',
|
||||
};
|
||||
|
||||
function makeResolver(overrides = {}) {
|
||||
const store = createAreaStore();
|
||||
const calls = { outline: [], natural: 0, admin: 0 };
|
||||
const resolver = createAreaResolver({
|
||||
store,
|
||||
findNaturalRegion: async (q) => {
|
||||
calls.natural += 1;
|
||||
return /alps/i.test(q)
|
||||
? {
|
||||
name: 'Alps',
|
||||
kind: 'natural',
|
||||
polygons: [square(5, 44, 16, 48), square(17, 44, 18, 45)],
|
||||
}
|
||||
: null;
|
||||
},
|
||||
findAdminCandidates: async (q) => {
|
||||
calls.admin += 1;
|
||||
if (/^georgia$/i.test(q)) return [GEORGIA_STATE, GEORGIA_COUNTRY];
|
||||
if (/^georgia, united states/i.test(q)) return [GEORGIA_STATE];
|
||||
if (/^punjab$/i.test(q)) return [PUNJAB_PK, PUNJAB_IN];
|
||||
if (/^punjab, pakistan/i.test(q)) return [PUNJAB_PK];
|
||||
if (/^texas$/i.test(q)) return [TEXAS];
|
||||
return [];
|
||||
},
|
||||
resolveNamedOutline: async (q, options) => {
|
||||
calls.outline.push({ q, ...options, signal: undefined });
|
||||
if (/bagmati/i.test(q)) return BAGMATI;
|
||||
return {
|
||||
ok: false,
|
||||
code: 'AREA_NOT_FOUND',
|
||||
error: `No boundary found for "${q}".`,
|
||||
};
|
||||
},
|
||||
...overrides,
|
||||
});
|
||||
return { store, resolver, calls };
|
||||
}
|
||||
|
||||
test('the store keeps geometry local and summarizes without coordinates', () => {
|
||||
const store = createAreaStore({ maxEntries: 2 });
|
||||
const a = store.put({
|
||||
geometry: [[square(0, 0, 1, 1)]],
|
||||
name: 'A',
|
||||
source: 'drawn',
|
||||
level: 'drawn',
|
||||
});
|
||||
const b = store.put({
|
||||
geometry: [[square(2, 2, 3, 3)]],
|
||||
name: 'B',
|
||||
source: 'us-census',
|
||||
sourceId: 'place:1',
|
||||
});
|
||||
assert.equal(b.areaId, 'place:1');
|
||||
assert.equal(b.source, 'us-census');
|
||||
store.get(a.areaId); // A is now the most recently used
|
||||
store.put({ geometry: [[square(4, 4, 5, 5)]], name: 'C', source: 'osm' });
|
||||
assert.equal(store.has('place:1'), false, 'least recently used evicted');
|
||||
assert.ok(store.get(a.areaId));
|
||||
const summary = summarizeArea(a);
|
||||
assert.deepEqual(
|
||||
Object.keys(summary).sort(),
|
||||
[
|
||||
'areaId',
|
||||
'areaKm2',
|
||||
'bbox',
|
||||
'holes',
|
||||
'level',
|
||||
'name',
|
||||
'parts',
|
||||
'source',
|
||||
].sort(),
|
||||
);
|
||||
assert.equal(JSON.stringify(summary).includes('geometry'), false);
|
||||
assert.equal(
|
||||
store.put({
|
||||
geometry: [
|
||||
[
|
||||
[0, 0],
|
||||
[1, 1],
|
||||
],
|
||||
],
|
||||
name: 'bad',
|
||||
}),
|
||||
null,
|
||||
);
|
||||
});
|
||||
|
||||
test('query aliases have their own LRU bound even for one stable area', () => {
|
||||
const store = createAreaStore({ maxEntries: 2, maxQueryEntries: 3 });
|
||||
const area = store.put({
|
||||
geometry: [[square(0, 0, 1, 1)]],
|
||||
name: 'Stable',
|
||||
source: 'osm',
|
||||
sourceId: 'osm:stable',
|
||||
});
|
||||
for (let i = 0; i < 50; i += 1)
|
||||
store.rememberQuery(`alias-${i}`, area.areaId);
|
||||
assert.equal(store.recallQuery('alias-0'), null, 'old aliases are evicted');
|
||||
assert.equal(store.recallQuery('alias-46'), null, 'the bound is independent');
|
||||
assert.equal(store.recallQuery('alias-47')?.areaId, area.areaId);
|
||||
assert.equal(store.recallQuery('alias-49')?.areaId, area.areaId);
|
||||
assert.equal(store.size, 1, 'alias churn does not evict the area record');
|
||||
});
|
||||
|
||||
test('a stable source keeps one handle when stored again', () => {
|
||||
const store = createAreaStore();
|
||||
for (let i = 0; i < 2; i += 1)
|
||||
store.put({
|
||||
geometry: [[square(0, 0, 1, 1)]],
|
||||
name: 'X',
|
||||
source: 'natural-earth',
|
||||
sourceId: 'ne:state:x',
|
||||
});
|
||||
assert.equal(store.size, 1);
|
||||
});
|
||||
|
||||
test('a named natural region resolves offline with every part', async () => {
|
||||
const { resolver, calls } = makeResolver();
|
||||
const result = await resolver.resolve({ query: 'the Alps' });
|
||||
assert.equal(result.ok, true);
|
||||
assert.equal(result.record.source, 'natural-earth');
|
||||
assert.equal(result.record.parts, 2);
|
||||
assert.equal(calls.outline.length, 0, 'no lookup');
|
||||
assert.ok(result.ms < 300);
|
||||
});
|
||||
|
||||
test('a bundled state resolves by name with no lookup', async () => {
|
||||
const { resolver, calls } = makeResolver();
|
||||
const result = await resolver.resolve({ query: 'Texas' });
|
||||
assert.equal(result.ok, true);
|
||||
assert.equal(result.rung, 'bundled');
|
||||
assert.equal(result.record.level, 'admin1');
|
||||
assert.equal(result.record.source, 'natural-earth');
|
||||
assert.equal(result.record.meta.country, 'United States of America');
|
||||
assert.equal(calls.outline.length, 0);
|
||||
});
|
||||
|
||||
test('Bagmati goes to the outline ladder and keeps its hole', async () => {
|
||||
const { resolver, calls } = makeResolver();
|
||||
const result = await resolver.resolve({ query: 'Bagmati province' });
|
||||
assert.equal(result.ok, true);
|
||||
assert.equal(result.rung, 'nominatim');
|
||||
assert.equal(result.record.source, 'osm');
|
||||
assert.equal(result.record.level, 'admin1', 'the level word is kept');
|
||||
assert.equal(result.record.holes, 1);
|
||||
assert.equal(pointInPreparedArea(result.record.prepared, 27.2, 85), true);
|
||||
assert.equal(
|
||||
pointInPreparedArea(result.record.prepared, 27.65, 85.35),
|
||||
false,
|
||||
'inside the hole',
|
||||
);
|
||||
assert.equal(calls.outline[0].levelHint, 'admin1');
|
||||
});
|
||||
|
||||
test('a legacy bundled zone is never stored as the requested current province', async () => {
|
||||
const legacy = admin(
|
||||
'state',
|
||||
'Bagmati Zone',
|
||||
'Nepal',
|
||||
[84.645, 27.357, 86.055, 28.335],
|
||||
);
|
||||
const { store, resolver } = makeResolver({
|
||||
findAdminCandidates: async () => [legacy],
|
||||
});
|
||||
const result = await resolver.resolve({ query: 'Bagmati province' });
|
||||
assert.equal(result.ok, false);
|
||||
assert.equal(result.code, 'AREA_IDENTITY_UNVERIFIED');
|
||||
assert.equal(result.record, undefined);
|
||||
assert.equal(store.size, 0);
|
||||
const repeated = await resolver.resolve({ query: 'Bagmati province' });
|
||||
assert.equal(repeated.code, 'AREA_IDENTITY_UNVERIFIED');
|
||||
assert.equal(repeated.cached, false);
|
||||
assert.equal(store.size, 0);
|
||||
});
|
||||
|
||||
test('legacy zone identity cannot escape through view choice or candidate memory', async () => {
|
||||
const nepal = admin(
|
||||
'state',
|
||||
'Bagmati Zone',
|
||||
'Nepal',
|
||||
[84.645, 27.357, 86.055, 28.335],
|
||||
);
|
||||
const namesake = admin(
|
||||
'state',
|
||||
'Bagmati Zone',
|
||||
'Elsewhere',
|
||||
[10, 10, 11, 11],
|
||||
);
|
||||
const { store, resolver } = makeResolver({
|
||||
findAdminCandidates: async () => [nepal, namesake],
|
||||
viewCenter: () => ({ lat: 27.7, lon: 85.3 }),
|
||||
});
|
||||
const result = await resolver.resolve({ query: 'Bagmati province' });
|
||||
assert.equal(result.ok, false);
|
||||
assert.equal(result.code, 'AREA_IDENTITY_UNVERIFIED');
|
||||
assert.equal(result.needsClarification, undefined);
|
||||
assert.equal(result.candidates, undefined);
|
||||
assert.equal(store.size, 0);
|
||||
assert.equal(
|
||||
(await resolver.resolve({ candidateId: 'ne:state:nepal-bagmati-zone' }))
|
||||
.code,
|
||||
'UNKNOWN_CANDIDATE',
|
||||
);
|
||||
assert.equal(store.size, 0);
|
||||
});
|
||||
|
||||
test('a repeat is answered from the store without a lookup', async () => {
|
||||
const { resolver, calls } = makeResolver();
|
||||
await resolver.resolve({ query: 'Bagmati' });
|
||||
const again = await resolver.resolve({ query: 'bagmati' });
|
||||
assert.equal(again.ok, true);
|
||||
assert.equal(again.cached, true);
|
||||
assert.equal(calls.outline.length, 1);
|
||||
});
|
||||
|
||||
test('an ambiguous name asks instead of guessing, and the choice resolves', async () => {
|
||||
const { resolver, calls } = makeResolver();
|
||||
const result = await resolver.resolve({ query: 'Georgia' });
|
||||
assert.equal(result.ok, false);
|
||||
assert.equal(result.needsClarification, true);
|
||||
assert.equal(result.candidates.length, 2);
|
||||
assert.deepEqual(result.candidates[0], {
|
||||
candidateId: 'ne:state:united-states-of-america-georgia',
|
||||
name: 'Georgia',
|
||||
level: 'admin1',
|
||||
country: 'United States of America',
|
||||
});
|
||||
assert.equal(result.candidates[1].level, 'country');
|
||||
assert.equal(calls.outline.length, 0, 'no lookup spent on a question');
|
||||
const chosen = await resolver.resolve({
|
||||
candidateId: result.candidates[0].candidateId,
|
||||
});
|
||||
assert.equal(chosen.ok, true);
|
||||
assert.equal(chosen.record.meta.country, 'United States of America');
|
||||
});
|
||||
|
||||
test('an already-aborted clarification choice does not persist page state', async () => {
|
||||
const { store, resolver } = makeResolver();
|
||||
const result = await resolver.resolve({ query: 'Georgia' });
|
||||
const controller = new AbortController();
|
||||
controller.abort();
|
||||
const chosen = await resolver.resolve(
|
||||
{ candidateId: result.candidates[0].candidateId },
|
||||
{ signal: controller.signal },
|
||||
);
|
||||
assert.equal(chosen.code, 'CANCELLED');
|
||||
assert.equal(chosen.cancelled, true);
|
||||
assert.equal(store.size, 0);
|
||||
});
|
||||
|
||||
test('candidate IDs accept every emitted choice and reject malformed or oversized input', async () => {
|
||||
const { store, resolver } = makeResolver();
|
||||
const result = await resolver.resolve({ query: 'Georgia' });
|
||||
const grammar = new RegExp(AREA_CANDIDATE_ID_PATTERN, 'u');
|
||||
for (const choice of result.candidates) {
|
||||
assert.ok(choice.candidateId.length <= MAX_AREA_CANDIDATE_ID_LENGTH);
|
||||
assert.match(choice.candidateId, grammar);
|
||||
assert.equal(isAreaCandidateId(choice.candidateId), true);
|
||||
assert.equal(
|
||||
(await resolver.resolve({ candidateId: choice.candidateId })).ok,
|
||||
true,
|
||||
);
|
||||
}
|
||||
assert.equal(result.candidates[0].candidateId.length, 41);
|
||||
|
||||
store.put({
|
||||
geometry: [[square(0, 0, 1, 1)]],
|
||||
name: 'Not a candidate',
|
||||
source: 'osm',
|
||||
sourceId: 'area-1',
|
||||
});
|
||||
for (const bad of [
|
||||
'area-1',
|
||||
'ne:state:bad slug',
|
||||
'ne:state:../../etc',
|
||||
'ne:state:!!!',
|
||||
'ne:state:a_b',
|
||||
'ne:planet:earth',
|
||||
`ne:state:${'a'.repeat(MAX_AREA_CANDIDATE_ID_LENGTH)}`,
|
||||
]) {
|
||||
const rejected = await resolver.resolve({ candidateId: bad });
|
||||
assert.equal(rejected.code, 'BAD_CANDIDATE');
|
||||
}
|
||||
});
|
||||
|
||||
test('long bundled names produce bounded, distinct candidate handles', async () => {
|
||||
const name = 'A'.repeat(70);
|
||||
const candidates = [
|
||||
admin('state', name, `B${'b'.repeat(70)}`, [0, 0, 1, 1]),
|
||||
admin('state', name, `C${'c'.repeat(70)}`, [2, 2, 3, 3]),
|
||||
];
|
||||
const { resolver } = makeResolver({
|
||||
findAdminCandidates: async () => candidates,
|
||||
});
|
||||
const result = await resolver.resolve({ query: name });
|
||||
assert.equal(result.needsClarification, true);
|
||||
assert.equal(
|
||||
new Set(result.candidates.map((choice) => choice.candidateId)).size,
|
||||
2,
|
||||
);
|
||||
for (const choice of result.candidates) {
|
||||
assert.equal(isAreaCandidateId(choice.candidateId), true);
|
||||
assert.ok(choice.candidateId.length <= MAX_AREA_CANDIDATE_ID_LENGTH);
|
||||
assert.equal(
|
||||
(await resolver.resolve({ candidateId: choice.candidateId })).ok,
|
||||
true,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('within or level settles an ambiguous name', async () => {
|
||||
const { resolver } = makeResolver();
|
||||
const state = await resolver.resolve({
|
||||
query: 'Georgia',
|
||||
within: 'United States',
|
||||
});
|
||||
assert.equal(state.ok, true);
|
||||
assert.equal(state.record.level, 'admin1');
|
||||
const country = await resolver.resolve({
|
||||
query: 'Georgia',
|
||||
level: 'country',
|
||||
});
|
||||
assert.equal(country.ok, true);
|
||||
assert.equal(country.record.level, 'country');
|
||||
const both = await resolver.resolve({ query: 'Punjab', level: 'admin1' });
|
||||
assert.equal(both.needsClarification, true, 'both Punjabs are admin1');
|
||||
const pk = await resolver.resolve({ query: 'Punjab', within: 'Pakistan' });
|
||||
assert.equal(pk.record.meta.country, 'Pakistan');
|
||||
});
|
||||
|
||||
test('the view settles an ambiguous name only when it is inside one of them', async () => {
|
||||
const { resolver } = makeResolver({
|
||||
viewCenter: () => ({ lat: 31, lon: 75.5 }),
|
||||
});
|
||||
const result = await resolver.resolve({ query: 'Punjab' });
|
||||
assert.equal(result.ok, true);
|
||||
assert.equal(result.record.meta.country, 'India');
|
||||
const away = makeResolver({ viewCenter: () => ({ lat: 0, lon: 0 }) });
|
||||
const asked = await away.resolver.resolve({ query: 'Punjab' });
|
||||
assert.equal(asked.needsClarification, true);
|
||||
// A choice the view made is not remembered for the name.
|
||||
let view = { lat: 31, lon: 75.5 };
|
||||
const moving = makeResolver({ viewCenter: () => view });
|
||||
await moving.resolver.resolve({ query: 'Punjab' });
|
||||
view = { lat: 31, lon: 71 };
|
||||
const again = await moving.resolver.resolve({ query: 'Punjab' });
|
||||
assert.equal(again.record.meta.country, 'Pakistan');
|
||||
});
|
||||
|
||||
test('a qualifier skips the natural-region pack, which cannot check it', async () => {
|
||||
const { resolver, calls } = makeResolver();
|
||||
await resolver.resolve({ query: 'the Alps', within: 'Austria' });
|
||||
assert.equal(calls.natural, 0);
|
||||
assert.equal(calls.outline.length, 1);
|
||||
});
|
||||
|
||||
test('the area just stored survives eviction even when every other area is pinned', () => {
|
||||
const store = createAreaStore({ maxEntries: 2, isPinned: () => true });
|
||||
for (let i = 0; i < 3; i += 1)
|
||||
store.put({
|
||||
geometry: [[square(i, 0, i + 0.5, 0.5)]],
|
||||
name: `A${i}`,
|
||||
source: 'drawn',
|
||||
});
|
||||
const last = store.put({
|
||||
geometry: [[square(9, 0, 9.5, 0.5)]],
|
||||
name: 'new',
|
||||
source: 'drawn',
|
||||
});
|
||||
assert.ok(store.get(last.areaId), 'the new handle is usable');
|
||||
});
|
||||
|
||||
test('a country stands for its same-named state; namesakes abroad are rivals', () => {
|
||||
const mexico = admin('country', 'Mexico', 'Mexico', [-118, 14, -86, 33]);
|
||||
const state = admin(
|
||||
'state',
|
||||
'State of Mexico',
|
||||
'Mexico',
|
||||
[-100, 18, -98, 20],
|
||||
);
|
||||
assert.deepEqual(distinctAdminPlaces([state, mexico]), [mexico]);
|
||||
assert.equal(distinctAdminPlaces([PUNJAB_IN, PUNJAB_PK]).length, 2);
|
||||
});
|
||||
|
||||
test('bundled candidates: shared prominent names list every unit, minor ones none', async () => {
|
||||
const names = async (q) =>
|
||||
(await findAdminCandidates(q)).map((a) => `${a.kind}:${a.country}`);
|
||||
assert.deepEqual((await names('Punjab')).sort(), [
|
||||
'state:India',
|
||||
'state:Pakistan',
|
||||
]);
|
||||
assert.deepEqual((await names('Georgia')).sort(), [
|
||||
'country:Georgia',
|
||||
'state:United States of America',
|
||||
]);
|
||||
assert.deepEqual(await names('Punjab, India'), ['state:India']);
|
||||
assert.deepEqual(await names('Kent'), [], 'minor units are the geocoder’s');
|
||||
});
|
||||
|
||||
test('an outline ladder refusal passes through with its code', async () => {
|
||||
const { resolver } = makeResolver();
|
||||
const miss = await resolver.resolve({ query: 'Nowhere Province' });
|
||||
assert.equal(miss.ok, false);
|
||||
assert.equal(miss.code, 'AREA_NOT_FOUND');
|
||||
const down = makeResolver({
|
||||
resolveNamedOutline: async () => ({
|
||||
ok: false,
|
||||
code: 'AREA_UNAVAILABLE',
|
||||
error: 'No outline source can trace it here.',
|
||||
}),
|
||||
});
|
||||
const failed = await down.resolver.resolve({ query: 'Kathmandu' });
|
||||
assert.equal(failed.code, 'AREA_UNAVAILABLE');
|
||||
});
|
||||
|
||||
test('an approximate outline is stored and labelled as such', async () => {
|
||||
const { resolver } = makeResolver({
|
||||
resolveNamedOutline: async () => ({
|
||||
ok: true,
|
||||
name: 'Mission',
|
||||
polygons: [[square(0, 0, 0.01, 0.01)]],
|
||||
source: 'osm',
|
||||
rung: 'overpass',
|
||||
approximate: true,
|
||||
basis: 'buffer sized to the place',
|
||||
}),
|
||||
});
|
||||
const result = await resolver.resolve({ query: 'the Mission' });
|
||||
assert.equal(result.record.approximate, true);
|
||||
assert.equal(result.record.source, 'approximate');
|
||||
assert.equal(result.record.meta.basis, 'buffer sized to the place');
|
||||
});
|
||||
|
||||
test('a slow lookup times out but keeps filling the cache', async () => {
|
||||
let release;
|
||||
const gate = new Promise((r) => {
|
||||
release = r;
|
||||
});
|
||||
const { resolver } = makeResolver({
|
||||
resolveNamedOutline: async () => {
|
||||
await gate;
|
||||
return BAGMATI;
|
||||
},
|
||||
});
|
||||
const first = await resolver.resolve({ query: 'Bagmati' }, { budgetMs: 20 });
|
||||
assert.equal(first.code, 'AREA_TIMEOUT');
|
||||
release();
|
||||
await new Promise((r) => setTimeout(r, 10));
|
||||
const second = await resolver.resolve({ query: 'Bagmati' }, { budgetMs: 20 });
|
||||
assert.equal(second.ok, true);
|
||||
assert.equal(second.cached, true);
|
||||
});
|
||||
|
||||
test('a cancelled caller returns at once without cancelling the shared lookup', async () => {
|
||||
const { resolver } = makeResolver();
|
||||
const controller = new AbortController();
|
||||
controller.abort();
|
||||
const result = await resolver.resolve(
|
||||
{ query: 'Bagmati' },
|
||||
{ signal: controller.signal },
|
||||
);
|
||||
assert.equal(result.code, 'CANCELLED');
|
||||
await new Promise((r) => setTimeout(r, 5));
|
||||
const again = await resolver.resolve({ query: 'Bagmati' });
|
||||
assert.equal(again.ok, true);
|
||||
});
|
||||
|
||||
test('distinct area lookups are hard-bounded while same-key callers still coalesce', async () => {
|
||||
let release;
|
||||
const gate = new Promise((resolve) => {
|
||||
release = resolve;
|
||||
});
|
||||
let calls = 0;
|
||||
const { resolver } = makeResolver({
|
||||
maxInFlight: 1,
|
||||
resolveNamedOutline: async (query) => {
|
||||
calls += 1;
|
||||
await gate;
|
||||
return { ...BAGMATI, name: query };
|
||||
},
|
||||
});
|
||||
const first = resolver.resolve({ query: 'First Area' });
|
||||
const joined = resolver.resolve({ query: 'First Area' });
|
||||
const refused = await resolver.resolve({ query: 'Second Area' });
|
||||
assert.equal(refused.code, 'AREA_BUSY');
|
||||
release();
|
||||
const [a, b] = await Promise.all([first, joined]);
|
||||
assert.equal(calls, 1, 'the same key shares the one live provider lookup');
|
||||
assert.equal(a.ok, true);
|
||||
assert.equal(b.ok, true);
|
||||
});
|
||||
|
||||
test("settled lookups leave no listener on the caller's signal", async () => {
|
||||
const { resolver } = makeResolver();
|
||||
const controller = new AbortController();
|
||||
let added = 0;
|
||||
let removed = 0;
|
||||
const add = controller.signal.addEventListener.bind(controller.signal);
|
||||
const remove = controller.signal.removeEventListener.bind(controller.signal);
|
||||
controller.signal.addEventListener = (...args) => {
|
||||
if (args[0] === 'abort') added += 1;
|
||||
return add(...args);
|
||||
};
|
||||
controller.signal.removeEventListener = (...args) => {
|
||||
if (args[0] === 'abort') removed += 1;
|
||||
return remove(...args);
|
||||
};
|
||||
for (const query of ['Texas', 'Bagmati', 'Nowhere at all'])
|
||||
await resolver.resolve({ query }, { signal: controller.signal });
|
||||
assert.ok(added > 0, 'the lookups listened while running');
|
||||
assert.equal(removed, added, 'every listener is detached once settled');
|
||||
|
||||
const aborted = AbortSignal.abort();
|
||||
let attached = 0;
|
||||
aborted.addEventListener = () => {
|
||||
attached += 1;
|
||||
};
|
||||
const late = await resolver.resolve(
|
||||
{ query: 'Punjab, Pakistan' },
|
||||
{ signal: aborted },
|
||||
);
|
||||
assert.equal(late.code, 'CANCELLED');
|
||||
assert.equal(attached, 0, 'an aborted signal gets no listener');
|
||||
});
|
||||
|
||||
test('resolver disposal aborts provider lifetime and prevents late store/cache writes', async () => {
|
||||
let release;
|
||||
let providerSignal;
|
||||
const gate = new Promise((resolve) => {
|
||||
release = resolve;
|
||||
});
|
||||
const { resolver, store } = makeResolver({
|
||||
resolveNamedOutline: async (_query, { signal }) => {
|
||||
providerSignal = signal;
|
||||
await gate; // Deliberately ignores abort until it returns.
|
||||
return BAGMATI;
|
||||
},
|
||||
});
|
||||
const pending = resolver.resolve({ query: 'Late Area' });
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
resolver.dispose();
|
||||
assert.equal(providerSignal.aborted, true);
|
||||
release();
|
||||
const result = await pending;
|
||||
assert.equal(result.ok, false);
|
||||
assert.equal(store.size, 0, 'late provider data never reaches the store');
|
||||
const after = await resolver.resolve({ query: 'Late Area' });
|
||||
assert.equal(after.code, 'CANCELLED');
|
||||
});
|
||||
|
||||
test('level words map to area levels', () => {
|
||||
assert.deepEqual(splitLevelWord('Bagmati Province'), {
|
||||
bare: 'bagmati',
|
||||
level: 'admin1',
|
||||
});
|
||||
assert.deepEqual(splitLevelWord('Kathmandu'), {
|
||||
bare: 'kathmandu',
|
||||
level: null,
|
||||
});
|
||||
});
|
||||
|
||||
test('non-Latin names are distinct keys: 東京 then 大阪 looks up both', async () => {
|
||||
const asked = [];
|
||||
const { resolver } = makeResolver({
|
||||
resolveNamedOutline: async (q) => {
|
||||
asked.push(q);
|
||||
return { ...BAGMATI, name: q };
|
||||
},
|
||||
});
|
||||
const first = await resolver.resolve({ query: '東京' });
|
||||
const second = await resolver.resolve({ query: '大阪' });
|
||||
assert.notEqual(first.record.areaId, second.record.areaId);
|
||||
assert.equal(second.cached, false, 'not the cached Tokyo');
|
||||
assert.deepEqual(asked, ['東京', '大阪']);
|
||||
// The same name with a different `within` is a different question.
|
||||
await resolver.resolve({ query: '東京', within: '日本' });
|
||||
assert.equal(asked.length, 3);
|
||||
assert.equal((await resolver.resolve({ query: '東京' })).cached, true);
|
||||
});
|
||||
|
||||
test('a name that normalizes to nothing is never cached or shared', async () => {
|
||||
let calls = 0;
|
||||
const { resolver } = makeResolver({
|
||||
resolveNamedOutline: async () => {
|
||||
calls += 1;
|
||||
return BAGMATI;
|
||||
},
|
||||
});
|
||||
await resolver.resolve({ query: '!!!' });
|
||||
await resolver.resolve({ query: '???' });
|
||||
assert.equal(calls, 2, 'two punctuation-only asks are two lookups');
|
||||
});
|
||||
|
||||
test('a natural region never hides a country or state of the same name', async () => {
|
||||
const desert = {
|
||||
name: 'Punjab',
|
||||
kind: 'natural',
|
||||
polygons: [square(70, 28, 76, 33)],
|
||||
};
|
||||
const { resolver } = makeResolver({
|
||||
findNaturalRegion: async (q) => (/^punjab$/i.test(q) ? desert : null),
|
||||
});
|
||||
const bare = await resolver.resolve({ query: 'Punjab' });
|
||||
assert.equal(bare.ok, false);
|
||||
assert.equal(bare.code, 'AMBIGUOUS_AREA', 'the two states are asked about');
|
||||
const natural = await resolver.resolve({ query: 'Punjab', level: 'natural' });
|
||||
assert.equal(natural.ok, true);
|
||||
assert.equal(natural.record.level, 'natural', 'asked for, the region wins');
|
||||
});
|
||||
|
||||
test('same-named states in one country get their own candidate and area', async () => {
|
||||
const wa = admin(
|
||||
'state',
|
||||
'Washington',
|
||||
'United States of America',
|
||||
[-124, 45.5, -117, 49],
|
||||
{ regionCode: 'WA' },
|
||||
);
|
||||
const dc = admin(
|
||||
'state',
|
||||
'Washington',
|
||||
'United States of America',
|
||||
[-77.2, 38.8, -76.9, 39],
|
||||
{ regionCode: 'DC' },
|
||||
);
|
||||
const { resolver } = makeResolver({
|
||||
findAdminCandidates: async (q) => (/^washington$/i.test(q) ? [wa, dc] : []),
|
||||
});
|
||||
const asked = await resolver.resolve({ query: 'Washington' });
|
||||
assert.equal(asked.code, 'AMBIGUOUS_AREA');
|
||||
const ids = asked.candidates.map((c) => c.candidateId);
|
||||
assert.equal(new Set(ids).size, 2, `distinct ids: ${ids.join(', ')}`);
|
||||
assert.deepEqual(
|
||||
asked.candidates.map((c) => c.region),
|
||||
['WA', 'DC'],
|
||||
'the choices can be told apart',
|
||||
);
|
||||
const picked = await Promise.all(
|
||||
ids.map((candidateId) => resolver.resolve({ candidateId })),
|
||||
);
|
||||
assert.ok(picked.every((p) => p.ok));
|
||||
assert.notEqual(
|
||||
picked[0].record.areaId,
|
||||
picked[1].record.areaId,
|
||||
'two areas, not one overwritten',
|
||||
);
|
||||
assert.equal(
|
||||
pointInPreparedArea(picked[0].record.prepared, 47, -120),
|
||||
true,
|
||||
'Washington State',
|
||||
);
|
||||
assert.equal(
|
||||
pointInPreparedArea(picked[1].record.prepared, 38.9, -77),
|
||||
true,
|
||||
'District of Columbia',
|
||||
);
|
||||
});
|
||||
|
||||
test('a bundled name mismatch falls through to the outline ladder', async () => {
|
||||
const azad = admin('state', 'Azad Kashmir', 'Pakistan', [73, 33, 75, 35.5]);
|
||||
const kashmir = {
|
||||
ok: true,
|
||||
name: 'Kashmir',
|
||||
polygons: [[square(73, 32, 80, 37)]],
|
||||
source: 'osm',
|
||||
rung: 'nominatim',
|
||||
};
|
||||
let outlineOk = true;
|
||||
const { resolver } = makeResolver({
|
||||
findAdminCandidates: async (q) => (/^kashmir$/i.test(q) ? [azad] : []),
|
||||
resolveNamedOutline: async () =>
|
||||
outlineOk
|
||||
? kashmir
|
||||
: { ok: false, code: 'AREA_NOT_FOUND', error: 'none' },
|
||||
});
|
||||
const found = await resolver.resolve({ query: 'Kashmir' });
|
||||
assert.equal(found.ok, true, found.error);
|
||||
assert.equal(found.record.name, 'Kashmir');
|
||||
outlineOk = false;
|
||||
const { resolver: offline } = makeResolver({
|
||||
findAdminCandidates: async () => [azad],
|
||||
resolveNamedOutline: async () => ({
|
||||
ok: false,
|
||||
code: 'AREA_NOT_FOUND',
|
||||
error: 'none',
|
||||
}),
|
||||
});
|
||||
const refused = await offline.resolve({ query: 'Kashmir' });
|
||||
assert.equal(
|
||||
refused.code,
|
||||
'AREA_IDENTITY_MISMATCH',
|
||||
'the bundled refusal is kept',
|
||||
);
|
||||
});
|
||||
|
||||
test('a view-picked outline answer is not reused for the same name elsewhere', async () => {
|
||||
let view = { lat: 39.8, lon: -89.6 }; // Springfield, Illinois
|
||||
const springfield = (center) => ({
|
||||
ok: true,
|
||||
name:
|
||||
center.lon < -80 ? 'Springfield, Illinois' : 'Springfield, Massachusetts',
|
||||
polygons: [
|
||||
[
|
||||
square(
|
||||
center.lon - 0.1,
|
||||
center.lat - 0.1,
|
||||
center.lon + 0.1,
|
||||
center.lat + 0.1,
|
||||
),
|
||||
],
|
||||
],
|
||||
source: 'osm',
|
||||
rung: 'nominatim',
|
||||
});
|
||||
const { resolver } = makeResolver({
|
||||
viewCenter: () => view,
|
||||
resolveNamedOutline: async () => springfield(view),
|
||||
});
|
||||
const illinois = await resolver.resolve({ query: 'Springfield' });
|
||||
assert.equal(illinois.record.name, 'Springfield, Illinois');
|
||||
const again = await resolver.resolve({ query: 'Springfield' });
|
||||
assert.equal(again.cached, true, 'the same view still reuses it');
|
||||
view = { lat: 42.1, lon: -72.6 }; // Springfield, Massachusetts
|
||||
const massachusetts = await resolver.resolve({ query: 'Springfield' });
|
||||
assert.equal(massachusetts.cached, false);
|
||||
assert.equal(massachusetts.record.name, 'Springfield, Massachusetts');
|
||||
});
|
||||
|
||||
test('a name spoken without accents matches its accented unit, Latin letters only', async () => {
|
||||
const quebec = admin('state', 'Québec', 'Canada', [-79.8, 45, -57.1, 62.6]);
|
||||
const cordobaAr = admin(
|
||||
'state',
|
||||
'Córdoba',
|
||||
'Argentina',
|
||||
[-65.8, -35, -61.8, -29.5],
|
||||
);
|
||||
const cordobaEs = admin('state', 'Córdoba', 'Spain', [-5.6, 37.2, -4, 38.7]);
|
||||
const thai = admin('state', 'ป่าย', 'Thailand', [98, 19, 99, 20]);
|
||||
const { resolver } = makeResolver({
|
||||
findAdminCandidates: async (q) =>
|
||||
/^quebec$/i.test(q)
|
||||
? [quebec]
|
||||
: /^cordoba$/i.test(q)
|
||||
? [cordobaAr, cordobaEs]
|
||||
: q === 'ปาย'
|
||||
? [thai]
|
||||
: [],
|
||||
});
|
||||
const qc = await resolver.resolve({ query: 'Quebec' });
|
||||
assert.equal(qc.ok, true, qc.error);
|
||||
assert.equal(qc.record.name, 'Québec');
|
||||
const cordoba = await resolver.resolve({ query: 'Cordoba' });
|
||||
assert.equal(cordoba.code, 'AMBIGUOUS_AREA', 'both Córdobas are asked about');
|
||||
assert.equal(cordoba.candidates.length, 2);
|
||||
const tone = await resolver.resolve({ query: 'ปาย' });
|
||||
assert.equal(tone.ok, false, 'a Thai tone mark still tells names apart');
|
||||
});
|
||||
|
||||
test('a natural name for two distant places is asked about, and the choice resolves', async () => {
|
||||
const azores = {
|
||||
name: 'Flores',
|
||||
featurecla: 'Island',
|
||||
polygons: [square(-31.3, 39.4, -31.1, 39.5)],
|
||||
areaKm2: 140,
|
||||
center: { lat: 39.45, lon: -31.2 },
|
||||
};
|
||||
const indonesia = {
|
||||
name: 'Flores',
|
||||
featurecla: 'Island',
|
||||
polygons: [square(119.8, -8.9, 123, -8.1)],
|
||||
areaKm2: 14000,
|
||||
center: { lat: -8.5, lon: 121.4 },
|
||||
};
|
||||
const { resolver } = makeResolver({
|
||||
findNaturalRegion: async (q) =>
|
||||
/^flores$/i.test(q)
|
||||
? {
|
||||
name: 'Flores',
|
||||
kind: 'natural',
|
||||
polygons: indonesia.polygons,
|
||||
places: [indonesia, azores],
|
||||
}
|
||||
: null,
|
||||
});
|
||||
const asked = await resolver.resolve({ query: 'Flores' });
|
||||
assert.equal(asked.code, 'AMBIGUOUS_AREA');
|
||||
assert.equal(asked.candidates.length, 2);
|
||||
assert.ok(asked.candidates.every((c) => c.level === 'natural' && c.region));
|
||||
const picked = await resolver.resolve({
|
||||
candidateId: asked.candidates[1].candidateId,
|
||||
});
|
||||
assert.equal(picked.ok, true, picked.error);
|
||||
assert.equal(picked.record.level, 'natural');
|
||||
assert.equal(
|
||||
pointInPreparedArea(picked.record.prepared, 39.45, -31.2),
|
||||
true,
|
||||
'the Azores Flores',
|
||||
);
|
||||
});
|
||||
|
||||
test('a natural feature in several parts is stored whole', async () => {
|
||||
const north = square(33.7, 2.4, 44.2, 15.4);
|
||||
const south = square(28.9, -15.6, 35.8, 2.4);
|
||||
const { resolver } = makeResolver({
|
||||
findNaturalRegion: async (q) =>
|
||||
/rift/i.test(q)
|
||||
? {
|
||||
name: 'Great Rift Valley',
|
||||
kind: 'natural',
|
||||
polygons: [north],
|
||||
places: [
|
||||
{
|
||||
name: 'Great Rift Valley',
|
||||
featurecla: 'Valley',
|
||||
polygons: [north, south],
|
||||
areaKm2: 2,
|
||||
center: { lat: 0, lon: 36 },
|
||||
},
|
||||
],
|
||||
}
|
||||
: null,
|
||||
});
|
||||
const rift = await resolver.resolve({ query: 'Great Rift Valley' });
|
||||
assert.equal(rift.ok, true);
|
||||
assert.equal(
|
||||
pointInPreparedArea(rift.record.prepared, -10, 33),
|
||||
true,
|
||||
'the southern part counts',
|
||||
);
|
||||
});
|
||||
@@ -0,0 +1,212 @@
|
||||
/**
|
||||
* Session-scoped store of area handles. A voice turn refers to an area by its
|
||||
* `areaId`; the geometry itself stays here and never goes to the model.
|
||||
*
|
||||
* Records are immutable once stored. A source with a stable identity (an OSM
|
||||
* relation, a Natural Earth region, an annotation) keeps the same id when it
|
||||
* is stored again, so repeating "outline Bagmati" does not mint new handles.
|
||||
* Least recently used records are evicted past `maxEntries`, except those
|
||||
* `isPinned` reports as still in use.
|
||||
*
|
||||
* Pure: no Cesium, DOM or network.
|
||||
* @module data/areaStore
|
||||
*/
|
||||
|
||||
import {
|
||||
multiPolygonAreaKm2,
|
||||
multiPolygonCounts,
|
||||
normalizeMultiPolygon,
|
||||
prepareArea,
|
||||
} from './areaGeometry.js';
|
||||
|
||||
/** Where an area came from, as the model and the panel name it. */
|
||||
export const AREA_SOURCES = Object.freeze([
|
||||
'natural-earth',
|
||||
'us-census',
|
||||
'wof',
|
||||
'datasf',
|
||||
'osm',
|
||||
'openfreemap',
|
||||
'annotation',
|
||||
'drawn',
|
||||
'approximate',
|
||||
]);
|
||||
|
||||
/** Levels a resolved area can have. */
|
||||
export const AREA_LEVELS = Object.freeze([
|
||||
'country',
|
||||
'admin1',
|
||||
'admin2',
|
||||
'city',
|
||||
'district',
|
||||
'natural',
|
||||
'site',
|
||||
'drawn',
|
||||
]);
|
||||
|
||||
const round = (value, digits) => {
|
||||
const f = 10 ** digits;
|
||||
return Math.round(value * f) / f;
|
||||
};
|
||||
|
||||
/**
|
||||
* Create an area store.
|
||||
* @param {{maxEntries?: number, maxQueryEntries?: number, now?: () => number, isPinned?: (areaId: string) => boolean}} [options]
|
||||
*/
|
||||
export function createAreaStore({
|
||||
maxEntries = 32,
|
||||
maxQueryEntries = Math.max(32, maxEntries * 8),
|
||||
now = () => Date.now(),
|
||||
isPinned = () => false,
|
||||
} = {}) {
|
||||
/** Insertion order doubles as recency: get() re-inserts. */
|
||||
const records = new Map();
|
||||
/** query key → areaId, for cached resolutions. */
|
||||
const queries = new Map();
|
||||
let seq = 0;
|
||||
|
||||
function forgetRecordQueries(areaId) {
|
||||
for (const [key, queried] of queries)
|
||||
if (queried === areaId) queries.delete(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Drop least recently used records past the bound, skipping pinned ones
|
||||
* (an area an outline on the map still refers to keeps its geometry for as
|
||||
* long as the outline exists; the annotation cap bounds how many that is).
|
||||
*/
|
||||
function evict(keep) {
|
||||
if (records.size <= maxEntries) return;
|
||||
for (const id of [...records.keys()]) {
|
||||
if (records.size <= maxEntries) break;
|
||||
// The record just stored is always kept; pinned ones may exceed the bound.
|
||||
if (id === keep || isPinned(id)) continue;
|
||||
records.delete(id);
|
||||
forgetRecordQueries(id);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Store an area. Returns the stored record, or null when the geometry is
|
||||
* unusable.
|
||||
* @param {object} input
|
||||
* @param {object|Array} input.geometry GeoJSON Polygon/MultiPolygon or coordinates.
|
||||
* @param {string} input.name
|
||||
* @param {string} input.source One of AREA_SOURCES.
|
||||
* @param {string} [input.sourceId] Stable identity, e.g. `ne:state:india-punjab`.
|
||||
* @param {string} [input.level]
|
||||
* @param {boolean} [input.approximate]
|
||||
* @param {object} [input.meta] Extra facts (country, license, completeness).
|
||||
* @returns {object|null}
|
||||
*/
|
||||
function put(input) {
|
||||
const geometry = normalizeMultiPolygon(input?.geometry);
|
||||
if (!geometry) return null;
|
||||
const prepared = prepareArea(geometry);
|
||||
if (!prepared) return null;
|
||||
const areaId = input.sourceId
|
||||
? String(input.sourceId)
|
||||
: `area-${(seq += 1)}`;
|
||||
const counts = multiPolygonCounts(geometry);
|
||||
const record = Object.freeze({
|
||||
areaId,
|
||||
name: String(input.name || 'Unnamed area').slice(0, 160),
|
||||
level: AREA_LEVELS.includes(input.level) ? input.level : null,
|
||||
source: AREA_SOURCES.includes(input.source)
|
||||
? input.source
|
||||
: 'approximate',
|
||||
approximate: Boolean(input.approximate),
|
||||
geometry,
|
||||
prepared,
|
||||
bbox: prepared.bbox,
|
||||
areaKm2: multiPolygonAreaKm2(geometry),
|
||||
parts: counts.parts,
|
||||
holes: counts.holes,
|
||||
meta: Object.freeze({ ...(input.meta || {}) }),
|
||||
storedAt: now(),
|
||||
});
|
||||
records.delete(areaId);
|
||||
records.set(areaId, record);
|
||||
evict(areaId);
|
||||
return record;
|
||||
}
|
||||
|
||||
/** The record for an id, marking it recently used; null when unknown or evicted. */
|
||||
function get(areaId) {
|
||||
const record = records.get(String(areaId ?? ''));
|
||||
if (!record) return null;
|
||||
records.delete(record.areaId);
|
||||
records.set(record.areaId, record);
|
||||
return record;
|
||||
}
|
||||
|
||||
return {
|
||||
put,
|
||||
get,
|
||||
has: (areaId) => records.has(String(areaId ?? '')),
|
||||
/** Remember which area a query resolved to. */
|
||||
rememberQuery(key, areaId) {
|
||||
if (!key || !records.has(areaId)) return;
|
||||
queries.delete(key);
|
||||
queries.set(key, areaId);
|
||||
while (queries.size > maxQueryEntries)
|
||||
queries.delete(queries.keys().next().value);
|
||||
},
|
||||
/** The area a query resolved to earlier, if still stored. */
|
||||
recallQuery(key) {
|
||||
const id = queries.get(key);
|
||||
const record = id ? get(id) : null;
|
||||
if (!record) {
|
||||
queries.delete(key);
|
||||
return null;
|
||||
}
|
||||
queries.delete(key);
|
||||
queries.set(key, id);
|
||||
return record;
|
||||
},
|
||||
/** Newest first. */
|
||||
list: () => [...records.values()].reverse(),
|
||||
/** The most recently stored or used record matching `predicate`. */
|
||||
latest(predicate = () => true) {
|
||||
return [...records.values()].reverse().find(predicate) || null;
|
||||
},
|
||||
delete(areaId) {
|
||||
const id = String(areaId ?? '');
|
||||
const deleted = records.delete(id);
|
||||
if (deleted) forgetRecordQueries(id);
|
||||
return deleted;
|
||||
},
|
||||
clear() {
|
||||
records.clear();
|
||||
queries.clear();
|
||||
},
|
||||
get size() {
|
||||
return records.size;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The model-facing summary of an area: identity, size and provenance, never
|
||||
* coordinates beyond a rounded bbox.
|
||||
* @param {object} record
|
||||
* @returns {object}
|
||||
*/
|
||||
export function summarizeArea(record) {
|
||||
if (!record) return null;
|
||||
return {
|
||||
areaId: record.areaId,
|
||||
name: record.name,
|
||||
level: record.level,
|
||||
source: record.source,
|
||||
...(record.meta.country ? { country: record.meta.country } : {}),
|
||||
bbox: record.bbox.map((v) => round(v, 3)),
|
||||
areaKm2:
|
||||
record.areaKm2 >= 100
|
||||
? Math.round(record.areaKm2)
|
||||
: round(record.areaKm2, 2),
|
||||
parts: record.parts,
|
||||
holes: record.holes,
|
||||
...(record.approximate ? { approximate: true } : {}),
|
||||
};
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import * as Cesium from 'cesium';
|
||||
import { t, msg } from '../i18n/index.js';
|
||||
import { t, msg, onLocaleChange } from '../i18n/index.js';
|
||||
|
||||
const YOUTUBE_HOSTS = new Set([
|
||||
'youtube.com',
|
||||
@@ -569,7 +569,8 @@ function anchorOnScreen(viewer, anchor, root) {
|
||||
return { x, y, width: rootBounds.width, height: rootBounds.height };
|
||||
}
|
||||
|
||||
function placeCard(card, leader, anchor) {
|
||||
/** Place a media card beside its map anchor, in the lane between the panels. */
|
||||
export function placeCard(card, leader, anchor) {
|
||||
const margin = 18;
|
||||
const gap = 42;
|
||||
const width = card.offsetWidth || 392;
|
||||
@@ -580,22 +581,22 @@ function placeCard(card, leader, anchor) {
|
||||
let laneRight = anchor.width - margin;
|
||||
let laneBottom = anchor.height - margin;
|
||||
if (rootBounds && documentRef?.querySelector) {
|
||||
const leftPanel = documentRef
|
||||
.querySelector('#scene-panel')
|
||||
?.getBoundingClientRect?.();
|
||||
const rightRail = documentRef
|
||||
.querySelector('#right-context-rail')
|
||||
?.getBoundingClientRect?.();
|
||||
const commandDock = documentRef
|
||||
.querySelector('#command-dock')
|
||||
?.getBoundingClientRect?.();
|
||||
if (leftPanel?.width > 0)
|
||||
laneLeft = Math.max(laneLeft, leftPanel.right - rootBounds.left + margin);
|
||||
if (rightRail?.width > 0)
|
||||
laneRight = Math.min(
|
||||
laneRight,
|
||||
rightRail.left - rootBounds.left - margin,
|
||||
);
|
||||
// The scene panel and the context rail swap sides in right-to-left
|
||||
// languages: each narrows the lane from the side it sits on.
|
||||
for (const selector of ['#scene-panel', '#right-context-rail']) {
|
||||
const panel = documentRef
|
||||
.querySelector(selector)
|
||||
?.getBoundingClientRect?.();
|
||||
if (!(panel?.width > 0)) continue;
|
||||
const start = panel.left - rootBounds.left;
|
||||
const end = panel.right - rootBounds.left;
|
||||
if (start + end < rootBounds.width)
|
||||
laneLeft = Math.max(laneLeft, end + margin);
|
||||
else laneRight = Math.min(laneRight, start - margin);
|
||||
}
|
||||
if (commandDock?.height > 0)
|
||||
laneBottom = Math.min(
|
||||
laneBottom,
|
||||
@@ -674,6 +675,30 @@ export function createBhoteKoshiEmbeddedMedia({
|
||||
let record = null;
|
||||
let warmRecord = null;
|
||||
let generation = 0;
|
||||
// Text the cards show, kept as the calls that word it so a locale change
|
||||
// words it again. A node is forgotten once it has left the page.
|
||||
const worded = new Map();
|
||||
function forgetDetached() {
|
||||
for (const node of worded.keys())
|
||||
if (!node.isConnected) worded.delete(node);
|
||||
}
|
||||
function word(node, property, text) {
|
||||
let properties = worded.get(node);
|
||||
if (!properties) worded.set(node, (properties = new Map()));
|
||||
properties.set(property, text);
|
||||
writeWord(node, property, text());
|
||||
}
|
||||
function writeWord(node, property, value) {
|
||||
if (property === 'textContent' || property === 'title')
|
||||
node[property] = value;
|
||||
else node.setAttribute(property, value);
|
||||
}
|
||||
const offLocale = onLocaleChange(() => {
|
||||
forgetDetached();
|
||||
for (const [node, properties] of worded)
|
||||
for (const [property, text] of properties)
|
||||
writeWord(node, property, text());
|
||||
});
|
||||
const leavingRecords = new Set();
|
||||
|
||||
const prefersReducedMotion = () =>
|
||||
@@ -818,6 +843,7 @@ export function createBhoteKoshiEmbeddedMedia({
|
||||
current.youtubeSession?.destroy();
|
||||
current.card?.remove?.();
|
||||
leavingRecords.delete(current);
|
||||
forgetDetached();
|
||||
}
|
||||
|
||||
const position = () => {
|
||||
@@ -871,6 +897,7 @@ export function createBhoteKoshiEmbeddedMedia({
|
||||
destroyFacebookSession(warmRecord.facebookSession);
|
||||
else warmRecord.iframe?.remove?.();
|
||||
warmRecord = null;
|
||||
forgetDetached();
|
||||
}
|
||||
|
||||
function takeWarmFacebook(key, host) {
|
||||
@@ -917,9 +944,11 @@ export function createBhoteKoshiEmbeddedMedia({
|
||||
startAtSec,
|
||||
endAtSec,
|
||||
});
|
||||
iframe.title = t('Preloading {provider} media', {
|
||||
provider: providerLabel(source.provider),
|
||||
});
|
||||
word(iframe, 'title', () =>
|
||||
t('Preloading {provider} media', {
|
||||
provider: providerLabel(source.provider),
|
||||
}),
|
||||
);
|
||||
iframe.tabIndex = -1;
|
||||
iframe.setAttribute('aria-hidden', 'true');
|
||||
iframe.loading = 'eager';
|
||||
@@ -930,7 +959,7 @@ export function createBhoteKoshiEmbeddedMedia({
|
||||
}
|
||||
|
||||
async function mountX(current, token) {
|
||||
current.status.textContent = t('LOADING X POST…');
|
||||
word(current.status, 'textContent', () => t('LOADING X POST…'));
|
||||
try {
|
||||
const api = await xLoader(documentRef, globalRef);
|
||||
if (token !== generation || record !== current) return;
|
||||
@@ -950,14 +979,18 @@ export function createBhoteKoshiEmbeddedMedia({
|
||||
throw new Error(
|
||||
msg('The X post is unavailable or cannot be embedded.'),
|
||||
);
|
||||
current.status.textContent = t('X POST · PROVIDER CONTROLS');
|
||||
word(current.status, 'textContent', () =>
|
||||
t('X POST · PROVIDER CONTROLS'),
|
||||
);
|
||||
position();
|
||||
} catch (error) {
|
||||
if (token !== generation || record !== current) return;
|
||||
current.card.classList.add('is-unavailable');
|
||||
current.status.textContent = t('{reason} OPEN ORIGINAL.', {
|
||||
reason: t(String(error?.message || msg('X embed unavailable'))),
|
||||
});
|
||||
word(current.status, 'textContent', () =>
|
||||
t('{reason} OPEN ORIGINAL.', {
|
||||
reason: t(String(error?.message || msg('X embed unavailable'))),
|
||||
}),
|
||||
);
|
||||
position();
|
||||
}
|
||||
}
|
||||
@@ -970,22 +1003,28 @@ export function createBhoteKoshiEmbeddedMedia({
|
||||
session.shouldPlay = autoplay === true;
|
||||
session.onReady = () => {
|
||||
if (token !== generation || record !== current) return;
|
||||
current.status.textContent = t('FACEBOOK · PROVIDER CONTROLS');
|
||||
word(current.status, 'textContent', () =>
|
||||
t('FACEBOOK · PROVIDER CONTROLS'),
|
||||
);
|
||||
current.card.classList.remove('is-unavailable');
|
||||
position();
|
||||
};
|
||||
session.onError = (error) => {
|
||||
if (token !== generation || record !== current) return;
|
||||
current.card.classList.add('is-unavailable');
|
||||
current.status.textContent = t('{reason} OPEN ORIGINAL.', {
|
||||
reason: t(String(error?.message || msg('Facebook embed unavailable'))),
|
||||
});
|
||||
word(current.status, 'textContent', () =>
|
||||
t('{reason} OPEN ORIGINAL.', {
|
||||
reason: t(
|
||||
String(error?.message || msg('Facebook embed unavailable')),
|
||||
),
|
||||
}),
|
||||
);
|
||||
position();
|
||||
};
|
||||
session.onPlaybackBlocked = () => {
|
||||
if (token !== generation || record !== current) return;
|
||||
current.status.textContent = t(
|
||||
'AUTOPLAY BLOCKED · USE PROVIDER CONTROLS',
|
||||
word(current.status, 'textContent', () =>
|
||||
t('AUTOPLAY BLOCKED · USE PROVIDER CONTROLS'),
|
||||
);
|
||||
};
|
||||
if (session.ready) session.onReady();
|
||||
@@ -1036,8 +1075,7 @@ export function createBhoteKoshiEmbeddedMedia({
|
||||
const portraitClass = isPortraitMedia(media) ? ' is-portrait' : '';
|
||||
card.className = `bhote-embedded-callout is-${source.provider}${portraitClass}`;
|
||||
card.dataset.provider = source.provider;
|
||||
card.setAttribute(
|
||||
'aria-label',
|
||||
word(card, 'aria-label', () =>
|
||||
t('Embedded {provider} media for {source}', {
|
||||
provider: providerLabel(source.provider),
|
||||
source: observation?.title
|
||||
@@ -1054,22 +1092,26 @@ export function createBhoteKoshiEmbeddedMedia({
|
||||
leader.innerHTML =
|
||||
'<path pathLength="1" fill="none" stroke="rgba(147,213,228,.72)" stroke-width="1.5"/><circle r="4" fill="#6be8ff" stroke="#ffffff" stroke-width="1.5"/>';
|
||||
const player = documentRef.createElement('div');
|
||||
player.className = 'bhote-embedded-callout-player';
|
||||
player.className = 'bhote-embedded-callout-player ui-scroll';
|
||||
const footer = documentRef.createElement('footer');
|
||||
const title = documentRef.createElement('strong');
|
||||
title.textContent = bhoteEventText(
|
||||
observation?.shortTitle || observation?.title || t('Witness source'),
|
||||
).toUpperCase();
|
||||
word(title, 'textContent', () =>
|
||||
bhoteEventText(
|
||||
observation?.shortTitle || observation?.title || t('Witness source'),
|
||||
).toUpperCase(),
|
||||
);
|
||||
const status = documentRef.createElement('small');
|
||||
status.setAttribute('role', 'status');
|
||||
status.textContent = t('{provider} · EMBEDDED SOURCE', {
|
||||
provider: providerLabel(source.provider),
|
||||
});
|
||||
word(status, 'textContent', () =>
|
||||
t('{provider} · EMBEDDED SOURCE', {
|
||||
provider: providerLabel(source.provider),
|
||||
}),
|
||||
);
|
||||
const link = documentRef.createElement('a');
|
||||
link.href = source.url;
|
||||
link.target = '_blank';
|
||||
link.rel = 'noopener noreferrer';
|
||||
link.textContent = t('OPEN ORIGINAL ↗');
|
||||
word(link, 'textContent', () => t('OPEN ORIGINAL ↗'));
|
||||
footer.append(title, status, link);
|
||||
const body = documentRef.createElement('div');
|
||||
body.className = 'bhote-embedded-callout-body';
|
||||
@@ -1109,12 +1151,14 @@ export function createBhoteKoshiEmbeddedMedia({
|
||||
url.searchParams.set('origin', globalRef.location.origin);
|
||||
iframe.src = url.href;
|
||||
}
|
||||
iframe.title = t('{provider} media: {source}', {
|
||||
provider: providerLabel(source.provider),
|
||||
source: observation?.title
|
||||
? bhoteEventText(observation.title)
|
||||
: t('witness source'),
|
||||
});
|
||||
word(iframe, 'title', () =>
|
||||
t('{provider} media: {source}', {
|
||||
provider: providerLabel(source.provider),
|
||||
source: observation?.title
|
||||
? bhoteEventText(observation.title)
|
||||
: t('witness source'),
|
||||
}),
|
||||
);
|
||||
iframe.allow =
|
||||
'autoplay; encrypted-media; picture-in-picture; fullscreen';
|
||||
iframe.allowFullscreen = true;
|
||||
@@ -1131,9 +1175,11 @@ export function createBhoteKoshiEmbeddedMedia({
|
||||
record.youtubeSession.getState().phase,
|
||||
)
|
||||
) {
|
||||
status.textContent = t('{provider} · PROVIDER CONTROLS', {
|
||||
provider: providerLabel(source.provider),
|
||||
});
|
||||
word(status, 'textContent', () =>
|
||||
t('{provider} · PROVIDER CONTROLS', {
|
||||
provider: providerLabel(source.provider),
|
||||
}),
|
||||
);
|
||||
}
|
||||
position();
|
||||
},
|
||||
@@ -1151,11 +1197,13 @@ export function createBhoteKoshiEmbeddedMedia({
|
||||
isCurrent: () => token === generation && record === current,
|
||||
onStatus: (phase) => {
|
||||
if (phase !== 'completed')
|
||||
status.textContent = t('YOUTUBE {state} · OPEN ORIGINAL', {
|
||||
state: YOUTUBE_PHASE_LABELS[phase]
|
||||
? t(YOUTUBE_PHASE_LABELS[phase])
|
||||
: phase.toUpperCase(),
|
||||
});
|
||||
word(status, 'textContent', () =>
|
||||
t('YOUTUBE {state} · OPEN ORIGINAL', {
|
||||
state: YOUTUBE_PHASE_LABELS[phase]
|
||||
? t(YOUTUBE_PHASE_LABELS[phase])
|
||||
: phase.toUpperCase(),
|
||||
}),
|
||||
);
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -1165,6 +1213,8 @@ export function createBhoteKoshiEmbeddedMedia({
|
||||
}
|
||||
|
||||
function destroy() {
|
||||
offLocale();
|
||||
worded.clear();
|
||||
hide({ immediate: true });
|
||||
for (const current of [...leavingRecords]) removeRecord(current);
|
||||
clearWarm();
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
createBhoteKoshiEmbeddedMedia,
|
||||
createTrimmedYouTubePlayback,
|
||||
embeddedMediaFrameUrl,
|
||||
placeCard,
|
||||
publicEmbeddedMediaUrl,
|
||||
resolveEmbeddedMediaSource,
|
||||
} from './bhoteKoshiEmbeddedMedia.js';
|
||||
@@ -348,7 +349,7 @@ test('camera updates retain a preload until the visible player loads', () => {
|
||||
assert.equal(frame.parent, root, 'keep the preload while the visible player starts');
|
||||
const card = root.children.find(node => node.tag === 'section');
|
||||
const body = card.children.find(node => node.className === 'bhote-embedded-callout-body');
|
||||
const player = body.children.find(node => node.className === 'bhote-embedded-callout-player');
|
||||
const player = body.children.find(node => node.className.split(' ').includes('bhote-embedded-callout-player'));
|
||||
player.children.find(node => node.tag === 'iframe').dispatchEvent(new Event('load'));
|
||||
assert.equal(frame.parent, null, 'visible player readiness releases the preload');
|
||||
media.destroy();
|
||||
@@ -394,3 +395,25 @@ test('pausing cancels a mounted Facebook preload and rejects its late ready call
|
||||
assert.deepEqual(playerCalls, []);
|
||||
media.destroy();
|
||||
});
|
||||
|
||||
test('a media card stays between the panels when right-to-left swaps their sides', () => {
|
||||
const rect = (left, right, top = 0, bottom = 900) => ({ left, right, top, bottom, width: right - left, height: bottom - top });
|
||||
// Arabic: the scene panel sits on the right, the context rail on the left.
|
||||
const panels = {
|
||||
'#scene-panel': rect(1040, 1420),
|
||||
'#right-context-rail': rect(20, 340),
|
||||
'#command-dock': rect(500, 940, 820, 880),
|
||||
};
|
||||
const card = {
|
||||
offsetWidth: 392,
|
||||
offsetHeight: 360,
|
||||
parentElement: { getBoundingClientRect: () => rect(0, 1440) },
|
||||
ownerDocument: { querySelector: (selector) => ({ getBoundingClientRect: () => panels[selector] }) },
|
||||
classList: { contains: () => false },
|
||||
style: {},
|
||||
};
|
||||
placeCard(card, { querySelector: () => null }, { x: 700, y: 400, width: 1440, height: 900 });
|
||||
const left = parseFloat(card.style.left);
|
||||
assert.ok(left >= 340 + 18, `card at ${left}px lands on the context rail`);
|
||||
assert.ok(left + 392 <= 1040 - 18, `card at ${left}px lands on the scene panel`);
|
||||
});
|
||||
+158
-201
@@ -25,7 +25,9 @@ import {
|
||||
} from './bhoteKoshiEmbeddedMedia.js';
|
||||
import { acquireImageryComparison } from '../maps/imageryComparison.js';
|
||||
import { createImagerySplit } from '../ui/imagerySplit.js';
|
||||
import { formatDate, t, tn, msg } from '../i18n/index.js';
|
||||
import { formatDate, t, tn, msg, onLocaleChange } from '../i18n/index.js';
|
||||
import { useBhoteKoshiPanelStore } from '../ui/stores/bhoteKoshiPanel.js';
|
||||
import { applicationPinia } from '../ui/vueRuntime.js';
|
||||
|
||||
export const BHOTE_KOSHI_LAYER_ID = 'bhote-koshi-2026';
|
||||
export const BHOTE_KOSHI_OVERLAY_SOURCE_ID = 'bhote-koshi-witnesses';
|
||||
@@ -449,18 +451,6 @@ function imageryEndpointText(entry) {
|
||||
return [name, date].filter(Boolean).join(' · ');
|
||||
}
|
||||
|
||||
/** Name, then the date kept on one line so the year never wraps alone. */
|
||||
function renderImageryEndpoint(element, entry) {
|
||||
if (!element) return;
|
||||
const { name, date } = imageryEndpointLabel(entry);
|
||||
element.textContent = date ? `${name} · ` : name;
|
||||
if (!date) return;
|
||||
const dateElement = document.createElement('span');
|
||||
dateElement.className = 'bhote-event-date';
|
||||
dateElement.textContent = date;
|
||||
element.appendChild(dateElement);
|
||||
}
|
||||
|
||||
/** Compact, source-bounded disclosure for multi-source geolocation beats. */
|
||||
export function evidenceCorroborationLabel(observation) {
|
||||
const count = Math.max(
|
||||
@@ -929,185 +919,70 @@ function setElementProperty(element, property, value) {
|
||||
}
|
||||
|
||||
function setElementAttribute(element, attribute, value) {
|
||||
if (!element || element.getAttribute?.(attribute) === value) return false;
|
||||
element.setAttribute(attribute, value);
|
||||
if (!element || element.attributes[attribute] === value) return false;
|
||||
element.attributes[attribute] = value;
|
||||
return true;
|
||||
}
|
||||
|
||||
function collectPanelReferences(panel) {
|
||||
/** One panel control's state, as the panel view renders it. */
|
||||
function panelRecord(initial = {}) {
|
||||
return {
|
||||
textContent: '',
|
||||
hidden: false,
|
||||
disabled: false,
|
||||
value: '',
|
||||
...initial,
|
||||
attributes: { ...initial.attributes },
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The panel's controls as the layer writes them, starting from the panel's
|
||||
* markup. The panel view renders what the layer publishes from them.
|
||||
*/
|
||||
function createPanelRecords(event) {
|
||||
return Object.freeze({
|
||||
imagerySection: panel.querySelector('[data-role="imagery-comparison"]'),
|
||||
observedStatus: panel.querySelector('.bhote-event-status.observed'),
|
||||
beforeDate: panel.querySelector('[data-role="before-date"]'),
|
||||
afterDate: panel.querySelector('[data-role="after-date"]'),
|
||||
time: panel.querySelector('[data-role="time"]'),
|
||||
caveat: panel.querySelector('[data-role="caveat"]'),
|
||||
imageryCloudNote: panel.querySelector('[data-role="imagery-cloud-note"]'),
|
||||
reportList: panel.querySelector('.bhote-event-report-list'),
|
||||
playButton: panel.querySelector('[data-action="play"]'),
|
||||
playSceneButton: panel.querySelector('[data-action="play-scene"]'),
|
||||
cinematicButton: panel.querySelector('[data-action="cinematic"]'),
|
||||
storyReplayButton: panel.querySelector('[data-action="story-replay"]'),
|
||||
corridorButton: panel.querySelector('[data-action="corridor"]'),
|
||||
previousButton: panel.querySelector('[data-action="previous-beat"]'),
|
||||
nextButton: panel.querySelector('[data-action="next-beat"]'),
|
||||
openSourceButton: panel.querySelector('[data-action="open-source"]'),
|
||||
progressInput: panel.querySelector('[data-role="progress"]'),
|
||||
splitInput: panel.querySelector('[data-role="split"]'),
|
||||
splitReadout: panel.querySelector('[data-role="split-readout"]'),
|
||||
timelineLabel: panel.querySelector('[data-role="timeline-label"]'),
|
||||
beatIndex: panel.querySelector('[data-role="beat-index"]'),
|
||||
beatTitle: panel.querySelector('[data-role="beat-title"]'),
|
||||
beatMeta: panel.querySelector('[data-role="beat-meta"]'),
|
||||
root: { sceneBeat: false },
|
||||
imagerySection: panelRecord(),
|
||||
observedStatus: panelRecord(),
|
||||
time: panelRecord({
|
||||
textContent: `~0:00 / ${elapsedLabel(1, event.reconstruction.elapsedSeconds)}`,
|
||||
}),
|
||||
caveat: panelRecord({
|
||||
textContent: bhoteEventText(event.reconstruction.caveat),
|
||||
}),
|
||||
imageryCloudNote: panelRecord(),
|
||||
playButton: panelRecord({ textContent: t('▶ PLAY') }),
|
||||
playSceneButton: panelRecord({
|
||||
textContent: t('▶ PLAY SCENE'),
|
||||
hidden: true,
|
||||
}),
|
||||
cinematicButton: panelRecord({
|
||||
textContent: t('◉ CINEMATIC'),
|
||||
attributes: { 'aria-pressed': 'false' },
|
||||
}),
|
||||
storyReplayButton: panelRecord({ textContent: t('↺ FULL STORY') }),
|
||||
corridorButton: panelRecord(),
|
||||
previousButton: panelRecord({
|
||||
attributes: { 'aria-label': t('Previous story beat') },
|
||||
}),
|
||||
nextButton: panelRecord({
|
||||
attributes: { 'aria-label': t('Next story beat') },
|
||||
}),
|
||||
openSourceButton: panelRecord(),
|
||||
progressInput: panelRecord({
|
||||
value: '0',
|
||||
attributes: { 'aria-label': t('Schematic downstream progression') },
|
||||
}),
|
||||
splitInput: panelRecord({ value: '50' }),
|
||||
splitReadout: panelRecord({ textContent: '50 / 50' }),
|
||||
timelineLabel: panelRecord({ textContent: t('RECONSTRUCTION CLOCK') }),
|
||||
beatIndex: panelRecord({ textContent: '01 / 06' }),
|
||||
beatTitle: panelRecord({ textContent: t('CAUSE') }),
|
||||
beatMeta: panelRecord({ textContent: t('CAPTURE TIME UNVERIFIED') }),
|
||||
});
|
||||
}
|
||||
|
||||
/** Escape translated text for the panel markup template. */
|
||||
function escapeMarkup(text) {
|
||||
return String(text)
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/"/g, '"');
|
||||
}
|
||||
|
||||
function createPanel(event, handlers) {
|
||||
const panel = document.createElement('aside');
|
||||
panel.id = 'bhote-koshi-event-panel';
|
||||
panel.setAttribute(
|
||||
'aria-label',
|
||||
t('Bhote Koshi flood reconstruction controls'),
|
||||
);
|
||||
panel.innerHTML = `
|
||||
<div class="bhote-event-header">
|
||||
<div>
|
||||
<div class="bhote-event-kicker">${escapeMarkup(t('EVENT RECONSTRUCTION · 26 AUG 2026'))}</div>
|
||||
<div class="bhote-event-title">${escapeMarkup(t('BHOTE KOSHI OUTBURST FLOOD'))}</div>
|
||||
</div>
|
||||
<button class="bhote-event-icon-btn" type="button" data-action="close" title="${escapeMarkup(t('Close event layer'))}" aria-label="${escapeMarkup(t('Close event layer'))}">×</button>
|
||||
</div>
|
||||
<div class="bhote-event-status-row">
|
||||
<span class="bhote-event-status observed">${escapeMarkup(t('OBSERVED IMAGERY'))}</span>
|
||||
<span class="bhote-event-status reconstructed">${escapeMarkup(t('SCHEMATIC CORRIDOR'))}</span>
|
||||
</div>
|
||||
<section class="bhote-event-section" data-role="imagery-comparison">
|
||||
<div class="bhote-event-section-head">
|
||||
<span>${escapeMarkup(t('2021 HISTORICAL REFERENCE / 2026 POST-EVENT'))}</span>
|
||||
<span data-role="split-readout">50 / 50</span>
|
||||
</div>
|
||||
<input class="bhote-event-range" data-role="split" type="range" min="0" max="100" value="50" aria-label="${escapeMarkup(t('Historical reference and post-event image split'))}" />
|
||||
<div class="bhote-event-dates">
|
||||
<span data-role="before-date"></span>
|
||||
<span data-role="after-date"></span>
|
||||
</div>
|
||||
</section>
|
||||
<section class="bhote-event-section">
|
||||
<div class="bhote-event-section-head">
|
||||
<span data-role="timeline-label">${escapeMarkup(t('RECONSTRUCTION CLOCK'))}</span>
|
||||
<span data-role="time"></span>
|
||||
</div>
|
||||
<input class="bhote-event-range flood" data-role="progress" type="range" min="0" max="1000" value="0" aria-label="${escapeMarkup(t('Schematic downstream progression'))}" />
|
||||
<div class="bhote-event-story-nav" aria-label="${escapeMarkup(t('Story beat navigation'))}">
|
||||
<button type="button" data-action="previous-beat" title="${escapeMarkup(t('Previous story beat'))}" aria-label="${escapeMarkup(t('Previous story beat'))}">‹</button>
|
||||
<div class="bhote-event-story-current">
|
||||
<span data-role="beat-index">01 / 06</span>
|
||||
<strong data-role="beat-title" aria-live="polite">${escapeMarkup(t('CAUSE'))}</strong>
|
||||
<small data-role="beat-meta">${escapeMarkup(t('CAPTURE TIME UNVERIFIED'))}</small>
|
||||
</div>
|
||||
<button type="button" data-action="next-beat" title="${escapeMarkup(t('Next story beat'))}" aria-label="${escapeMarkup(t('Next story beat'))}">›</button>
|
||||
</div>
|
||||
<div class="bhote-event-actions">
|
||||
<button type="button" data-action="play">${escapeMarkup(t('▶ PLAY'))}</button>
|
||||
<button type="button" data-action="play-scene" hidden title="${escapeMarkup(t('Play the next shot and continue through this scene'))}">${escapeMarkup(t('▶ PLAY SCENE'))}</button>
|
||||
<button type="button" data-action="cinematic" aria-pressed="false">${escapeMarkup(t('◉ CINEMATIC'))}</button>
|
||||
<button type="button" data-action="story-replay">${escapeMarkup(t('↺ FULL STORY'))}</button>
|
||||
<button type="button" data-action="open-source">${escapeMarkup(t('↗ OPEN ORIGINAL'))}</button>
|
||||
<button type="button" data-action="corridor">${escapeMarkup(t('⌖ LOWER GORGE'))}</button>
|
||||
</div>
|
||||
</section>
|
||||
<details class="bhote-event-evidence">
|
||||
<summary>${escapeMarkup(t('FIELD REPORTS · {count}', { count: event.fieldReports.length }))}</summary>
|
||||
<div class="bhote-event-report-list"></div>
|
||||
</details>
|
||||
<div class="bhote-event-credit">
|
||||
<span>${escapeMarkup(t('GEOLOCATIONS · {credit}', { credit: 'GEO GEORGE SHADRACH' }))}</span>
|
||||
<button type="button" data-action="geolocation-map">${escapeMarkup(t('↗ OPEN PUBLIC MAP'))}</button>
|
||||
</div>
|
||||
<p class="bhote-event-caveat"><span data-role="caveat"></span><span data-role="imagery-cloud-note">${escapeMarkup(t(' Clouds are preserved from the source imagery.'))}</span></p>
|
||||
`;
|
||||
|
||||
const refs = collectPanelReferences(panel);
|
||||
renderImageryEndpoint(refs.beforeDate, event.imagery.before);
|
||||
renderImageryEndpoint(refs.afterDate, event.imagery.after);
|
||||
refs.time.textContent = `~0:00 / ${elapsedLabel(1, event.reconstruction.elapsedSeconds)}`;
|
||||
refs.caveat.textContent = bhoteEventText(event.reconstruction.caveat);
|
||||
|
||||
for (const report of event.fieldReports) {
|
||||
const button = document.createElement('button');
|
||||
const label = document.createElement('span');
|
||||
const status = document.createElement('small');
|
||||
button.type = 'button';
|
||||
button.className = 'bhote-event-report';
|
||||
label.textContent = bhoteEventText(report.label);
|
||||
status.textContent = bhoteEventText(report.status);
|
||||
button.append(label, status);
|
||||
button.addEventListener('click', () => openExternal(report.url));
|
||||
refs.reportList.appendChild(button);
|
||||
}
|
||||
|
||||
panel
|
||||
.querySelector('[data-action="close"]')
|
||||
.addEventListener('click', handlers.close);
|
||||
panel
|
||||
.querySelector('[data-action="play"]')
|
||||
.addEventListener('click', handlers.play);
|
||||
panel
|
||||
.querySelector('[data-action="play-scene"]')
|
||||
.addEventListener('click', handlers.playScene);
|
||||
panel
|
||||
.querySelector('[data-action="cinematic"]')
|
||||
.addEventListener('click', handlers.toggleCinematic);
|
||||
panel
|
||||
.querySelector('[data-action="previous-beat"]')
|
||||
.addEventListener('click', handlers.previousBeat);
|
||||
panel
|
||||
.querySelector('[data-action="next-beat"]')
|
||||
.addEventListener('click', handlers.nextBeat);
|
||||
panel
|
||||
.querySelector('[data-action="story-replay"]')
|
||||
.addEventListener('click', handlers.replayCinematic);
|
||||
panel
|
||||
.querySelector('[data-action="open-source"]')
|
||||
.addEventListener('click', handlers.openActiveSource);
|
||||
panel
|
||||
.querySelector('[data-action="geolocation-map"]')
|
||||
.addEventListener('click', handlers.openGeolocationMap);
|
||||
panel
|
||||
.querySelector('[data-action="corridor"]')
|
||||
.addEventListener('click', handlers.focusCorridor);
|
||||
panel
|
||||
.querySelector('[data-role="split"]')
|
||||
.addEventListener('input', (inputEvent) => {
|
||||
handlers.setSplit(Number(inputEvent.target.value) / 100);
|
||||
});
|
||||
panel
|
||||
.querySelector('[data-role="progress"]')
|
||||
.addEventListener('input', (inputEvent) => {
|
||||
handlers.previewProgress(Number(inputEvent.target.value) / 1000);
|
||||
});
|
||||
panel
|
||||
.querySelector('[data-role="progress"]')
|
||||
.addEventListener('change', (inputEvent) => {
|
||||
handlers.commitProgress(Number(inputEvent.target.value) / 1000, {
|
||||
final: true,
|
||||
});
|
||||
});
|
||||
const rightRail = document.getElementById?.('right-context-rail');
|
||||
rightRail?.classList.add('bhote-event-active');
|
||||
(rightRail || document.body).appendChild(panel);
|
||||
return { panel, refs };
|
||||
}
|
||||
|
||||
export function createBhoteKoshiEventLayer({
|
||||
overlayHost = DEFAULT_OVERLAY_HOST,
|
||||
renderHost = DEFAULT_RENDER_HOST,
|
||||
@@ -1119,14 +994,22 @@ export function createBhoteKoshiEventLayer({
|
||||
evidenceFrameUpdater = updateEvidenceFrame,
|
||||
videoFactory = DEFAULT_VIDEO_FACTORY,
|
||||
embeddedMediaFactory = createBhoteKoshiEmbeddedMedia,
|
||||
panelStore = useBhoteKoshiPanelStore(applicationPinia()),
|
||||
} = {}) {
|
||||
let _viewer = null;
|
||||
let _dataManager = null;
|
||||
let _mapStackController = null;
|
||||
let _event = null;
|
||||
let _enabled = false;
|
||||
let _panel = null;
|
||||
// The panel's controls; null while the layer is off. Their state is
|
||||
// published to the panel store, which the context rail renders.
|
||||
let _panelRefs = null;
|
||||
let _panelOwner = null;
|
||||
let _panelPublished = '';
|
||||
// The dates and field reports, which stay as they were when the panel
|
||||
// opened, until a locale change words them again.
|
||||
let _panelFixed = null;
|
||||
let _offPanelLocale = null;
|
||||
let _splitControl = null;
|
||||
let _beforeLayer = null;
|
||||
let _afterLayer = null;
|
||||
@@ -2723,9 +2606,9 @@ export function createBhoteKoshiEventLayer({
|
||||
id: 'bhote-koshi-split-line',
|
||||
handleClass: 'bhote-koshi-split-handle',
|
||||
cssProperty: '--bhote-koshi-split',
|
||||
beforeTitle: imageryEndpointText(event.imagery.before),
|
||||
afterTitle: imageryEndpointText(event.imagery.after),
|
||||
ariaLabel: t('Historical reference and post-event image divider'),
|
||||
beforeTitle: () => imageryEndpointText(event.imagery.before),
|
||||
afterTitle: () => imageryEndpointText(event.imagery.after),
|
||||
ariaLabel: () => t('Historical reference and post-event image divider'),
|
||||
formatValueText: (beforePercent, afterPercent) =>
|
||||
t(
|
||||
'A historical reference {before} percent, B post-event {after} percent',
|
||||
@@ -2756,15 +2639,63 @@ export function createBhoteKoshiEventLayer({
|
||||
_lastCinematicProgress = _progress;
|
||||
}
|
||||
|
||||
/** Present the panel's controls as they stand; an unchanged panel is not sent again. */
|
||||
function publishPanel() {
|
||||
if (!_panelRefs) return;
|
||||
const { root, ...controls } = _panelRefs;
|
||||
const refs = Object.fromEntries(
|
||||
Object.entries(controls).map(([key, record]) => [
|
||||
key,
|
||||
{ ...record, attributes: { ...record.attributes } },
|
||||
]),
|
||||
);
|
||||
const signature = JSON.stringify([root.sceneBeat, refs]);
|
||||
if (signature === _panelPublished) return;
|
||||
_panelPublished = signature;
|
||||
_panelFixed ??= {
|
||||
beforeDate: imageryEndpointLabel(_event.imagery.before),
|
||||
afterDate: imageryEndpointLabel(_event.imagery.after),
|
||||
reports: _event.fieldReports.map((report) => ({
|
||||
label: bhoteEventText(report.label),
|
||||
status: bhoteEventText(report.status),
|
||||
})),
|
||||
};
|
||||
panelStore.publish({
|
||||
owner: _panelOwner,
|
||||
sceneBeat: root.sceneBeat,
|
||||
refs,
|
||||
..._panelFixed,
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Word the panel again in the current locale: fresh records, written by
|
||||
* the same syncs that keep them current.
|
||||
*/
|
||||
function relocalizePanel() {
|
||||
if (!_panelRefs || !_event) return;
|
||||
_panelRefs = createPanelRecords(_event);
|
||||
_panelFixed = null;
|
||||
writeCinematicButton();
|
||||
syncPanel();
|
||||
syncPresentationMode();
|
||||
}
|
||||
|
||||
function syncCinematicButton() {
|
||||
if (writeCinematicButton()) publishPanel();
|
||||
}
|
||||
|
||||
/** Write the cinematic button's label and state; false without a panel. */
|
||||
function writeCinematicButton() {
|
||||
const button = _panelRefs?.cinematicButton;
|
||||
if (!button) return;
|
||||
if (!button) return false;
|
||||
setElementProperty(
|
||||
button,
|
||||
'textContent',
|
||||
_cinematicActive ? t('■ RELEASE CAMERA') : t('◉ CINEMATIC'),
|
||||
);
|
||||
setElementAttribute(button, 'aria-pressed', String(_cinematicActive));
|
||||
return true;
|
||||
}
|
||||
|
||||
function claimCinematicCamera() {
|
||||
@@ -3029,6 +2960,7 @@ export function createBhoteKoshiEventLayer({
|
||||
'textContent',
|
||||
`~${elapsedLabel(_sceneScrubProgress, sceneDurationSec)} / ${elapsedLabel(1, sceneDurationSec)}`,
|
||||
);
|
||||
publishPanel();
|
||||
if (_sceneSeekFrame != null) return;
|
||||
const schedule =
|
||||
globalThis.requestAnimationFrame ||
|
||||
@@ -3302,7 +3234,7 @@ export function createBhoteKoshiEventLayer({
|
||||
'disabled',
|
||||
!observation?.media?.sourceUrl,
|
||||
);
|
||||
syncCinematicButton();
|
||||
writeCinematicButton();
|
||||
setElementProperty(
|
||||
_panelRefs.splitInput,
|
||||
'value',
|
||||
@@ -3314,6 +3246,7 @@ export function createBhoteKoshiEventLayer({
|
||||
'textContent',
|
||||
`${beforePercent} / ${100 - beforePercent}`,
|
||||
);
|
||||
publishPanel();
|
||||
}
|
||||
|
||||
function syncPresentationMode() {
|
||||
@@ -3330,7 +3263,7 @@ export function createBhoteKoshiEventLayer({
|
||||
const evidenceAvailable =
|
||||
!sceneDirected ||
|
||||
(_sceneSurface === BHOTE_KOSHI_SCENE_EVIDENCE_BEAT && knownSceneBeat);
|
||||
_panel?.classList?.toggle('bhote-event-scene-beat', sceneDirected);
|
||||
if (_panelRefs) _panelRefs.root.sceneBeat = sceneDirected;
|
||||
if (_panelRefs?.playSceneButton)
|
||||
_panelRefs.playSceneButton.hidden = !sceneDirected;
|
||||
if (_panelRefs?.imagerySection)
|
||||
@@ -3364,6 +3297,7 @@ export function createBhoteKoshiEventLayer({
|
||||
}
|
||||
if (_panelRefs?.openSourceButton)
|
||||
_panelRefs.openSourceButton.hidden = !evidenceAvailable;
|
||||
publishPanel();
|
||||
overlayHost.setVisible(BHOTE_KOSHI_OVERLAY_SOURCE_ID, evidenceAvailable);
|
||||
}
|
||||
|
||||
@@ -3561,7 +3495,12 @@ export function createBhoteKoshiEventLayer({
|
||||
throwIfEnableCancelled(signal, _enabled);
|
||||
createFloodDataSource();
|
||||
createSplitControl(event);
|
||||
const panelView = createPanel(event, {
|
||||
_panelRefs = createPanelRecords(event);
|
||||
_panelOwner = {};
|
||||
_panelPublished = '';
|
||||
_panelFixed = null;
|
||||
const owner = _panelOwner;
|
||||
const controls = {
|
||||
close: () =>
|
||||
_dataManager?.setEnabled(BHOTE_KOSHI_LAYER_ID, false, {
|
||||
origin: 'user',
|
||||
@@ -3578,9 +3517,23 @@ export function createBhoteKoshiEventLayer({
|
||||
commitProgress,
|
||||
setSplit,
|
||||
focusCorridor,
|
||||
});
|
||||
_panel = panelView.panel;
|
||||
_panelRefs = panelView.refs;
|
||||
openReport: (index) => {
|
||||
const url = event.fieldReports[index]?.url;
|
||||
if (url) openExternal(url);
|
||||
},
|
||||
};
|
||||
// Only the panel this enable published may act.
|
||||
panelStore.connect(
|
||||
Object.fromEntries(
|
||||
Object.entries(controls).map(([name, control]) => [
|
||||
name,
|
||||
(...args) => (_panelOwner === owner ? control(...args) : undefined),
|
||||
]),
|
||||
),
|
||||
);
|
||||
publishPanel();
|
||||
_offPanelLocale?.();
|
||||
_offPanelLocale = onLocaleChange(relocalizePanel);
|
||||
syncPresentationMode();
|
||||
overlayHost.setVisible(
|
||||
BHOTE_KOSHI_OVERLAY_SOURCE_ID,
|
||||
@@ -3673,12 +3626,16 @@ export function createBhoteKoshiEventLayer({
|
||||
_surgePoint = null;
|
||||
_lastSurgePosition = null;
|
||||
_lastSurgeVisible = null;
|
||||
_panel?.remove();
|
||||
document
|
||||
.getElementById?.('right-context-rail')
|
||||
?.classList.remove('bhote-event-active');
|
||||
_panel = null;
|
||||
if (_panelOwner && panelStore.panel?.owner === _panelOwner) {
|
||||
panelStore.connect(null);
|
||||
panelStore.publish(null);
|
||||
}
|
||||
_offPanelLocale?.();
|
||||
_offPanelLocale = null;
|
||||
_panelOwner = null;
|
||||
_panelRefs = null;
|
||||
_panelPublished = '';
|
||||
_panelFixed = null;
|
||||
_splitControl?.destroy();
|
||||
_splitControl = null;
|
||||
_progress = 0;
|
||||
|
||||
@@ -3,6 +3,9 @@ import { readFile } from 'node:fs/promises';
|
||||
import test from 'node:test';
|
||||
import { claimPointer, releasePointer } from './inputOwnership.js';
|
||||
import * as Cesium from 'cesium';
|
||||
import { useBhoteKoshiPanelStore } from '../ui/stores/bhoteKoshiPanel.js';
|
||||
import { useImagerySplitStore } from '../ui/stores/imagerySplit.js';
|
||||
import { applicationPinia } from '../ui/vueRuntime.js';
|
||||
import { SOURCE_PATH_BEAT_IDS } from './bhoteKoshiShotPaths.js';
|
||||
import {
|
||||
BHOTE_KOSHI_LAYER_ID,
|
||||
@@ -36,6 +39,95 @@ import { SceneDirector } from '../scenes/director.js';
|
||||
const eventUrl = new URL('../../public/events/bhote-koshi-2026/event.json', import.meta.url);
|
||||
const eventModuleUrl = new URL('./bhoteKoshiEvent.js', import.meta.url);
|
||||
|
||||
/** The event's divider as the imagery split store holds it, or undefined. */
|
||||
const eventSplit = () =>
|
||||
useImagerySplitStore(applicationPinia()).splits.findLast(
|
||||
(split) => split.view.id === 'bhote-koshi-split-line',
|
||||
);
|
||||
|
||||
// The panel controls the layer presents, by the selector the panel view gives each.
|
||||
const PANEL_REFS = {
|
||||
'[data-role="imagery-comparison"]': 'imagerySection',
|
||||
'[data-role="time"]': 'time',
|
||||
'[data-role="caveat"]': 'caveat',
|
||||
'[data-role="imagery-cloud-note"]': 'imageryCloudNote',
|
||||
'[data-role="progress"]': 'progressInput',
|
||||
'[data-role="split"]': 'splitInput',
|
||||
'[data-role="timeline-label"]': 'timelineLabel',
|
||||
'[data-role="beat-index"]': 'beatIndex',
|
||||
'[data-role="beat-title"]': 'beatTitle',
|
||||
'[data-role="beat-meta"]': 'beatMeta',
|
||||
'[data-action="play"]': 'playButton',
|
||||
'[data-action="play-scene"]': 'playSceneButton',
|
||||
'[data-action="cinematic"]': 'cinematicButton',
|
||||
'[data-action="story-replay"]': 'storyReplayButton',
|
||||
'[data-action="corridor"]': 'corridorButton',
|
||||
'[data-action="previous-beat"]': 'previousButton',
|
||||
'[data-action="next-beat"]': 'nextButton',
|
||||
'[data-action="open-source"]': 'openSourceButton',
|
||||
};
|
||||
// What each control calls, as the panel view wires it.
|
||||
const PANEL_EVENTS = {
|
||||
playButton: { click: 'play' },
|
||||
playSceneButton: { click: 'playScene' },
|
||||
cinematicButton: { click: 'toggleCinematic' },
|
||||
storyReplayButton: { click: 'replayCinematic' },
|
||||
corridorButton: { click: 'focusCorridor' },
|
||||
previousButton: { click: 'previousBeat' },
|
||||
nextButton: { click: 'nextBeat' },
|
||||
openSourceButton: { click: 'openActiveSource' },
|
||||
progressInput: {
|
||||
input: (controls, value) => controls.previewProgress(Number(value) / 1000),
|
||||
change: (controls, value) => controls.commitProgress(Number(value) / 1000, { final: true }),
|
||||
},
|
||||
splitInput: { input: (controls, value) => controls.setSplit(Number(value) / 100) },
|
||||
};
|
||||
|
||||
/**
|
||||
* The event panel as the layer presents it to the panel store, or undefined
|
||||
* while it is off. Controls read the latest presentation, and dispatching an
|
||||
* event calls the connected controls as the panel view does.
|
||||
*/
|
||||
function eventPanel() {
|
||||
const store = useBhoteKoshiPanelStore(applicationPinia());
|
||||
if (!store.panel) return undefined;
|
||||
const control = (key) => {
|
||||
let typed = null;
|
||||
const record = () => store.panel.refs[key];
|
||||
return {
|
||||
get textContent() { return record().textContent; },
|
||||
get hidden() { return record().hidden; },
|
||||
get disabled() { return record().disabled; },
|
||||
get value() { return typed ?? record().value; },
|
||||
set value(value) { typed = value; },
|
||||
getAttribute: (name) => record().attributes[name] ?? null,
|
||||
dispatch(type) {
|
||||
const value = typed ?? record().value;
|
||||
typed = null;
|
||||
const handler = PANEL_EVENTS[key]?.[type];
|
||||
return typeof handler === 'function'
|
||||
? handler(store.controls, value)
|
||||
: store.controls[handler]?.();
|
||||
},
|
||||
};
|
||||
};
|
||||
const named = (name) => ({ dispatch: () => store.controls[name]() });
|
||||
return {
|
||||
querySelector(selector) {
|
||||
if (selector === '.bhote-event-report-list') {
|
||||
return {
|
||||
children: store.panel.reports.map((_, index) => ({
|
||||
dispatch: () => store.controls.openReport(index),
|
||||
})),
|
||||
};
|
||||
}
|
||||
if (selector === '[data-action="geolocation-map"]') return named('openGeolocationMap');
|
||||
if (selector === '[data-action="close"]') return named('close');
|
||||
return control(PANEL_REFS[selector]);
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
class FakeElement {
|
||||
constructor(tagName = 'div') {
|
||||
this.tagName = tagName;
|
||||
@@ -840,6 +932,7 @@ test('Bhote Koshi disable preserves an operator-selected map and tears down ever
|
||||
const originalDocument = globalThis.document;
|
||||
const originalWindow = globalThis.window;
|
||||
const { body, removedProperties } = installEventDom();
|
||||
assert.equal(eventSplit(), undefined, 'no divider is left from an earlier test');
|
||||
const clearedTimeouts = [];
|
||||
globalThis.window = {
|
||||
setTimeout: () => 71,
|
||||
@@ -879,7 +972,8 @@ test('Bhote Koshi disable preserves an operator-selected map and tears down ever
|
||||
assert.equal(await layer.enable(viewer, { origin: 'scene' }), true);
|
||||
assert.equal(viewer._test.imagery.length, 2);
|
||||
assert.equal(viewer._test.dataSources.length, 1);
|
||||
assert.equal(body.children.length, 2);
|
||||
assert.ok(eventPanel());
|
||||
assert.ok(eventSplit());
|
||||
|
||||
activeMap = 'operator-choice';
|
||||
generation += 1;
|
||||
@@ -888,7 +982,8 @@ test('Bhote Koshi disable preserves an operator-selected map and tears down ever
|
||||
assert.deepEqual(mapCalls, ['esri-imagery']);
|
||||
assert.equal(viewer._test.removedImagery.length, 2);
|
||||
assert.equal(viewer._test.removedDataSources.length, 1);
|
||||
assert.ok(body.children.every((element) => element.removed));
|
||||
assert.equal(eventPanel(), undefined);
|
||||
assert.equal(eventSplit(), undefined);
|
||||
assert.equal(viewer.scene.splitPosition, 0.37);
|
||||
assert.deepEqual(clearedTimeouts, [71]);
|
||||
assert.ok(overlayCalls.some(([kind]) => kind === 'clear'));
|
||||
@@ -934,7 +1029,7 @@ test('Bhote Koshi disable stops active playback and releases its global render h
|
||||
|
||||
try {
|
||||
await layer.enable(viewer, { origin: 'scene' });
|
||||
const panel = body.children.find((element) => element.tagName === 'aside');
|
||||
const panel = eventPanel();
|
||||
assert.equal(panel.querySelector('[data-action="play-scene"]').hidden, true);
|
||||
assert.equal(await panel.querySelector('[data-action="play-scene"]').dispatch('click'), false);
|
||||
panel.querySelector('[data-action="play"]').dispatch('click');
|
||||
@@ -1075,6 +1170,7 @@ test('Bhote Koshi scene beats preserve photoreal and never take camera ownership
|
||||
const originalRequestAnimationFrame = globalThis.requestAnimationFrame;
|
||||
const originalCancelAnimationFrame = globalThis.cancelAnimationFrame;
|
||||
const { body } = installEventDom();
|
||||
assert.equal(eventSplit(), undefined, 'no divider is left from an earlier test');
|
||||
const timers = [];
|
||||
const openedUrls = [];
|
||||
const cancelledFrames = [];
|
||||
@@ -1181,11 +1277,10 @@ test('Bhote Koshi scene beats preserve photoreal and never take camera ownership
|
||||
assert.deepEqual(timers, []);
|
||||
assert.equal(viewer._test.imagery.length, 2, 'the event surface keeps its cached imagery pair');
|
||||
assert.ok(viewer._test.imagery.every((imageryLayer) => imageryLayer.show === false));
|
||||
const panel = body.children.find((element) => element.tagName === 'aside');
|
||||
const panel = eventPanel();
|
||||
assert.ok(panel);
|
||||
const splitLine = body.children.find((element) => element.id === 'bhote-koshi-split-line');
|
||||
assert.ok(splitLine);
|
||||
assert.equal(splitLine.hidden, true);
|
||||
assert.ok(eventSplit());
|
||||
assert.equal(eventSplit().view.hidden, true);
|
||||
assert.equal(panel.querySelector('[data-role="imagery-comparison"]').hidden, true);
|
||||
assert.match(panel.querySelector('[data-role="caveat"]').textContent, /SCHEMATIC CORRIDOR/i);
|
||||
assert.doesNotMatch(panel.querySelector('[data-role="caveat"]').textContent, /historical/i);
|
||||
@@ -1220,8 +1315,6 @@ test('Bhote Koshi scene beats preserve photoreal and never take camera ownership
|
||||
assert.equal(panel.querySelector('[data-action="cinematic"]').disabled, true);
|
||||
assert.equal(panel.querySelector('[data-action="corridor"]').hidden, false);
|
||||
assert.equal(panel.querySelector('[data-action="corridor"]').disabled, false);
|
||||
assert.doesNotMatch(panel.innerHTML, /data-action="witness"|◎ WITNESS/);
|
||||
assert.match(panel.innerHTML, /data-action="open-source"/);
|
||||
const fullStory = panel.querySelector('[data-action="story-replay"]');
|
||||
assert.equal(fullStory.textContent, '↺ FULL STORY');
|
||||
assert.equal(fullStory.hidden, true, 'PLAY SCENE owns authored scene playback');
|
||||
@@ -1240,30 +1333,27 @@ test('Bhote Koshi scene beats preserve photoreal and never take camera ownership
|
||||
beatId: 'timure-cluster',
|
||||
sceneControls: { imageryComparison: true },
|
||||
}, { origin: 'scene' });
|
||||
assert.equal(splitLine.hidden, false);
|
||||
assert.equal(eventSplit().view.hidden, false);
|
||||
assert.equal(panel.querySelector('[data-role="imagery-comparison"]').hidden, false);
|
||||
assert.ok(viewer._test.imagery.every((imageryLayer) => imageryLayer.show === true));
|
||||
const splitHandle = splitLine.children.find(
|
||||
(element) => element.className === 'bhote-koshi-split-handle',
|
||||
);
|
||||
assert.ok(splitHandle);
|
||||
assert.equal(splitHandle.textContent, '↔');
|
||||
assert.equal(splitHandle.getAttribute('aria-valuenow'), '62');
|
||||
splitHandle.dispatch('pointerdown', {
|
||||
assert.equal(eventSplit().view.handleClass, 'bhote-koshi-split-handle');
|
||||
assert.equal(eventSplit().view.valueNow, 62);
|
||||
const splitHandle = eventSplit().controls;
|
||||
splitHandle.pointerdown({
|
||||
button: 0,
|
||||
clientX: 250,
|
||||
pointerId: 4,
|
||||
preventDefault() {},
|
||||
});
|
||||
splitHandle.dispatch('pointermove', {
|
||||
splitHandle.pointermove({
|
||||
clientX: 750,
|
||||
pointerId: 4,
|
||||
preventDefault() {},
|
||||
});
|
||||
splitHandle.dispatch('pointerup', { pointerId: 4 });
|
||||
splitHandle.pointerup({ pointerId: 4 });
|
||||
assert.equal(viewer.scene.splitPosition, 0.75);
|
||||
assert.equal(splitHandle.getAttribute('aria-valuenow'), '75');
|
||||
splitHandle.dispatch('keydown', {
|
||||
assert.equal(eventSplit().view.valueNow, 75);
|
||||
splitHandle.keydown({
|
||||
key: 'ArrowLeft',
|
||||
shiftKey: true,
|
||||
preventDefault() {},
|
||||
@@ -1276,7 +1366,7 @@ test('Bhote Koshi scene beats preserve photoreal and never take camera ownership
|
||||
split: 0.62,
|
||||
sceneControls: {},
|
||||
}, { origin: 'scene' });
|
||||
assert.equal(splitLine.hidden, true);
|
||||
assert.equal(eventSplit().view.hidden, true);
|
||||
assert.ok(viewer._test.imagery.every((imageryLayer) => imageryLayer.show === false));
|
||||
assert.equal(viewer.scene.splitPosition, 0.62);
|
||||
assert.equal(overlayVisibility.at(-1).visible, false);
|
||||
@@ -1347,7 +1437,7 @@ test('Bhote Koshi scene beats preserve photoreal and never take camera ownership
|
||||
assert.equal(layer.getCinematicState().active, false);
|
||||
assert.equal(viewer._test.cameraLooks.length, 0);
|
||||
assert.deepEqual(mapCalls, []);
|
||||
assert.equal(body.children.filter((element) => element.tagName === 'aside').length, 1);
|
||||
assert.ok(eventPanel());
|
||||
assert.equal(viewer.scene.splitPosition, 0.62);
|
||||
for (const beatId of [
|
||||
'debris-dammed-lake',
|
||||
@@ -1594,7 +1684,7 @@ test('Bhote Koshi publishes the evidence spine once and scrubs through cards and
|
||||
assert.equal(breadcrumbs.filter((entry) => entry.position()).length, 0);
|
||||
assert.ok(cards.every((entry) => entry.requireImage && entry.image.stamp === 1));
|
||||
|
||||
const panel = body.children.find((element) => element.tagName === 'aside');
|
||||
const panel = eventPanel();
|
||||
const progress = panel.querySelector('[data-role="progress"]');
|
||||
progress.value = '285';
|
||||
progress.dispatch('input');
|
||||
@@ -1685,7 +1775,7 @@ test('Bhote Koshi keeps one local fallback video active and unloads it on beat c
|
||||
videos[0].dispatch('loadeddata');
|
||||
assert.equal(layer.getCinematicState().mediaReady, true);
|
||||
|
||||
const panel = body.children.find((element) => element.tagName === 'aside');
|
||||
const panel = eventPanel();
|
||||
const progress = panel.querySelector('[data-role="progress"]');
|
||||
progress.value = '285';
|
||||
progress.dispatch('input');
|
||||
@@ -1808,7 +1898,7 @@ test('Upper Valley Collapse autoplays its muted local fallback without starting
|
||||
assert.ok(video.pauseCalls >= 1);
|
||||
assert.ok(video.cancelledFrameHandles.length >= 1);
|
||||
assert.equal(layer.getCinematicState().mediaEvidenceId, null);
|
||||
assert.equal(body.children.find((element) => element.tagName === 'aside')?.removed, false);
|
||||
assert.ok(eventPanel());
|
||||
await layer.disable();
|
||||
} finally {
|
||||
globalThis.document = originalDocument;
|
||||
@@ -2121,10 +2211,8 @@ test('Bhote Koshi beat controls keep cards, flood, camera, and panel on the one
|
||||
|
||||
try {
|
||||
await layer.enable(viewer, { origin: 'local-restore' });
|
||||
const panel = body.children.find((element) => element.tagName === 'aside');
|
||||
assert.match(panel.innerHTML, /2021 HISTORICAL REFERENCE \/ 2026 POST-EVENT/);
|
||||
assert.match(panel.innerHTML, /RECONSTRUCTION CLOCK/);
|
||||
assert.match(panel.innerHTML, /OPEN PUBLIC MAP/);
|
||||
const panel = eventPanel();
|
||||
assert.equal(panel.querySelector('[data-role="timeline-label"]').textContent, 'RECONSTRUCTION CLOCK');
|
||||
const entries = publications[0].entries;
|
||||
const cards = entries.filter((entry) => entry.variant === 'thumbnail');
|
||||
const breadcrumbs = entries.filter((entry) => entry.variant === 'label');
|
||||
@@ -2203,7 +2291,7 @@ test('Bhote Koshi beat controls keep cards, flood, camera, and panel on the one
|
||||
}
|
||||
});
|
||||
|
||||
test('Bhote Koshi repeated event frames perform no panel lookup, DOM write, or camera churn', async () => {
|
||||
test('Bhote Koshi repeated event frames republish no panel and churn no camera', async () => {
|
||||
const event = JSON.parse(await readFile(eventUrl, 'utf8'));
|
||||
const originalDocument = globalThis.document;
|
||||
const originalWindow = globalThis.window;
|
||||
@@ -2238,26 +2326,19 @@ test('Bhote Koshi repeated event frames perform no panel lookup, DOM write, or c
|
||||
|
||||
try {
|
||||
await layer.enable(viewer, { origin: 'local-restore' });
|
||||
const panel = body.children.find((element) => element.tagName === 'aside');
|
||||
const panel = eventPanel();
|
||||
const cinematic = panel.querySelector('[data-action="cinematic"]');
|
||||
const progress = panel.querySelector('[data-role="progress"]');
|
||||
cinematic.dispatch('click');
|
||||
progress.value = '500';
|
||||
progress.dispatch('input');
|
||||
|
||||
const queryCount = panel._queryCount;
|
||||
const writeCount = [...panel._selectors.values()].reduce((sum, element) => (
|
||||
sum + element._writeCount
|
||||
), 0);
|
||||
const panelStore = useBhoteKoshiPanelStore(applicationPinia());
|
||||
const published = panelStore.panel;
|
||||
const cameraLookCount = viewer._test.cameraLooks.length;
|
||||
for (let index = 0; index < 20; index += 1) progress.dispatch('input');
|
||||
|
||||
assert.equal(panel._queryCount, queryCount, 'hot path uses cached panel references');
|
||||
assert.equal(
|
||||
[...panel._selectors.values()].reduce((sum, element) => sum + element._writeCount, 0),
|
||||
writeCount,
|
||||
'unchanged frames do not rewrite panel state',
|
||||
);
|
||||
assert.ok(panelStore.panel === published, 'unchanged frames do not republish the panel');
|
||||
assert.equal(
|
||||
viewer._test.cameraLooks.length,
|
||||
cameraLookCount,
|
||||
@@ -2328,7 +2409,7 @@ test('Bhote Koshi cinematic camera stays synchronized through pause and determin
|
||||
|
||||
try {
|
||||
await layer.enable(viewer, { origin: 'local-restore' });
|
||||
const panel = body.children.find((element) => element.tagName === 'aside');
|
||||
const panel = eventPanel();
|
||||
panel.querySelector('[data-action="cinematic"]').dispatch('click');
|
||||
assert.equal(layer.getCinematicState().active, true);
|
||||
assert.equal(layer.getPlaybackState().playing, true);
|
||||
@@ -2413,7 +2494,7 @@ test('Bhote Koshi replay restores cinematic ownership unless the operator releas
|
||||
|
||||
try {
|
||||
await layer.enable(viewer, { origin: 'local-restore' });
|
||||
const panel = body.children.find((element) => element.tagName === 'aside');
|
||||
const panel = eventPanel();
|
||||
panel.querySelector('[data-action="cinematic"]').dispatch('click');
|
||||
animationCallbacks[0](91001);
|
||||
assert.equal(layer.getPlaybackState().progress, 1);
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
} from './dataCredits.js';
|
||||
import { BHOTE_KOSHI_FLOOD_PATH } from './bhoteKoshiFloodPath.js';
|
||||
import { INCIDENT_OVERVIEW_PLACES } from './bhoteKoshiIncidentPlaces.js';
|
||||
import { t, msg, getLocale } from '../i18n/index.js';
|
||||
import { t, msg, getLocale, isolate } from '../i18n/index.js';
|
||||
|
||||
const BHOTE_KOSHI_LOCATOR_LAYER_ID = 'bhote-koshi-locator';
|
||||
export const BHOTE_KOSHI_LOCATOR_OVERLAY_SOURCE_ID =
|
||||
@@ -67,7 +67,10 @@ const PLACE_TITLE_TEXT = new Map(
|
||||
|
||||
function placeTitle(title) {
|
||||
const text = PLACE_TITLE_TEXT.get(title);
|
||||
return text ? t(text).toLocaleUpperCase(getLocale()) : title;
|
||||
// Isolated: the card draws left to right after its "11 · " counter, so in
|
||||
// Arabic a translated title with a Latin place name («نقطة الإطلالة في
|
||||
// DANDAGAUN») must keep its own right-to-left order.
|
||||
return text ? isolate(t(text).toLocaleUpperCase(getLocale())) : title;
|
||||
}
|
||||
|
||||
const INCIDENT = Object.freeze({
|
||||
|
||||
@@ -0,0 +1,212 @@
|
||||
// src/data/bhoteKoshiPanelView.test.mjs — the context rail renders the Bhote
|
||||
// Koshi reconstruction panel the event layer presents and sends its clicks
|
||||
// and slider moves back.
|
||||
import '../testSupport/registerDom.mjs';
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { createApp, nextTick } from 'vue';
|
||||
import { createPinia } from 'pinia';
|
||||
import { useBhoteKoshiPanelStore } from '../ui/stores/bhoteKoshiPanel.js';
|
||||
import ContextView from '../ui/views/ContextView.vue';
|
||||
|
||||
const record = (initial = {}) => ({
|
||||
textContent: '',
|
||||
hidden: false,
|
||||
disabled: false,
|
||||
value: '',
|
||||
attributes: {},
|
||||
...initial,
|
||||
});
|
||||
|
||||
function presentation(patch = {}) {
|
||||
return {
|
||||
owner: {},
|
||||
sceneBeat: false,
|
||||
beforeDate: { name: 'Historical reference', date: '2021-05-01' },
|
||||
afterDate: { name: 'Post-event', date: '' },
|
||||
reports: [
|
||||
{ label: 'Report A', status: 'Verified' },
|
||||
{ label: 'Report B', status: 'Unverified' },
|
||||
],
|
||||
refs: {
|
||||
imagerySection: record(),
|
||||
observedStatus: record(),
|
||||
time: record({ textContent: '~0:00 / 2:00' }),
|
||||
caveat: record({ textContent: 'Schematic only.' }),
|
||||
imageryCloudNote: record(),
|
||||
playButton: record({ textContent: '▶ PLAY' }),
|
||||
playSceneButton: record({ textContent: '▶ PLAY SCENE', hidden: true }),
|
||||
cinematicButton: record({
|
||||
textContent: '◉ CINEMATIC',
|
||||
attributes: { 'aria-pressed': 'false' },
|
||||
}),
|
||||
storyReplayButton: record({ textContent: '↺ FULL STORY' }),
|
||||
corridorButton: record(),
|
||||
previousButton: record({
|
||||
disabled: true,
|
||||
attributes: { 'aria-label': 'Previous story beat' },
|
||||
}),
|
||||
nextButton: record({ attributes: { 'aria-label': 'Next story beat' } }),
|
||||
openSourceButton: record(),
|
||||
progressInput: record({
|
||||
value: '0',
|
||||
attributes: { 'aria-label': 'Schematic downstream progression' },
|
||||
}),
|
||||
splitInput: record({ value: '50' }),
|
||||
splitReadout: record({ textContent: '50 / 50' }),
|
||||
timelineLabel: record({ textContent: 'RECONSTRUCTION CLOCK' }),
|
||||
beatIndex: record({ textContent: '01 / 06' }),
|
||||
beatTitle: record({ textContent: 'CAUSE' }),
|
||||
beatMeta: record({ textContent: 'CAPTURE TIME UNVERIFIED' }),
|
||||
},
|
||||
...patch,
|
||||
};
|
||||
}
|
||||
|
||||
function fixture(t) {
|
||||
document.body.replaceChildren();
|
||||
const pinia = createPinia();
|
||||
const app = createApp(ContextView).use(pinia);
|
||||
app.mount(document.body.appendChild(document.createElement('div')));
|
||||
t.after(() => app.unmount());
|
||||
const store = useBhoteKoshiPanelStore(pinia);
|
||||
const calls = [];
|
||||
store.connect(
|
||||
new Proxy(
|
||||
{},
|
||||
{
|
||||
get:
|
||||
(_, name) =>
|
||||
(...args) =>
|
||||
calls.push([name, ...args]),
|
||||
},
|
||||
),
|
||||
);
|
||||
const rail = document.getElementById('right-context-rail');
|
||||
const $ = (selector) => rail.querySelector(selector);
|
||||
return { store, calls, rail, $ };
|
||||
}
|
||||
|
||||
test('the panel renders last in the context rail and marks the rail while on', async (t) => {
|
||||
const { store, rail, $ } = fixture(t);
|
||||
assert.equal($('#bhote-koshi-event-panel'), null);
|
||||
assert.equal(rail.classList.contains('bhote-event-active'), false);
|
||||
store.publish(presentation());
|
||||
await nextTick();
|
||||
const panel = $('#bhote-koshi-event-panel');
|
||||
assert.equal(panel.tagName, 'ASIDE');
|
||||
assert.ok(rail.lastElementChild === panel);
|
||||
assert.ok(rail.classList.contains('ui-scroll'));
|
||||
assert.ok(rail.classList.contains('bhote-event-active'));
|
||||
assert.equal(
|
||||
panel.getAttribute('aria-label'),
|
||||
'Bhote Koshi flood reconstruction controls',
|
||||
);
|
||||
assert.match(
|
||||
panel.textContent,
|
||||
/2021 HISTORICAL REFERENCE \/ 2026 POST-EVENT/,
|
||||
);
|
||||
assert.match(panel.textContent, /RECONSTRUCTION CLOCK/);
|
||||
assert.match(panel.textContent, /OPEN PUBLIC MAP/);
|
||||
assert.equal(
|
||||
$('[data-role="before-date"]').textContent,
|
||||
'Historical reference · 2021-05-01',
|
||||
);
|
||||
assert.equal(
|
||||
$('[data-role="before-date"] .bhote-event-date').textContent,
|
||||
'2021-05-01',
|
||||
);
|
||||
assert.equal($('[data-role="after-date"]').textContent, 'Post-event');
|
||||
assert.equal($('[data-role="after-date"] .bhote-event-date'), null);
|
||||
assert.equal($('[data-action="play-scene"]').hidden, true);
|
||||
assert.ok($('[data-action="open-source"]'));
|
||||
assert.equal($('[data-action="witness"]'), null);
|
||||
assert.doesNotMatch(panel.innerHTML, /witness/i);
|
||||
assert.equal($('[data-action="previous-beat"]').disabled, true);
|
||||
assert.equal($('[data-action="previous-beat"]').title, 'Previous story beat');
|
||||
assert.equal(
|
||||
$('[data-action="cinematic"]').getAttribute('aria-pressed'),
|
||||
'false',
|
||||
);
|
||||
assert.equal($('[data-action="play"]').hasAttribute('aria-label'), false);
|
||||
assert.equal($('[data-role="progress"]').value, '0');
|
||||
assert.equal($('[data-role="split"]').value, '50');
|
||||
assert.equal($('summary').textContent, 'FIELD REPORTS · 2');
|
||||
assert.deepEqual(
|
||||
[...$('.bhote-event-report-list').children].map(
|
||||
(button) => button.textContent,
|
||||
),
|
||||
['Report AVerified', 'Report BUnverified'],
|
||||
);
|
||||
store.publish(null);
|
||||
await nextTick();
|
||||
assert.equal($('#bhote-koshi-event-panel'), null);
|
||||
assert.equal(rail.classList.contains('bhote-event-active'), false);
|
||||
assert.ok(rail.classList.contains('ui-scroll'));
|
||||
});
|
||||
|
||||
test('a later presentation updates the controls in place', async (t) => {
|
||||
const { store, $ } = fixture(t);
|
||||
store.publish(presentation());
|
||||
await nextTick();
|
||||
const play = $('[data-action="play"]');
|
||||
const next = presentation({ sceneBeat: true });
|
||||
next.refs.playButton = record({
|
||||
textContent: '▶ PLAY SHOT',
|
||||
disabled: true,
|
||||
attributes: { 'aria-label': 'Play Global context' },
|
||||
});
|
||||
next.refs.progressInput = record({ value: '250', hidden: true });
|
||||
next.refs.imagerySection = record({ hidden: true });
|
||||
store.publish(next);
|
||||
await nextTick();
|
||||
assert.ok($('[data-action="play"]') === play);
|
||||
assert.equal(play.textContent, '▶ PLAY SHOT');
|
||||
assert.equal(play.disabled, true);
|
||||
assert.equal(play.getAttribute('aria-label'), 'Play Global context');
|
||||
assert.ok(
|
||||
$('#bhote-koshi-event-panel').classList.contains('bhote-event-scene-beat'),
|
||||
);
|
||||
assert.equal($('[data-role="progress"]').value, '250');
|
||||
assert.equal($('[data-role="progress"]').hidden, true);
|
||||
assert.equal($('[data-role="imagery-comparison"]').hidden, true);
|
||||
});
|
||||
|
||||
test('buttons, sliders and reports call the connected controls', async (t) => {
|
||||
const { store, calls, $ } = fixture(t);
|
||||
store.publish(presentation());
|
||||
await nextTick();
|
||||
for (const action of [
|
||||
'close',
|
||||
'play',
|
||||
'cinematic',
|
||||
'story-replay',
|
||||
'open-source',
|
||||
'corridor',
|
||||
'next-beat',
|
||||
'geolocation-map',
|
||||
])
|
||||
$(`[data-action="${action}"]`).click();
|
||||
$('.bhote-event-report-list').children[1].click();
|
||||
const progress = $('[data-role="progress"]');
|
||||
progress.value = '500';
|
||||
progress.dispatchEvent(new Event('input'));
|
||||
progress.dispatchEvent(new Event('change'));
|
||||
const split = $('[data-role="split"]');
|
||||
split.value = '25';
|
||||
split.dispatchEvent(new Event('input'));
|
||||
assert.deepEqual(calls, [
|
||||
['close'],
|
||||
['play'],
|
||||
['toggleCinematic'],
|
||||
['replayCinematic'],
|
||||
['openActiveSource'],
|
||||
['focusCorridor'],
|
||||
['nextBeat'],
|
||||
['openGeolocationMap'],
|
||||
['openReport', 1],
|
||||
['previewProgress', 0.5],
|
||||
['commitProgress', 0.5, { final: true }],
|
||||
['setSplit', 0.25],
|
||||
]);
|
||||
});
|
||||
@@ -0,0 +1,162 @@
|
||||
// Outline names are drawn by the DOM annotation overlay, never as Cesium
|
||||
// text labels: the boundary data modules, the outline resolver and the
|
||||
// annotation renderers must not import or construct Cesium label primitives,
|
||||
// and drawing a bundled outline must create none at runtime.
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import * as Cesium from 'cesium';
|
||||
import { FEATURE_SOURCE_METHODS } from '../sources/featureSource.js';
|
||||
import { createAnnotationResolver } from '../annotations/resolver.js';
|
||||
import { createWorldAnnotationRenderer } from '../annotations/worldAnnotationRenderer.js';
|
||||
|
||||
const read = (path) => readFileSync(new URL(path, import.meta.url), 'utf8');
|
||||
|
||||
/** Pure data modules: no Cesium at all. */
|
||||
const DATA_MODULES = [
|
||||
'./adminBoundaries.js',
|
||||
'./placeBoundaries.js',
|
||||
'./neighborhoodPolygons.js',
|
||||
'./local_data/us_census_places/files.js',
|
||||
'./local_data/wof_neighborhoods/files.js',
|
||||
];
|
||||
|
||||
/** Modules that use Cesium for outlines but must not draw text with it. */
|
||||
const CESIUM_MODULES = [
|
||||
'../annotations/resolver.js',
|
||||
'../annotations/worldAnnotationRenderer.js',
|
||||
'../annotations/hybridAnnotationRenderer.js',
|
||||
];
|
||||
|
||||
/** The DOM overlay: callout elements, never Cesium label primitives. */
|
||||
const OVERLAY_MODULES = ['../annotations/screenAnnotationRenderer.js'];
|
||||
|
||||
const LABEL_PRIMITIVES = [
|
||||
/\bLabelCollection\b/,
|
||||
/\bLabelGraphics\b/,
|
||||
/\bLabelStyle\b/,
|
||||
/\bLabelVisualizer\b/,
|
||||
];
|
||||
|
||||
/** Entity label options, inline or assigned later. */
|
||||
const ENTITY_LABELS = [
|
||||
// `label: { text: … }` or `label: new …`
|
||||
/\blabel\s*:\s*\{[^{}]*\btext\s*:/s,
|
||||
/\blabel\s*:\s*new\b/,
|
||||
// `label: labelOptions` (anything but `null`)
|
||||
/\blabel\s*:\s*(?!null\b)[A-Za-z_$][\w$]*\s*[,}\n]/,
|
||||
// `entity.label = …`
|
||||
/\.label\s*=(?!=)/,
|
||||
];
|
||||
|
||||
test('boundary data modules never import Cesium', () => {
|
||||
for (const path of DATA_MODULES) {
|
||||
const source = read(path);
|
||||
assert.doesNotMatch(source, /from\s+['"]cesium['"]/, path);
|
||||
assert.doesNotMatch(source, /import\(\s*['"]cesium['"]/, path);
|
||||
}
|
||||
});
|
||||
|
||||
test('outline modules and renderers construct no Cesium labels', () => {
|
||||
for (const path of [...DATA_MODULES, ...CESIUM_MODULES, ...OVERLAY_MODULES])
|
||||
for (const pattern of LABEL_PRIMITIVES)
|
||||
assert.doesNotMatch(read(path), pattern, `${path}: ${pattern}`);
|
||||
for (const path of [...DATA_MODULES, ...CESIUM_MODULES])
|
||||
for (const pattern of ENTITY_LABELS)
|
||||
assert.doesNotMatch(read(path), pattern, `${path}: ${pattern}`);
|
||||
});
|
||||
|
||||
test('the static check catches a Cesium label however it is written', () => {
|
||||
const offending = [
|
||||
'viewer.scene.primitives.add(new Cesium.LabelCollection());',
|
||||
"viewer.entities.add({ position, label: { text: 'Austin' } });",
|
||||
'const graphics = new LabelGraphics({ text });',
|
||||
'viewer.entities.add({ position, label: labelOptions });',
|
||||
'entity.label = new Cesium.LabelGraphics(options);',
|
||||
'entity.label = options;',
|
||||
];
|
||||
const all = [...LABEL_PRIMITIVES, ...ENTITY_LABELS];
|
||||
for (const source of offending)
|
||||
assert.ok(
|
||||
all.some((pattern) => pattern.test(source)),
|
||||
source,
|
||||
);
|
||||
// Data, not Cesium labels: a result's label point, a stripped proxy label.
|
||||
for (const source of [
|
||||
'label: geometry.label,',
|
||||
'liveProxy(anno, { label: null });',
|
||||
'if (entity.label === x) {}',
|
||||
])
|
||||
assert.ok(!ENTITY_LABELS.some((p) => p.test(source)), source);
|
||||
});
|
||||
|
||||
test('drawing bundled place and neighborhood outlines creates no Cesium label', async (t) => {
|
||||
// Cesium's material setup checks for these browser image types.
|
||||
for (const name of [
|
||||
'HTMLCanvasElement',
|
||||
'HTMLImageElement',
|
||||
'ImageBitmap',
|
||||
'OffscreenCanvas',
|
||||
]) {
|
||||
if (name in globalThis) continue;
|
||||
globalThis[name] = class {};
|
||||
t.after(() => delete globalThis[name]);
|
||||
}
|
||||
const featureSource = {};
|
||||
for (const method of FEATURE_SOURCE_METHODS)
|
||||
featureSource[method] = async () => null;
|
||||
const { resolveAnnotationTarget } = createAnnotationResolver({
|
||||
featureSource,
|
||||
});
|
||||
const primitives = [];
|
||||
const dataSources = [];
|
||||
const viewer = {
|
||||
camera: {
|
||||
positionCartographic: Cesium.Cartographic.fromDegrees(
|
||||
-97.7431,
|
||||
30.2672,
|
||||
3000,
|
||||
),
|
||||
},
|
||||
scene: { primitives: { add: (p) => primitives.push(p) } },
|
||||
dataSources: {
|
||||
add: (ds) => dataSources.push(ds),
|
||||
remove() {},
|
||||
},
|
||||
};
|
||||
const renderer = createWorldAnnotationRenderer(viewer);
|
||||
for (const [target, lon, lat] of [
|
||||
['Austin', -97.7431, 30.2672],
|
||||
['Notting Hill', -0.2, 51.511],
|
||||
]) {
|
||||
viewer.camera.positionCartographic = Cesium.Cartographic.fromDegrees(
|
||||
lon,
|
||||
lat,
|
||||
3000,
|
||||
);
|
||||
const resolved = await resolveAnnotationTarget({
|
||||
// The resolver reads only the camera (no scene to pick from).
|
||||
viewer: { camera: viewer.camera },
|
||||
target,
|
||||
footprint: true,
|
||||
deferFootprint: true,
|
||||
});
|
||||
assert.equal(resolved.source, 'bundled', target);
|
||||
renderer.add({
|
||||
id: target,
|
||||
type: 'area',
|
||||
label: resolved.label,
|
||||
ring: resolved.ring,
|
||||
polygons: resolved.polygons,
|
||||
footprintKind: resolved.footprintKind,
|
||||
synthesized: resolved.synthesized,
|
||||
anchor: { lon: resolved.lon, lat: resolved.lat, height: 0 },
|
||||
color: 'primary',
|
||||
});
|
||||
}
|
||||
assert.equal(primitives.length, 0, 'no primitive collections');
|
||||
const entities = dataSources.flatMap((ds) => ds.entities.values);
|
||||
assert.ok(entities.length >= 2, 'the outlines were drawn');
|
||||
for (const entity of entities) assert.equal(entity.label, undefined);
|
||||
renderer.destroy();
|
||||
});
|
||||
@@ -47,6 +47,8 @@ export const prioritizeActiveCctvGeometryRecord =
|
||||
export const processGeometryBatch = layer.processGeometryBatch;
|
||||
export const hideCctvRecordVisuals = layer.hideCctvRecordVisuals;
|
||||
export const refreshCoverageStyles = layer.refreshCoverageStyles;
|
||||
export const refreshHorizonCulling = layer.refreshHorizonCulling;
|
||||
export const _viewRecordIdsForTest = layer._viewRecordIdsForTest;
|
||||
export const clearProbeClampOnDeactivation =
|
||||
layer.clearProbeClampOnDeactivation;
|
||||
export const cctvRecordNeedsActivation = layer.cctvRecordNeedsActivation;
|
||||
|
||||
@@ -25,9 +25,6 @@ function componentFunctionSource(fn) {
|
||||
.replace(/\(\s+/g, '(');
|
||||
}
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import * as Cesium from 'cesium';
|
||||
import cctvLayer, {
|
||||
CCTV_PROJECTION_OVERLAY_SOURCE_OPTIONS,
|
||||
@@ -83,16 +80,6 @@ import {
|
||||
LIVE_CAMERA_COLOR,
|
||||
} from '../layers/cctv/policy.js';
|
||||
|
||||
const CCTV_PRESENTATION_SOURCE = fs.readFileSync(
|
||||
path.join(
|
||||
path.dirname(fileURLToPath(import.meta.url)),
|
||||
'..',
|
||||
'ui',
|
||||
'cctvPresentation.js',
|
||||
),
|
||||
'utf8',
|
||||
);
|
||||
|
||||
const ASPECT = 16 / 9;
|
||||
const toRad = (deg) => (deg * Math.PI) / 180;
|
||||
const GESTURE_TYPES = {
|
||||
@@ -1302,19 +1289,6 @@ test('CCTV null-active coverage, auto-hop, cycling, and panel targets stay hones
|
||||
assert.equal(cctvCycleIndex(-1, -1, records.length), records.length - 1);
|
||||
assert.equal(cctvCycleIndex(2, 1, records.length), 0);
|
||||
assert.equal(cctvCycleIndex(0, -1, records.length), records.length - 1);
|
||||
|
||||
const renderer = CCTV_PRESENTATION_SOURCE.match(
|
||||
/_renderCctvState\(state\) \{[\s\S]*?\n\}\n/,
|
||||
);
|
||||
assert.ok(renderer, '_renderCctvState is missing');
|
||||
assert.match(
|
||||
renderer[0],
|
||||
/else if \(!activeId\)[\s\S]*?selectedIndex = -1/,
|
||||
);
|
||||
assert.match(
|
||||
renderer[0],
|
||||
/_cctvFocusBtn\.disabled\s*=\s*!enabled\s*\|\|\s*cameras\.length === 0\s*\|\|\s*!activeId/,
|
||||
);
|
||||
} finally {
|
||||
cctvLayer.setParams({ autoHop: false });
|
||||
_setCctvOverlayHostForTest();
|
||||
|
||||
@@ -0,0 +1,226 @@
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
|
||||
import {
|
||||
a22WebcamToSource,
|
||||
loadA22SourcesFromOpenDataHub,
|
||||
} from '../../server/providers/cctv/sources.js';
|
||||
import {
|
||||
A22_DEFAULT_GROUND_ELEVATION_M,
|
||||
A22_IMAGE_ORIGIN,
|
||||
DEFAULT_A22_CCTV_URL,
|
||||
} from '../../server/providers/cctv/constants.js';
|
||||
import { createCctvCatalog } from '../../server/providers/cctv/catalog.js';
|
||||
import { fetchWithinHost } from '../../server/providers/cctv/media.js';
|
||||
import { staticFrameRefreshMs } from './cctvLod.js';
|
||||
|
||||
/** One Open Data Hub `WebcamInfo` item, shaped like the live a22 payload. */
|
||||
const item = (
|
||||
patch = {},
|
||||
{ km = '68', lat = 46.53591, lon = 11.49772 } = {},
|
||||
) => ({
|
||||
Id: `A22_${km}`,
|
||||
Active: true,
|
||||
Source: 'a22',
|
||||
Shortname: 'ADS Sciliar',
|
||||
Webcamname: { it: 'ADS Sciliar' },
|
||||
Webcamurl: `https://www.autobrennero.it/WebCamImg/km${km}.jpg`,
|
||||
Mapping: { a22: { km } },
|
||||
GpsInfo: [{ Gpstype: 'position', Latitude: lat, Longitude: lon }],
|
||||
LicenseInfo: {
|
||||
ClosedData: false,
|
||||
LicenseHolder: 'https://www.autobrennero.it/',
|
||||
},
|
||||
...patch,
|
||||
});
|
||||
|
||||
test('an A22 webcam maps to a source on the pinned operator frame', () => {
|
||||
const source = a22WebcamToSource(item());
|
||||
assert.equal(source.id, 'it-a22-km68');
|
||||
assert.equal(source.name, 'A22 ADS Sciliar (km 68)');
|
||||
assert.equal(source.city, 'A22 Brennero');
|
||||
assert.equal(source.cityId, 'a22');
|
||||
assert.equal(source.provider, 'Autostrada del Brennero');
|
||||
assert.equal(source.lat, 46.53591);
|
||||
assert.equal(source.lon, 11.49772);
|
||||
assert.equal(source.headingConfidence, 'low');
|
||||
assert.equal(source.feedType, 'image');
|
||||
assert.equal(source.sourceKind, 'a22-opendatahub');
|
||||
assert.equal(source.code, 'ADS SCILIAR');
|
||||
assert.equal(source.url, `${A22_IMAGE_ORIGIN}km68.jpg`);
|
||||
assert.equal(source.snapshotUrl, source.url);
|
||||
});
|
||||
|
||||
test('ground elevation follows the motorway from the Brenner Pass to the Po', () => {
|
||||
const brenner = a22WebcamToSource(
|
||||
item({ Shortname: 'Brennero' }, { km: '1', lat: 46.99682, lon: 11.50218 }),
|
||||
);
|
||||
const ponte = a22WebcamToSource(
|
||||
item(
|
||||
{ Shortname: 'Ponte Po' },
|
||||
{ km: '272', lat: 45.03145, lon: 10.85369 },
|
||||
),
|
||||
);
|
||||
assert.ok(brenner.groundElevationM > 1300);
|
||||
assert.ok(ponte.groundElevationM < 50);
|
||||
// A kilometre the table does not know falls back to the corridor prior.
|
||||
const unknown = a22WebcamToSource(
|
||||
item({}, { km: '150', lat: 45.95, lon: 11.05 }),
|
||||
);
|
||||
assert.equal(unknown.groundElevationM, A22_DEFAULT_GROUND_ELEVATION_M);
|
||||
});
|
||||
|
||||
test('inactive cameras, off-host frames and bad geometry are dropped', () => {
|
||||
assert.equal(a22WebcamToSource(item({ Active: false })), null);
|
||||
assert.equal(a22WebcamToSource(item({ Source: 'other' })), null);
|
||||
assert.equal(
|
||||
a22WebcamToSource(
|
||||
item({ Webcamurl: 'https://evil.test/WebCamImg/km68.jpg' }),
|
||||
),
|
||||
null,
|
||||
);
|
||||
// The frame must be exactly the camera's own kilometre image.
|
||||
assert.equal(
|
||||
a22WebcamToSource(
|
||||
item({ Webcamurl: 'https://www.autobrennero.it/WebCamImg/km1.jpg' }),
|
||||
),
|
||||
null,
|
||||
);
|
||||
assert.equal(
|
||||
a22WebcamToSource(item({ Mapping: { a22: { km: '../x' } } })),
|
||||
null,
|
||||
);
|
||||
// Milan: plausible, but off the Brenner–Modena corridor.
|
||||
assert.equal(
|
||||
a22WebcamToSource(item({}, { km: '68', lat: 45.46, lon: 9.19 })),
|
||||
null,
|
||||
);
|
||||
assert.equal(a22WebcamToSource(item({ GpsInfo: [] })), null);
|
||||
assert.equal(a22WebcamToSource(null), null);
|
||||
});
|
||||
|
||||
test('the loader dedupes, orders north to south, and degrades to empty', async (t) => {
|
||||
t.mock.method(console, 'log', () => {});
|
||||
t.mock.method(console, 'warn', () => {});
|
||||
const requested = [];
|
||||
const fetchMock = t.mock.method(globalThis, 'fetch', async (url) => {
|
||||
requested.push(String(url));
|
||||
return Response.json({
|
||||
TotalResults: 3,
|
||||
Items: [
|
||||
item(
|
||||
{ Shortname: 'Ponte Po' },
|
||||
{ km: '272', lat: 45.03145, lon: 10.85369 },
|
||||
),
|
||||
item(),
|
||||
item(),
|
||||
item(
|
||||
{ Shortname: 'Brennero' },
|
||||
{ km: '1', lat: 46.99682, lon: 11.50218 },
|
||||
),
|
||||
],
|
||||
});
|
||||
});
|
||||
const cameras = await loadA22SourcesFromOpenDataHub();
|
||||
assert.deepEqual(requested, [DEFAULT_A22_CCTV_URL]);
|
||||
assert.deepEqual(
|
||||
cameras.map((c) => c.id),
|
||||
['it-a22-km1', 'it-a22-km68', 'it-a22-km272'],
|
||||
);
|
||||
|
||||
fetchMock.mock.mockImplementation(
|
||||
async () => new Response('nope', { status: 503 }),
|
||||
);
|
||||
assert.deepEqual(await loadA22SourcesFromOpenDataHub(), []);
|
||||
fetchMock.mock.mockImplementation(
|
||||
async () =>
|
||||
new Response(null, {
|
||||
status: 302,
|
||||
headers: { Location: 'https://evil.test/' },
|
||||
}),
|
||||
);
|
||||
assert.deepEqual(await loadA22SourcesFromOpenDataHub(), []);
|
||||
fetchMock.mock.mockImplementation(async () => {
|
||||
throw new Error('offline');
|
||||
});
|
||||
assert.deepEqual(await loadA22SourcesFromOpenDataHub(), []);
|
||||
});
|
||||
|
||||
const runCatalog = async (t) => {
|
||||
const requested = [];
|
||||
t.mock.method(console, 'log', () => {});
|
||||
t.mock.method(console, 'warn', () => {});
|
||||
t.mock.method(globalThis, 'fetch', async (url) => {
|
||||
const href = String(url);
|
||||
requested.push(href);
|
||||
if (href === DEFAULT_A22_CCTV_URL) {
|
||||
return Response.json({ Items: [item()] });
|
||||
}
|
||||
return Response.json([]);
|
||||
});
|
||||
const sources = await createCctvCatalog({ sourceRoot: '/nonexistent' })();
|
||||
return { requested, sources };
|
||||
};
|
||||
|
||||
const withEnv = async (patch, fn) => {
|
||||
const saved = { ...process.env };
|
||||
try {
|
||||
delete process.env.CCTV_SOURCES_FILE;
|
||||
delete process.env.CCTV_SOURCES_JSON;
|
||||
delete process.env.CCTV_A22_ENABLED;
|
||||
Object.assign(process.env, patch);
|
||||
await fn();
|
||||
} finally {
|
||||
for (const key of Object.keys(process.env)) {
|
||||
if (!(key in saved)) delete process.env[key];
|
||||
}
|
||||
Object.assign(process.env, saved);
|
||||
}
|
||||
};
|
||||
|
||||
test('the A22 lane is wired into the catalog', async (t) => {
|
||||
await withEnv({}, async () => {
|
||||
const { requested, sources } = await runCatalog(t);
|
||||
assert.ok(requested.includes(DEFAULT_A22_CCTV_URL));
|
||||
assert.deepEqual(
|
||||
sources.filter((s) => s.cityId === 'a22').map((s) => s.id),
|
||||
['it-a22-km68'],
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
test('CCTV_A22_ENABLED=0 keeps the lane from being loaded', async (t) => {
|
||||
await withEnv({ CCTV_A22_ENABLED: '0' }, async () => {
|
||||
const { requested, sources } = await runCatalog(t);
|
||||
assert.equal(requested.includes(DEFAULT_A22_CCTV_URL), false);
|
||||
assert.deepEqual(
|
||||
sources.filter((s) => s.cityId === 'a22'),
|
||||
[],
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
test('a redirect on the A22 frame host stays inside WebCamImg/', async () => {
|
||||
const frame = `${A22_IMAGE_ORIGIN}km68.jpg`;
|
||||
const redirectTo = (location) => async (url) =>
|
||||
url === frame
|
||||
? new Response(null, { status: 302, headers: { location } })
|
||||
: new Response('frame', { headers: { 'content-type': 'image/jpeg' } });
|
||||
for (const location of ['/it/area-riservata/', '/WebCamImg/../x.jpg'])
|
||||
assert.equal(
|
||||
await fetchWithinHost(frame, {}, redirectTo(location)),
|
||||
null,
|
||||
location,
|
||||
);
|
||||
const followed = await fetchWithinHost(
|
||||
frame,
|
||||
{},
|
||||
redirectTo('/WebCamImg/km77.jpg'),
|
||||
);
|
||||
assert.equal(await followed.text(), 'frame');
|
||||
});
|
||||
|
||||
test('A22 ambient cards refresh on the highway cadence, not the default', () => {
|
||||
const source = a22WebcamToSource(item());
|
||||
assert.equal(staticFrameRefreshMs(source), 3 * 60 * 1000);
|
||||
});
|
||||
@@ -0,0 +1,403 @@
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
|
||||
import {
|
||||
houstonCameraName,
|
||||
houstonCameraToSource,
|
||||
loadHoustonSourcesFromOpenData,
|
||||
} from '../../server/providers/cctv/sources.js';
|
||||
import {
|
||||
DEFAULT_CCTV_MAX_SOURCES,
|
||||
DEFAULT_HOUSTON_MAX_SOURCES,
|
||||
HOUSTON_CAMERAS_URL,
|
||||
HOUSTON_GROUND_ELEVATION_M,
|
||||
HOUSTON_IMAGE_ORIGIN,
|
||||
HOUSTON_IMAGE_URL,
|
||||
HOUSTON_MAX_CATALOG_BYTES,
|
||||
} from '../../server/providers/cctv/constants.js';
|
||||
import {
|
||||
CAMERA_CODE_MAX_CHARS,
|
||||
isLikelyHoustonCoordinate,
|
||||
} from '../../server/providers/cctv/normalize.js';
|
||||
import { createCctvCatalog } from '../../server/providers/cctv/catalog.js';
|
||||
|
||||
/**
|
||||
* A response whose body is a live stream, plus a flag that flips when the
|
||||
* stream is cancelled. A rejection path that returns without cancelling holds
|
||||
* the transport open, so the flag is what the refusal tests actually assert.
|
||||
*/
|
||||
const streamingResponse = (init = {}) => {
|
||||
const state = { cancelled: false };
|
||||
const body = new ReadableStream({
|
||||
start(controller) {
|
||||
controller.enqueue(new TextEncoder().encode('{'));
|
||||
},
|
||||
cancel() {
|
||||
state.cancelled = true;
|
||||
},
|
||||
});
|
||||
return { response: new Response(body, init), state };
|
||||
};
|
||||
|
||||
const DOWNTOWN_ID = '1002';
|
||||
const GALLERIA_ID = '2001';
|
||||
|
||||
/** One TranStar camera row, shaped like the live `cctvSnapshots_json.js` payload. */
|
||||
const row = (overrides = {}) => ({
|
||||
location: '10 EAST @ SAN JACINTO',
|
||||
id: DOWNTOWN_ID,
|
||||
lat: '29.76824',
|
||||
lng: '-95.355711',
|
||||
dir: 'South',
|
||||
fc: '6',
|
||||
fp: '300',
|
||||
url: "showWin('/layers/gc.aspx?cam=1002&loc=IH-10_East_at_SAN_JACINTO')",
|
||||
...overrides,
|
||||
});
|
||||
|
||||
test('a Houston row maps to a source on the pinned HTTPS frame host', () => {
|
||||
const source = houstonCameraToSource(row());
|
||||
assert.equal(source.id, `houston-${DOWNTOWN_ID}`);
|
||||
assert.equal(source.name, '10 EAST @ SAN JACINTO');
|
||||
assert.equal(source.city, 'Houston');
|
||||
assert.equal(source.cityId, 'houston');
|
||||
assert.equal(source.provider, 'Houston TranStar');
|
||||
assert.equal(source.lat, 29.76824);
|
||||
assert.equal(source.lon, -95.355711);
|
||||
assert.equal(source.feedType, 'image');
|
||||
assert.equal(source.sourceKind, 'houston-transtar');
|
||||
assert.equal(
|
||||
source.license,
|
||||
'TranStar disclaimer — redistribution and external framing need TxDOT written permission',
|
||||
);
|
||||
assert.equal(source.groundElevationM, HOUSTON_GROUND_ELEVATION_M);
|
||||
assert.equal(source.url, HOUSTON_IMAGE_URL(DOWNTOWN_ID));
|
||||
assert.equal(source.url, source.snapshotUrl);
|
||||
assert.ok(source.url.startsWith(HOUSTON_IMAGE_ORIGIN));
|
||||
// dir South = the camera sits south of I-10; the nearest lanes run east.
|
||||
assert.equal(source.headingConfidence, 'low');
|
||||
assert.equal(source.headingDeg, 90);
|
||||
});
|
||||
|
||||
test('frame URLs are synthesized from the numeric id; the payload URL is ignored', () => {
|
||||
const source = houstonCameraToSource(
|
||||
row({ url: 'https://evil.example/cameras/x/image' }),
|
||||
);
|
||||
assert.equal(source.url, HOUSTON_IMAGE_URL(DOWNTOWN_ID));
|
||||
assert.equal(source.snapshotUrl, source.url);
|
||||
});
|
||||
|
||||
test('zero ids, off-city geometry and unusable ids are dropped', () => {
|
||||
assert.equal(houstonCameraToSource(row({ id: '0' })), null);
|
||||
assert.equal(houstonCameraToSource(row({ id: '00' })), null);
|
||||
assert.equal(houstonCameraToSource(row({ id: '../etc/passwd' })), null);
|
||||
assert.equal(houstonCameraToSource(row({ id: '12' })), null);
|
||||
assert.equal(houstonCameraToSource(row({ id: '1002/../x' })), null);
|
||||
// Dallas: a plausible lat/lon, but not a Houston camera.
|
||||
assert.equal(
|
||||
houstonCameraToSource(row({ lat: '32.7767', lng: '-96.797' })),
|
||||
null,
|
||||
);
|
||||
assert.equal(houstonCameraToSource(row({ lat: '0', lng: '0' })), null);
|
||||
assert.equal(houstonCameraToSource(null), null);
|
||||
// 3-digit and 5-digit snapshot ids stay.
|
||||
assert.equal(houstonCameraToSource(row({ id: '102' })).id, 'houston-102');
|
||||
assert.equal(houstonCameraToSource(row({ id: '13711' })).id, 'houston-13711');
|
||||
});
|
||||
|
||||
test('dir is the side of the road: it gives a low-confidence travel heading', () => {
|
||||
// TranStar's map reads dir as "Traffic closest to the camera is traveling":
|
||||
// South -> Eastbound, North -> Westbound, West -> Southbound, East -> Northbound.
|
||||
const expected = { South: 90, North: 270, West: 180, East: 0, south: 90 };
|
||||
for (const [dir, heading] of Object.entries(expected)) {
|
||||
const source = houstonCameraToSource(row({ dir }));
|
||||
assert.equal(source.headingDeg, heading, `dir ${dir}`);
|
||||
assert.equal(source.headingConfidence, 'low', `dir ${dir}`);
|
||||
assert.equal(source.pitchDeg, -18, `dir ${dir}`);
|
||||
assert.equal(source.fovDeg, 44, `dir ${dir}`);
|
||||
assert.equal(source.rangeM, 145, `dir ${dir}`);
|
||||
assert.equal(source.mountHeightM, 8, `dir ${dir}`);
|
||||
}
|
||||
|
||||
const none = houstonCameraToSource(row({ dir: 'None' }));
|
||||
assert.equal(none.headingConfidence, 'low');
|
||||
assert.ok(Number.isFinite(none.headingDeg));
|
||||
assert.equal(
|
||||
none.headingDeg,
|
||||
houstonCameraToSource(row({ dir: '' })).headingDeg,
|
||||
);
|
||||
for (const dir of ['Northeast', 'constructor', '__proto__', undefined]) {
|
||||
assert.equal(
|
||||
houstonCameraToSource(row({ dir })).headingDeg,
|
||||
none.headingDeg,
|
||||
`dir ${dir} falls back to the id hash`,
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
test('a nameless row still gets a label', () => {
|
||||
assert.equal(
|
||||
houstonCameraName({ location: ' 45 GULF @ WEST DALLAS ' }, 'houston-102'),
|
||||
'45 GULF @ WEST DALLAS',
|
||||
);
|
||||
assert.equal(houstonCameraName({}, 'houston-102'), 'Houston Camera 102');
|
||||
assert.equal(houstonCameraName({}, ''), 'Houston Camera');
|
||||
});
|
||||
|
||||
test('the unselected label is the interchange, trimmed to the code width', () => {
|
||||
assert.equal(houstonCameraToSource(row()).code, '10 EAST @ SAN JACINTO');
|
||||
const long = houstonCameraToSource(
|
||||
row({
|
||||
location:
|
||||
'IH-10 Katy Managed Lanes Eastbound at a very long interchange name that must truncate',
|
||||
}),
|
||||
);
|
||||
assert.equal(long.code.length, CAMERA_CODE_MAX_CHARS);
|
||||
assert.ok(long.code.endsWith('…'));
|
||||
});
|
||||
|
||||
test('the loader reads the keyless catalog and collapses duplicate ids', async (t) => {
|
||||
t.mock.method(console, 'log', () => {});
|
||||
const requested = [];
|
||||
t.mock.method(globalThis, 'fetch', async (url, init) => {
|
||||
requested.push([String(url), init.headers.Accept, init.redirect]);
|
||||
return Response.json({
|
||||
cameras: [
|
||||
row(),
|
||||
row({ location: '10 EAST @ SAN JACINTO (duplicate)' }),
|
||||
row({
|
||||
id: GALLERIA_ID,
|
||||
location: '610 WEST LOOP @ SAN FELIPE',
|
||||
lat: '29.749',
|
||||
lng: '-95.461',
|
||||
dir: 'North',
|
||||
}),
|
||||
row({ url: 'https://evil.example/x.jpg', id: '0' }),
|
||||
],
|
||||
});
|
||||
});
|
||||
const cameras = await loadHoustonSourcesFromOpenData();
|
||||
assert.deepEqual(requested, [[HOUSTON_CAMERAS_URL, '*/*', 'manual']]);
|
||||
assert.deepEqual(
|
||||
cameras.map((camera) => camera.id),
|
||||
[`houston-${GALLERIA_ID}`, `houston-${DOWNTOWN_ID}`],
|
||||
'nearest-to-anchor first: Uptown sits closer to its pin than downtown does',
|
||||
);
|
||||
assert.equal(cameras[1].name, '10 EAST @ SAN JACINTO');
|
||||
});
|
||||
|
||||
test('an upstream failure yields an empty pack and releases the response', async (t) => {
|
||||
t.mock.method(console, 'warn', () => {});
|
||||
const failed = streamingResponse({ status: 503 });
|
||||
t.mock.method(globalThis, 'fetch', async () => failed.response);
|
||||
assert.deepEqual(await loadHoustonSourcesFromOpenData(), []);
|
||||
assert.equal(failed.state.cancelled, true, 'the failed body is cancelled');
|
||||
|
||||
t.mock.restoreAll();
|
||||
t.mock.method(console, 'warn', () => {});
|
||||
t.mock.method(globalThis, 'fetch', async () => {
|
||||
throw new Error('network down');
|
||||
});
|
||||
assert.deepEqual(await loadHoustonSourcesFromOpenData(), []);
|
||||
});
|
||||
|
||||
test('the catalog fetch refuses redirects and oversized bodies', async (t) => {
|
||||
t.mock.method(console, 'warn', () => {});
|
||||
const seen = [];
|
||||
const redirected = streamingResponse({
|
||||
status: 302,
|
||||
headers: { location: 'https://evil.example/cameras.js' },
|
||||
});
|
||||
t.mock.method(globalThis, 'fetch', async (url, init) => {
|
||||
seen.push([String(url), init.redirect]);
|
||||
return redirected.response;
|
||||
});
|
||||
assert.deepEqual(await loadHoustonSourcesFromOpenData(), []);
|
||||
assert.deepEqual(seen, [[HOUSTON_CAMERAS_URL, 'manual']]);
|
||||
assert.equal(
|
||||
redirected.state.cancelled,
|
||||
true,
|
||||
'the redirect body is cancelled',
|
||||
);
|
||||
|
||||
t.mock.restoreAll();
|
||||
t.mock.method(console, 'warn', () => {});
|
||||
t.mock.method(globalThis, 'fetch', async () => {
|
||||
const body = JSON.stringify({ cameras: [row()] });
|
||||
return new Response(body, {
|
||||
headers: {
|
||||
'Content-Type': 'application/javascript',
|
||||
'content-length': String(HOUSTON_MAX_CATALOG_BYTES + 1),
|
||||
},
|
||||
});
|
||||
});
|
||||
assert.deepEqual(await loadHoustonSourcesFromOpenData(), []);
|
||||
|
||||
t.mock.restoreAll();
|
||||
t.mock.method(console, 'warn', () => {});
|
||||
t.mock.method(globalThis, 'fetch', async () => {
|
||||
// Valid JSON with a usable camera, so only the byte cap can refuse it.
|
||||
const oversized = JSON.stringify({
|
||||
cameras: [row()],
|
||||
padding: 'x'.repeat(HOUSTON_MAX_CATALOG_BYTES + 1024),
|
||||
});
|
||||
return new Response(
|
||||
new ReadableStream({
|
||||
start(controller) {
|
||||
controller.enqueue(new TextEncoder().encode(oversized));
|
||||
controller.close();
|
||||
},
|
||||
}),
|
||||
{ headers: { 'Content-Type': 'application/javascript' } },
|
||||
);
|
||||
});
|
||||
assert.deepEqual(await loadHoustonSourcesFromOpenData(), []);
|
||||
});
|
||||
|
||||
test('a reduced pack cap keeps cameras nearest the metro anchors', async (t) => {
|
||||
t.mock.method(console, 'log', () => {});
|
||||
const saved = process.env.CCTV_HOUSTON_MAX_SOURCES;
|
||||
t.after(() => {
|
||||
if (saved === undefined) delete process.env.CCTV_HOUSTON_MAX_SOURCES;
|
||||
else process.env.CCTV_HOUSTON_MAX_SOURCES = saved;
|
||||
});
|
||||
process.env.CCTV_HOUSTON_MAX_SOURCES = '8';
|
||||
const rows = [
|
||||
...[29.32, 29.322, 29.324, 29.326, 29.328, 29.33].map((lat, i) =>
|
||||
row({
|
||||
id: String(3000 + i),
|
||||
lat: String(lat),
|
||||
lng: '-94.80',
|
||||
location: `Galveston ${i}`,
|
||||
dir: 'East',
|
||||
}),
|
||||
),
|
||||
...[29.76, 29.759, 29.758, 29.757, 29.756, 29.755].map((lat, i) =>
|
||||
row({
|
||||
id: String(4000 + i),
|
||||
lat: String(lat),
|
||||
lng: '-95.3698',
|
||||
location: `Downtown ${i}`,
|
||||
dir: 'North',
|
||||
}),
|
||||
),
|
||||
];
|
||||
t.mock.method(globalThis, 'fetch', async () =>
|
||||
Response.json({ cameras: rows }),
|
||||
);
|
||||
const cameras = await loadHoustonSourcesFromOpenData();
|
||||
assert.equal(cameras.length, 8);
|
||||
assert.deepEqual(
|
||||
cameras.map((camera) => camera.name.slice(0, 8)),
|
||||
[
|
||||
'Downtown',
|
||||
'Downtown',
|
||||
'Downtown',
|
||||
'Downtown',
|
||||
'Downtown',
|
||||
'Downtown',
|
||||
'Galvesto',
|
||||
'Galvesto',
|
||||
],
|
||||
'downtown fills first; the Galveston anchor still keeps a share',
|
||||
);
|
||||
});
|
||||
|
||||
/**
|
||||
* Serve the Houston catalog to the Houston endpoint and an empty payload to
|
||||
* every other pack, so one catalog refresh exercises the registration without
|
||||
* reaching the network.
|
||||
*/
|
||||
const runCatalogWithMockedUpstreams = async (t) => {
|
||||
const requested = [];
|
||||
t.mock.restoreAll();
|
||||
t.mock.method(console, 'log', () => {});
|
||||
t.mock.method(console, 'warn', () => {});
|
||||
t.mock.method(globalThis, 'fetch', async (url) => {
|
||||
const href = String(url);
|
||||
requested.push(href);
|
||||
if (href === HOUSTON_CAMERAS_URL) {
|
||||
return Response.json({
|
||||
cameras: [
|
||||
row(),
|
||||
row({
|
||||
id: GALLERIA_ID,
|
||||
location: '610 WEST LOOP @ SAN FELIPE',
|
||||
lat: '29.749',
|
||||
lng: '-95.461',
|
||||
dir: 'West',
|
||||
}),
|
||||
],
|
||||
});
|
||||
}
|
||||
return Response.json([]);
|
||||
});
|
||||
const sources = await createCctvCatalog({ sourceRoot: '/nonexistent' })();
|
||||
return { requested, sources };
|
||||
};
|
||||
|
||||
test('the Houston lane is wired into the catalog and its loader runs', async (t) => {
|
||||
const saved = { ...process.env };
|
||||
try {
|
||||
delete process.env.CCTV_SOURCES_FILE;
|
||||
delete process.env.CCTV_SOURCES_JSON;
|
||||
process.env.CCTV_HOUSTON_ENABLED = '1';
|
||||
const { requested, sources } = await runCatalogWithMockedUpstreams(t);
|
||||
assert.ok(
|
||||
requested.includes(HOUSTON_CAMERAS_URL),
|
||||
'the catalog refresh invokes the Houston loader',
|
||||
);
|
||||
assert.deepEqual(
|
||||
sources.filter((s) => s.cityId === 'houston').map((s) => s.id),
|
||||
[`houston-${GALLERIA_ID}`, `houston-${DOWNTOWN_ID}`],
|
||||
'Houston cameras reach the served catalog through the registered lane',
|
||||
);
|
||||
} finally {
|
||||
for (const key of Object.keys(process.env)) {
|
||||
if (!(key in saved)) delete process.env[key];
|
||||
}
|
||||
Object.assign(process.env, saved);
|
||||
}
|
||||
});
|
||||
|
||||
test('Houston stays unloaded unless CCTV_HOUSTON_ENABLED=1', async (t) => {
|
||||
const saved = { ...process.env };
|
||||
try {
|
||||
delete process.env.CCTV_SOURCES_FILE;
|
||||
delete process.env.CCTV_SOURCES_JSON;
|
||||
for (const value of [undefined, '0']) {
|
||||
if (value === undefined) delete process.env.CCTV_HOUSTON_ENABLED;
|
||||
else process.env.CCTV_HOUSTON_ENABLED = value;
|
||||
const { requested, sources } = await runCatalogWithMockedUpstreams(t);
|
||||
assert.equal(
|
||||
requested.includes(HOUSTON_CAMERAS_URL),
|
||||
false,
|
||||
'the pack reaches TranStar only after an explicit opt-in',
|
||||
);
|
||||
assert.deepEqual(
|
||||
sources.filter((s) => s.cityId === 'houston'),
|
||||
[],
|
||||
);
|
||||
}
|
||||
} finally {
|
||||
for (const key of Object.keys(process.env)) {
|
||||
if (!(key in saved)) delete process.env[key];
|
||||
}
|
||||
Object.assign(process.env, saved);
|
||||
}
|
||||
});
|
||||
|
||||
test('the shipped catalog ceiling is not raised to make room for this pack', () => {
|
||||
assert.equal(DEFAULT_CCTV_MAX_SOURCES, 4000);
|
||||
assert.equal(DEFAULT_HOUSTON_MAX_SOURCES, 250);
|
||||
});
|
||||
|
||||
test('isLikelyHoustonCoordinate spans the metro and rejects the rest', () => {
|
||||
assert.equal(isLikelyHoustonCoordinate(29.7604, -95.3698), true); // Downtown
|
||||
assert.equal(isLikelyHoustonCoordinate(29.3013, -94.7977), true); // Galveston
|
||||
assert.equal(isLikelyHoustonCoordinate(29.9902, -95.3368), true); // IAH
|
||||
assert.equal(isLikelyHoustonCoordinate(32.7767, -96.797), false); // Dallas
|
||||
assert.equal(isLikelyHoustonCoordinate(30.2672, -97.7431), false); // Austin
|
||||
assert.equal(isLikelyHoustonCoordinate(0, 0), false);
|
||||
assert.equal(isLikelyHoustonCoordinate(NaN, -95.37), false);
|
||||
});
|
||||
@@ -34,6 +34,8 @@ const PROVIDER_STATIC_REFRESH_MS = Object.freeze({
|
||||
'ontario 511': 3 * 60 * 1000,
|
||||
// TxDOT publishes roughly once a minute; 3 min matches the other highway packs.
|
||||
txdot: 3 * 60 * 1000,
|
||||
// TranStar says snapshots update about every 3 minutes.
|
||||
'houston transtar': 3 * 60 * 1000,
|
||||
// Digitraffic publishes a new weathercam frame on each station's
|
||||
// collectionInterval, 600 s for every station sampled; polling faster only
|
||||
// re-fetches the same JPEG.
|
||||
@@ -42,6 +44,9 @@ const PROVIDER_STATIC_REFRESH_MS = Object.freeze({
|
||||
// every 20s showed no change inside 64s but a new frame by ~90-150s later —
|
||||
// matches the other highway packs' 3-minute cadence.
|
||||
'servei català de trànsit': 3 * 60 * 1000,
|
||||
// Autobrennero (A22) refreshes its stills about once a minute (Last-Modified
|
||||
// tracks the minute); 3 min matches the other highway packs.
|
||||
'autostrada del brennero': 3 * 60 * 1000,
|
||||
});
|
||||
|
||||
/**
|
||||
|
||||
@@ -639,6 +639,7 @@ test('staticFrameRefreshMs follows known pack cadences and bounds explicit value
|
||||
assert.equal(staticFrameRefreshMs({ provider: 'Caltrans' }), 180_000);
|
||||
assert.equal(staticFrameRefreshMs({ provider: 'Ontario 511' }), 180_000);
|
||||
assert.equal(staticFrameRefreshMs({ provider: 'TxDOT' }), 180_000);
|
||||
assert.equal(staticFrameRefreshMs({ provider: 'Houston TranStar' }), 180_000);
|
||||
// Digitraffic publishes one weathercam frame per 600 s collection interval.
|
||||
assert.equal(staticFrameRefreshMs({ provider: 'Fintraffic' }), 600_000);
|
||||
assert.equal(
|
||||
|
||||
@@ -0,0 +1,251 @@
|
||||
// src/data/cctvViewThinning.test.mjs — the CCTV view pass: only cameras on or
|
||||
// near the screen show, a zoomed-out view keeps one camera per world-anchored
|
||||
// cell, and the layer's UI state never rebuilds every camera for a listener
|
||||
// that does not read the list.
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import * as Cesium from 'cesium';
|
||||
import cctvLayer, {
|
||||
_setCctvCoverageStateForTest,
|
||||
_viewRecordIdsForTest,
|
||||
refreshHorizonCulling,
|
||||
} from './cctv.js';
|
||||
|
||||
const WIDTH = 800;
|
||||
const HEIGHT = 600;
|
||||
|
||||
/**
|
||||
* Records at the given [lon, lat] degrees near the origin, each drawn at the
|
||||
* screen point `screenAt` gives it (default: the middle of the screen).
|
||||
*/
|
||||
function recordsAt(
|
||||
lonLats,
|
||||
screenAt = () => ({ x: WIDTH / 2, y: HEIGHT / 2 }),
|
||||
) {
|
||||
const screenByPosition = new Map();
|
||||
const records = lonLats.map(([lon, lat], index) => {
|
||||
const position = Cesium.Cartesian3.fromDegrees(lon, lat, 10);
|
||||
screenByPosition.set(position, screenAt(index));
|
||||
return {
|
||||
camera: {
|
||||
id: `cam-${index}`,
|
||||
name: `Camera ${index}`,
|
||||
city: 'Test',
|
||||
lat,
|
||||
lon,
|
||||
headingDeg: 0,
|
||||
pitchDeg: -18,
|
||||
fovDeg: 44,
|
||||
rangeM: 145,
|
||||
mountHeightM: 8,
|
||||
},
|
||||
position,
|
||||
billboard: { position, show: true },
|
||||
coverageEntities: [],
|
||||
projection: null,
|
||||
};
|
||||
});
|
||||
return { records, screenByPosition };
|
||||
}
|
||||
|
||||
function viewerAt(heightM, screenByPosition, shiftX = 0) {
|
||||
return {
|
||||
isDestroyed: () => false,
|
||||
camera: {
|
||||
positionWC: Cesium.Cartesian3.fromDegrees(0, 0, heightM),
|
||||
positionCartographic: { latitude: 0, longitude: 0, height: heightM },
|
||||
frustum: { fovy: Math.PI / 3 },
|
||||
},
|
||||
scene: {
|
||||
canvas: { clientWidth: WIDTH, clientHeight: HEIGHT },
|
||||
cartesianToCanvasCoordinates: (position) => {
|
||||
const screen = screenByPosition.get(position);
|
||||
return screen && { x: screen.x + shiftX, y: screen.y };
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function shownIds(records) {
|
||||
return records
|
||||
.filter((record) => record.billboard.show)
|
||||
.map((record) => record.camera.id)
|
||||
.sort();
|
||||
}
|
||||
|
||||
// Three cameras within ~110 m, and one ~22 km away.
|
||||
const CLUSTER = [
|
||||
[0, 0],
|
||||
[0.001, 0],
|
||||
[0.0005, 0.0005],
|
||||
[0.2, 0],
|
||||
];
|
||||
|
||||
test('zoomed out, cameras sharing a ground cell show one icon', () => {
|
||||
const { records, screenByPosition } = recordsAt(CLUSTER);
|
||||
_setCctvCoverageStateForTest({
|
||||
viewer: viewerAt(20_000, screenByPosition),
|
||||
records,
|
||||
});
|
||||
assert.equal(
|
||||
refreshHorizonCulling(),
|
||||
true,
|
||||
'the first pass changes the view',
|
||||
);
|
||||
const shown = shownIds(records);
|
||||
assert.equal(shown.length, 2, 'one for the cluster, one for the far camera');
|
||||
assert.ok(shown.includes('cam-3'), 'a camera alone in its cell shows');
|
||||
assert.deepEqual(_viewRecordIdsForTest().sort(), shown);
|
||||
});
|
||||
|
||||
test('a pan keeps the same winners, and an unchanged view keeps its list', () => {
|
||||
const { records, screenByPosition } = recordsAt(CLUSTER, (index) => ({
|
||||
x: 100 + index * 7,
|
||||
y: 300,
|
||||
}));
|
||||
_setCctvCoverageStateForTest({
|
||||
viewer: viewerAt(20_000, screenByPosition),
|
||||
records,
|
||||
});
|
||||
refreshHorizonCulling();
|
||||
const before = shownIds(records);
|
||||
const list = _viewRecordIdsForTest();
|
||||
for (const shiftX of [3, 11, 20, 37]) {
|
||||
_setCctvCoverageStateForTest({
|
||||
viewer: viewerAt(20_000, screenByPosition, shiftX),
|
||||
records,
|
||||
});
|
||||
refreshHorizonCulling();
|
||||
assert.deepEqual(shownIds(records), before, `pan by ${shiftX} px`);
|
||||
}
|
||||
assert.equal(refreshHorizonCulling(), false, 'the same view changes nothing');
|
||||
assert.deepEqual(_viewRecordIdsForTest(), list);
|
||||
});
|
||||
|
||||
test('a small zoom within one cell size keeps the same winners', () => {
|
||||
const { records, screenByPosition } = recordsAt(CLUSTER);
|
||||
const shownAt = (heightM) => {
|
||||
_setCctvCoverageStateForTest({
|
||||
viewer: viewerAt(heightM, screenByPosition),
|
||||
records,
|
||||
});
|
||||
refreshHorizonCulling();
|
||||
return shownIds(records);
|
||||
};
|
||||
// Cells come in power-of-two metre steps: about 1.5 km and 1.6 km cells at
|
||||
// these heights fall in the same step, so the same cameras win.
|
||||
assert.deepEqual(shownAt(20_500), shownAt(20_000));
|
||||
});
|
||||
|
||||
test('a healthy camera wins its cell over an unknown one', () => {
|
||||
const { records, screenByPosition } = recordsAt(CLUSTER.slice(0, 2));
|
||||
// Whichever camera the id order would pick, the healthy one must win.
|
||||
for (const id of ['cam-0', 'cam-1']) {
|
||||
_setCctvCoverageStateForTest({
|
||||
viewer: viewerAt(20_000, screenByPosition),
|
||||
records,
|
||||
healthById: new Map([[id, { status: 'ok' }]]),
|
||||
});
|
||||
refreshHorizonCulling();
|
||||
assert.deepEqual(shownIds(records), [id]);
|
||||
}
|
||||
});
|
||||
|
||||
test('the active camera always shows, even in a crowded cell', () => {
|
||||
const { records, screenByPosition } = recordsAt(CLUSTER.slice(0, 3));
|
||||
for (const active of records) {
|
||||
_setCctvCoverageStateForTest({
|
||||
viewer: viewerAt(20_000, screenByPosition),
|
||||
records,
|
||||
activeCameraId: active.camera.id,
|
||||
});
|
||||
refreshHorizonCulling();
|
||||
assert.ok(active.billboard.show, `${active.camera.id} shows while active`);
|
||||
}
|
||||
});
|
||||
|
||||
test('close up, every camera near the screen shows and far-off ones hide', () => {
|
||||
const { records, screenByPosition } = recordsAt(
|
||||
[
|
||||
[0, 0],
|
||||
[0.0001, 0],
|
||||
[0.0002, 0],
|
||||
],
|
||||
(index) =>
|
||||
index === 2 ? { x: WIDTH * 3, y: HEIGHT / 2 } : { x: 100, y: 100 },
|
||||
);
|
||||
_setCctvCoverageStateForTest({
|
||||
viewer: viewerAt(300, screenByPosition),
|
||||
records,
|
||||
});
|
||||
refreshHorizonCulling();
|
||||
assert.deepEqual(shownIds(records), ['cam-0', 'cam-1']);
|
||||
});
|
||||
|
||||
test('a disabled layer skips the view pass', () => {
|
||||
const { records, screenByPosition } = recordsAt(CLUSTER);
|
||||
_setCctvCoverageStateForTest({
|
||||
viewer: viewerAt(20_000, screenByPosition),
|
||||
records,
|
||||
enabled: false,
|
||||
});
|
||||
assert.equal(refreshHorizonCulling(), false);
|
||||
assert.deepEqual(_viewRecordIdsForTest(), []);
|
||||
});
|
||||
|
||||
test('UI state builds the full camera list only when it is read', () => {
|
||||
const { records, screenByPosition } = recordsAt(CLUSTER.slice(0, 2));
|
||||
_setCctvCoverageStateForTest({
|
||||
viewer: viewerAt(300, screenByPosition),
|
||||
records,
|
||||
});
|
||||
refreshHorizonCulling();
|
||||
let built = 0;
|
||||
for (const record of records) {
|
||||
const camera = record.camera;
|
||||
record.camera = new Proxy(camera, {
|
||||
get(target, key) {
|
||||
if (key === 'calibration') built += 1;
|
||||
return target[key];
|
||||
},
|
||||
});
|
||||
}
|
||||
const first = cctvLayer.getUIState();
|
||||
assert.equal(built, 0, 'listeners that skip `cameras` cost nothing');
|
||||
assert.deepEqual(
|
||||
first.cameraIndex.map((camera) => camera.id),
|
||||
['cam-0', 'cam-1'],
|
||||
);
|
||||
assert.equal(
|
||||
cctvLayer.getUIState().cameraIndex,
|
||||
first.cameraIndex,
|
||||
'the index keeps its identity while the view does',
|
||||
);
|
||||
assert.equal(first.cameras.length, 2);
|
||||
assert.ok(built > 0, 'reading `cameras` builds it');
|
||||
assert.equal(first.cameras, first.cameras, 'and builds it once');
|
||||
});
|
||||
|
||||
test('the camera picker lists the view, with the active camera first', () => {
|
||||
const { records, screenByPosition } = recordsAt(
|
||||
[
|
||||
[0, 0],
|
||||
[0.0001, 0],
|
||||
[0.0002, 0],
|
||||
],
|
||||
(index) => (index === 1 ? { x: WIDTH * 3, y: 0 } : { x: 100, y: 100 }),
|
||||
);
|
||||
_setCctvCoverageStateForTest({
|
||||
viewer: viewerAt(300, screenByPosition),
|
||||
records,
|
||||
activeCameraId: 'cam-1',
|
||||
});
|
||||
refreshHorizonCulling();
|
||||
const state = cctvLayer.getUIState();
|
||||
assert.deepEqual(
|
||||
state.cameraIndex.map((camera) => camera.id),
|
||||
['cam-1', 'cam-0', 'cam-2'],
|
||||
'the off-screen active camera leads, then what is in view',
|
||||
);
|
||||
assert.equal(state.cameras.length, 3, 'the full list is still every camera');
|
||||
});
|
||||
+61
-5
@@ -25,11 +25,11 @@ import * as Cesium from 'cesium';
|
||||
* follows DATA_SOURCES.md (live sources, then bundled snapshots).
|
||||
* @type {{ key: string, html: string }[]}
|
||||
*/
|
||||
const OSM_CREDIT = {
|
||||
export const OSM_CREDIT = {
|
||||
key: 'openstreetmap',
|
||||
html: 'Map and place data <a href="https://www.openstreetmap.org/copyright" target="_blank" rel="noopener">© OpenStreetMap contributors</a> (<a href="https://opendatacommons.org/licenses/odbl/1-0/" target="_blank" rel="noopener">ODbL</a>)',
|
||||
};
|
||||
const OPENMAPTILES_CREDIT = {
|
||||
export const OPENMAPTILES_CREDIT = {
|
||||
key: 'openfreemap',
|
||||
html: 'Vector tiles: <a href="https://openfreemap.org" target="_blank" rel="noopener">OpenFreeMap</a> © <a href="https://openmaptiles.org" target="_blank" rel="noopener">OpenMapTiles</a>',
|
||||
};
|
||||
@@ -150,6 +150,20 @@ export const DATA_CREDITS = [
|
||||
key: 'usgs',
|
||||
html: 'Earthquakes: Data courtesy of the U.S. Geological Survey',
|
||||
},
|
||||
{
|
||||
key: 'openseamap',
|
||||
html:
|
||||
'Sea marks overlay: ' +
|
||||
'<a href="https://www.openseamap.org" target="_blank" rel="noopener">© OpenSeaMap contributors</a> (CC BY-SA 2.0) · ' +
|
||||
'Data © OpenStreetMap contributors (ODbL)',
|
||||
},
|
||||
{
|
||||
key: 'opensnowmap',
|
||||
html:
|
||||
'Ski pistes overlay: ' +
|
||||
'<a href="https://www.opensnowmap.org" target="_blank" rel="noopener">© www.opensnowmap.org</a> (CC BY-SA) · ' +
|
||||
'Data © OpenStreetMap contributors (ODbL)',
|
||||
},
|
||||
{
|
||||
key: 'nasa-gibs',
|
||||
html:
|
||||
@@ -167,6 +181,13 @@ export const DATA_CREDITS = [
|
||||
' · Incident information: ' +
|
||||
'<a href="https://inciweb.wildfire.gov/" target="_blank" rel="noopener">InciWeb</a>',
|
||||
},
|
||||
{
|
||||
key: 'faa-sua',
|
||||
html:
|
||||
'Prohibited & restricted airspace: ' +
|
||||
'<a href="https://adds-faa.opendata.arcgis.com/" target="_blank" rel="noopener">FAA Special Use Airspace</a>' +
|
||||
' (prohibited and restricted zones; informational only)',
|
||||
},
|
||||
OSM_CREDIT,
|
||||
OPENMAPTILES_CREDIT,
|
||||
{
|
||||
@@ -297,6 +318,14 @@ export const DATA_CREDITS = [
|
||||
'<a href="https://kingcounty.gov/en/dept/kcit/data-information-services/gis-center/about/terms-conditions-copyrights" target="_blank" rel="noopener">KCGIS Center terms</a>. ' +
|
||||
'Partner-city cameras hosted on the county image handler (e.g. Newcastle) name their owner in the CCTV panel.',
|
||||
},
|
||||
{
|
||||
key: 'houston-cctv',
|
||||
html:
|
||||
'CCTV cameras & frames (Houston, when enabled): ' +
|
||||
'<a href="https://traffic.houstontranstar.org/cctv/transtar/" target="_blank" rel="noopener">Houston TranStar</a>. ' +
|
||||
"Copying, distributing or framing its images needs TxDOT's written permission under the " +
|
||||
'<a href="https://traffic.houstontranstar.org/disclaimer.aspx" target="_blank" rel="noopener">TranStar Content Usage terms</a>',
|
||||
},
|
||||
{
|
||||
key: 'hk-cctv',
|
||||
html:
|
||||
@@ -343,6 +372,13 @@ export const DATA_CREDITS = [
|
||||
key: 'panoramax',
|
||||
html: 'Street Level: imagery © <a href="https://panoramax.fr" target="_blank" rel="noopener">Panoramax</a> contributors, licence per picture',
|
||||
},
|
||||
{
|
||||
key: 'a22-cctv',
|
||||
html:
|
||||
'Motorway webcams (A22 Brennero–Modena): images © ' +
|
||||
'<a href="https://www.autobrennero.it/" target="_blank" rel="noopener">Autostrada del Brennero S.p.A.</a>, ' +
|
||||
'camera list via the <a href="https://opendatahub.com/" target="_blank" rel="noopener">Open Data Hub</a> (NOI Techpark)',
|
||||
},
|
||||
{
|
||||
key: 'gbfs',
|
||||
html:
|
||||
@@ -531,15 +567,35 @@ export const NATURAL_EARTH_CREDIT = {
|
||||
'<a href="https://www.naturalearthdata.com" target="_blank" rel="noopener">Natural Earth</a> (public domain)',
|
||||
};
|
||||
|
||||
/** Registered when the first bundled US county outline resolves (public
|
||||
* domain — credited as a courtesy). */
|
||||
/** Registered when the first bundled US county or place outline resolves
|
||||
* (public domain — credited as a courtesy). */
|
||||
export const US_CENSUS_CREDIT = {
|
||||
key: 'us-census-counties',
|
||||
html:
|
||||
'US county boundaries from the ' +
|
||||
'US county and place boundaries from the ' +
|
||||
'<a href="https://www.census.gov/geographies/mapping-files/time-series/geo/cartographic-boundary.html" target="_blank" rel="noopener">U.S. Census Bureau</a> (public domain)',
|
||||
};
|
||||
|
||||
/** Registered when the first bundled Who's On First neighborhood outline
|
||||
* resolves. The link leads to the pack's per-source credits and licences and
|
||||
* says how the boundaries were modified. */
|
||||
export const WOF_CREDIT = {
|
||||
key: 'wof-neighborhoods',
|
||||
html:
|
||||
'Neighborhood boundaries: ' +
|
||||
'<a href="https://whosonfirst.org/docs/licenses/" target="_blank" rel="noopener">Who\'s On First</a> and contributors, simplified (' +
|
||||
'<a href="https://github.com/bilawalsidhu/gods-eye-view/blob/main/src/data/local_data/wof_neighborhoods/ATTRIBUTION.md" target="_blank" rel="noopener">sources and licences</a>)',
|
||||
};
|
||||
|
||||
/** Registered when a voice place search (a configured Overpass) first shows places. */
|
||||
export const OSM_PLACES_CREDIT = {
|
||||
key: 'osm-places',
|
||||
html:
|
||||
'Places found by voice: ' +
|
||||
'<a href="https://www.openstreetmap.org/copyright" target="_blank" rel="noopener">© OpenStreetMap contributors</a> ' +
|
||||
'(ODbL 1.0)',
|
||||
};
|
||||
|
||||
/**
|
||||
* Per-feed transit credit, registered the first time that feed's vehicles
|
||||
* render (see `src/data/transitFeeds.js` for the license of each).
|
||||
|
||||
@@ -129,6 +129,18 @@ test('the NYC camera credit carries NYC DOT’s requested disclaimer', () => {
|
||||
assert.match(credit.html, /observe posted signage/);
|
||||
});
|
||||
|
||||
test("the Houston camera credit names TranStar's terms and the permission they require", () => {
|
||||
const credit = DATA_CREDITS.find((entry) => entry.key === 'houston-cctv');
|
||||
assert.ok(credit, 'Houston TranStar camera frames must be credited');
|
||||
assert.match(credit.html, /\(Houston, when enabled\)/);
|
||||
assert.ok(
|
||||
credit.html.includes(
|
||||
'href="https://traffic.houstontranstar.org/disclaimer.aspx"',
|
||||
),
|
||||
);
|
||||
assert.match(credit.html, /TxDOT's written permission/);
|
||||
});
|
||||
|
||||
test('every Street Level imagery source is in the attribution lightbox', () => {
|
||||
for (const key of [
|
||||
'mapillary',
|
||||
|
||||
@@ -53,6 +53,12 @@ import {
|
||||
isCyberContactSonarActive as isCyberSonarActive,
|
||||
isCyberContactThemeActive as isCyberMapThemeActive,
|
||||
} from '../cyberSonar.js';
|
||||
import {
|
||||
awarenessEchoActive,
|
||||
awarenessEchoBracket,
|
||||
awarenessEchoColor,
|
||||
getAwarenessEchoField,
|
||||
} from '../awarenessEcho.js';
|
||||
|
||||
/**
|
||||
* @module detection
|
||||
@@ -103,6 +109,8 @@ const SPARSE_ZONE_FRACTION = 0.5;
|
||||
const LABEL_SOLVE_INTERVAL_MS = 125;
|
||||
/** Alpha bands retain bracket batching while approximating a continuous radial fade. */
|
||||
const BRACKET_ALPHA_STEPS = 4;
|
||||
/** Finer bands for Global Context echo brackets, whose fade is animated. */
|
||||
const ECHO_ALPHA_STEPS = 8;
|
||||
/** Stable per-layer candidate safety cap; independent of density and camera bearing. */
|
||||
const LAYER_CANDIDATE_CAP = 2600;
|
||||
const LAYER_WEIGHTS = Object.freeze({
|
||||
@@ -1335,6 +1343,11 @@ function _drawOverlay(frame) {
|
||||
const tiers = _theme.tiers || null;
|
||||
const colorFor = (key) => (tiers && tiers[key]) || _theme.line;
|
||||
const bracketPaths = new Map();
|
||||
// Global Context sonar echoes: a second bracket, banded by strength, around
|
||||
// each flight or vessel a pulse front has just crossed.
|
||||
// Resting pulses light nothing, so the per-contact echo work is skipped.
|
||||
const echoField = awarenessEchoActive(now) ? getAwarenessEchoField() : null;
|
||||
const echoPaths = echoField ? new Array(ECHO_ALPHA_STEPS + 1) : null;
|
||||
const pathFor = (map, color, alpha) => {
|
||||
const band = Math.max(
|
||||
1,
|
||||
@@ -1437,6 +1450,24 @@ function _drawOverlay(frame) {
|
||||
halfH,
|
||||
);
|
||||
visibleCount++;
|
||||
if (echoPaths) {
|
||||
// Starts on the contact's bracket and spreads outward as it fades.
|
||||
const echo = awarenessEchoBracket(
|
||||
obj._layerId,
|
||||
obj.position,
|
||||
now,
|
||||
bracketAlpha,
|
||||
ECHO_ALPHA_STEPS,
|
||||
);
|
||||
if (echo)
|
||||
appendCornerBracket(
|
||||
(echoPaths[echo.band] ??= new Path2D()),
|
||||
sx,
|
||||
sy,
|
||||
halfW + echo.spreadPx,
|
||||
halfH + echo.spreadPx,
|
||||
);
|
||||
}
|
||||
if (obj.type === 'AIR')
|
||||
aircraftBracketSectors[detectionHorizontalSector(sx, width)]++;
|
||||
if (bracketAlpha >= 1) bracketOpacityCounts.full++;
|
||||
@@ -1576,6 +1607,20 @@ function _drawOverlay(frame) {
|
||||
_ctx.stroke(entry.path);
|
||||
}
|
||||
}
|
||||
if (echoPaths) {
|
||||
_ctx.lineWidth = echoField.echo.lineWidth;
|
||||
_ctx.strokeStyle = awarenessEchoColor(
|
||||
_theme.line,
|
||||
_theme === THEME_MAP._default,
|
||||
);
|
||||
for (let band = 1; band <= ECHO_ALPHA_STEPS; band++) {
|
||||
if (!echoPaths[band]) continue;
|
||||
_ctx.globalAlpha =
|
||||
fade * (band / ECHO_ALPHA_STEPS) * bracketPresentationOpacity;
|
||||
_ctx.stroke(echoPaths[band]);
|
||||
}
|
||||
_ctx.lineWidth = bracketWidth;
|
||||
}
|
||||
|
||||
const renderEntries = _labelArbiter.renderEntries(candidateMap, now);
|
||||
const fadingCount = countFadingRenderEntries(renderEntries);
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
// src/data/detectionAwarenessEcho.test.mjs — Global Context sonar echoes pulse
|
||||
// a contact's own detection bracket: a second bracket that starts on it and
|
||||
// spreads outward as it fades, in the detection style's own colour.
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import * as Cesium from 'cesium';
|
||||
import {
|
||||
awarenessEchoBracket,
|
||||
awarenessEchoColor,
|
||||
clearAwarenessEchoField,
|
||||
setAwarenessEchoField,
|
||||
} from '../awarenessEcho.js';
|
||||
import { DETECTION_THEME_MAP } from '../overlays/worldOverlayTokens.js';
|
||||
|
||||
const STEPS = 8;
|
||||
const pulse = { count: 3, periodMs: 9000, startFraction: 0.02 };
|
||||
const echo = {
|
||||
fadeMs: 1400,
|
||||
layerIds: ['flights', 'military', 'ais-live-vessels'],
|
||||
spreadPx: 8,
|
||||
color: 'rgb(98, 181, 255)',
|
||||
};
|
||||
const center = Cesium.Cartesian3.fromDegrees(3, 27, 0);
|
||||
const field = { center, radiusM: 250_000, pulse, echo };
|
||||
|
||||
/** The moment pulse 0's front reaches the ground under `position`. */
|
||||
function arrivalAt(position) {
|
||||
const ground = Cesium.Ellipsoid.WGS84.scaleToGeodeticSurface(position);
|
||||
const d = Cesium.Cartesian3.distance(center, ground);
|
||||
return (
|
||||
((d / 250_000 - pulse.startFraction) / (1 - pulse.startFraction)) *
|
||||
pulse.periodMs +
|
||||
pulse.periodMs * 3
|
||||
);
|
||||
}
|
||||
|
||||
test('the echo bracket pulses outward from the contact bracket and fades', (t) => {
|
||||
t.after(clearAwarenessEchoField);
|
||||
setAwarenessEchoField(field);
|
||||
const position = Cesium.Cartesian3.fromDegrees(3.5, 27, 10_000);
|
||||
const arrival = arrivalAt(position);
|
||||
const at = (nowMs, bracketAlpha = 1) =>
|
||||
awarenessEchoBracket('flights', position, nowMs, bracketAlpha, STEPS);
|
||||
|
||||
// The moment the front arrives: on the bracket, strongest band.
|
||||
const fresh = at(arrival);
|
||||
assert.ok(fresh);
|
||||
assert.ok(Math.abs(fresh.spreadPx) < 0.01, `${fresh.spreadPx}`);
|
||||
assert.equal(fresh.band, STEPS);
|
||||
// Half way through the fade: dimmer and spread outward, but not past
|
||||
// the field's spread.
|
||||
const half = at(arrival + echo.fadeMs / 2);
|
||||
assert.ok(half.spreadPx > echo.spreadPx * 0.5);
|
||||
assert.ok(half.spreadPx < echo.spreadPx);
|
||||
assert.ok(half.band < STEPS && half.band >= 1);
|
||||
// The bracket's own dimming (keyhole fade, Cyber sonar sweep) carries
|
||||
// over, and the echo is never drawn brighter than its bracket: a bracket
|
||||
// too dim for even one band draws no echo.
|
||||
assert.equal(at(arrival, 0.25).band, 2);
|
||||
assert.equal(at(arrival, 0.05), null);
|
||||
for (let alpha = 0.05; alpha <= 1; alpha += 0.05) {
|
||||
const echoed = at(arrival + echo.fadeMs / 3, alpha);
|
||||
if (echoed)
|
||||
assert.ok(
|
||||
echoed.band / STEPS <= alpha + 0.5 / STEPS + 1e-9,
|
||||
`band ${echoed.band} for a bracket at ${alpha}`,
|
||||
);
|
||||
}
|
||||
// Faded out, or between fronts: no echo bracket.
|
||||
assert.equal(at(arrival + echo.fadeMs + 5), null);
|
||||
});
|
||||
|
||||
test('no echo field, or a layer that does not echo, draws nothing extra', (t) => {
|
||||
t.after(clearAwarenessEchoField);
|
||||
const position = Cesium.Cartesian3.fromDegrees(3.01, 27, 0);
|
||||
clearAwarenessEchoField();
|
||||
for (let now = 0; now < pulse.periodMs; now += 25)
|
||||
assert.equal(
|
||||
awarenessEchoBracket('flights', position, now, 1, STEPS),
|
||||
null,
|
||||
);
|
||||
setAwarenessEchoField(field);
|
||||
for (let now = 0; now < pulse.periodMs; now += 25)
|
||||
for (const layerId of ['cctv', 'satellites', 'traffic'])
|
||||
assert.equal(
|
||||
awarenessEchoBracket(layerId, position, now, 1, STEPS),
|
||||
null,
|
||||
);
|
||||
});
|
||||
|
||||
test('echoes take the detection style colour except on the default style', (t) => {
|
||||
t.after(clearAwarenessEchoField);
|
||||
assert.equal(
|
||||
awarenessEchoColor(DETECTION_THEME_MAP._default.line, true),
|
||||
null,
|
||||
);
|
||||
setAwarenessEchoField(field);
|
||||
assert.equal(
|
||||
awarenessEchoColor(DETECTION_THEME_MAP._default.line, true),
|
||||
echo.color,
|
||||
);
|
||||
// CRT, NVG and FLIR keep their monochrome palettes.
|
||||
for (const style of ['retro', 'surveillance', 'thermal']) {
|
||||
const { line } = DETECTION_THEME_MAP[style];
|
||||
assert.equal(awarenessEchoColor(line, false), line, style);
|
||||
}
|
||||
});
|
||||
@@ -24,6 +24,10 @@ import {
|
||||
setOverlayEntries,
|
||||
} from '../overlays/worldOverlay.js';
|
||||
import { DETECTION_THEME_MAP } from '../overlays/worldOverlayTokens.js';
|
||||
import {
|
||||
clearAwarenessEchoField,
|
||||
setAwarenessEchoField,
|
||||
} from '../awarenessEcho.js';
|
||||
import { composeLabel, resolveTier } from './detectionDraw.js';
|
||||
|
||||
test('detection diagnostics count rendered fading rows instead of absent selected identities', () => {
|
||||
@@ -50,8 +54,9 @@ class MockEvent {
|
||||
}
|
||||
|
||||
class MockPath2D {
|
||||
moveTo() {}
|
||||
lineTo() {}
|
||||
constructor() { this.points = []; }
|
||||
moveTo(x, y) { this.points.push([x, y]); }
|
||||
lineTo(x, y) { this.points.push([x, y]); }
|
||||
roundRect() {}
|
||||
arcTo() {}
|
||||
closePath() {}
|
||||
@@ -98,7 +103,7 @@ function mockContext(target, trace) {
|
||||
// set at some point during the frame. globalAlpha rides along for the same
|
||||
// reason: the backdrop feather is an alpha, not a colour.
|
||||
fill(path) { record('fill', path, this.fillStyle, this.globalAlpha); },
|
||||
stroke(path) { record('stroke', path, this.strokeStyle, this.lineWidth); },
|
||||
stroke(path) { record('stroke', path, this.strokeStyle, this.lineWidth, this.globalAlpha); },
|
||||
fillRect(...args) { record('fillRect', ...args); },
|
||||
fillText(...args) { record('fillText', ...args); },
|
||||
drawImage(...args) { record('drawImage', ...args); },
|
||||
@@ -627,6 +632,231 @@ test('surveillance military tier reaches the dedicated render target as shipped
|
||||
}
|
||||
});
|
||||
|
||||
test('Global Context echo brackets reach the canvas in the detection style colour', () => {
|
||||
const env = installEnvironment();
|
||||
// Fronts every millisecond with a long fade, so the contact is lit on
|
||||
// whatever frame paints; a distinctive width picks the echo stroke out.
|
||||
const echo = {
|
||||
layerIds: ['military'],
|
||||
fadeMs: 60_000,
|
||||
color: 'rgb(1, 2, 3)',
|
||||
spreadPx: 8,
|
||||
lineWidth: 3.25,
|
||||
};
|
||||
const echoStrokes = () =>
|
||||
env.detectionCtx.calls
|
||||
.filter(([name, , , width]) => name === 'stroke' && width === echo.lineWidth)
|
||||
.map(([, , style]) => style);
|
||||
try {
|
||||
setAwarenessEchoField({
|
||||
center: Cesium.Cartesian3.fromDegrees(0, 89, 0),
|
||||
radiusM: 250_000,
|
||||
pulse: { count: 1000, periodMs: 1000, startFraction: 0 },
|
||||
echo,
|
||||
});
|
||||
initWorldOverlay(env.viewer);
|
||||
initDetection(env.viewer, [militaryLayer()], () => {});
|
||||
setMode('DENSE');
|
||||
setDetectionStyle('normal');
|
||||
settleFrame(env);
|
||||
assert.ok(echoStrokes().length > 0, 'the echo bracket is painted');
|
||||
assert.ok(echoStrokes().every((style) => style === echo.color));
|
||||
|
||||
// CRT, NVG and FLIR keep their own palettes.
|
||||
for (const style of ['retro', 'surveillance', 'thermal']) {
|
||||
env.detectionCtx.calls.length = 0;
|
||||
setDetectionStyle(style);
|
||||
settleFrame(env);
|
||||
const strokes = echoStrokes();
|
||||
assert.ok(strokes.length > 0, style);
|
||||
assert.ok(
|
||||
strokes.every((stroke) => stroke === DETECTION_THEME_MAP[style].line),
|
||||
`${style} echoes take the style line colour, got ${strokes}`,
|
||||
);
|
||||
}
|
||||
|
||||
} finally {
|
||||
clearAwarenessEchoField();
|
||||
env.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test('a Global Context echo bracket is drawn outside its contact bracket and dimmer than it', () => {
|
||||
const env = installEnvironment();
|
||||
const echo = {
|
||||
layerIds: ['military'],
|
||||
fadeMs: 60_000,
|
||||
color: 'rgb(1, 2, 3)',
|
||||
spreadPx: 8,
|
||||
lineWidth: 3.25,
|
||||
};
|
||||
// Fronts every millisecond keep the echo at full strength; a level of 0.5
|
||||
// halves it, so it sits 4 px out and draws at half the bracket's alpha.
|
||||
try {
|
||||
setAwarenessEchoField({
|
||||
center: Cesium.Cartesian3.fromDegrees(0, 89, 0),
|
||||
radiusM: 250_000,
|
||||
pulse: { count: 1000, periodMs: 1000, startFraction: 0 },
|
||||
echo,
|
||||
level: () => 0.5,
|
||||
});
|
||||
initWorldOverlay(env.viewer);
|
||||
initDetection(env.viewer, [militaryLayer()], () => {});
|
||||
setMode('DENSE');
|
||||
setDetectionStyle('normal');
|
||||
settleFrame(env);
|
||||
env.detectionCtx.calls.length = 0;
|
||||
settleFrame(env);
|
||||
const strokes = env.detectionCtx.calls.filter(([name]) => name === 'stroke');
|
||||
const echoStroke = strokes.find(([, , style, width]) => style === echo.color && width === echo.lineWidth);
|
||||
assert.ok(echoStroke, 'the echo bracket is painted');
|
||||
const bracketStroke = strokes.find(([, path, style, width]) =>
|
||||
path instanceof MockPath2D && path.points.length && width !== echo.lineWidth && style !== echo.color);
|
||||
assert.ok(bracketStroke, 'the contact bracket is painted');
|
||||
const extent = (path) => {
|
||||
const xs = path.points.map(([x]) => x);
|
||||
const ys = path.points.map(([, y]) => y);
|
||||
return { halfW: (Math.max(...xs) - Math.min(...xs)) / 2, halfH: (Math.max(...ys) - Math.min(...ys)) / 2 };
|
||||
};
|
||||
const echoBox = extent(echoStroke[1]);
|
||||
const bracketBox = extent(bracketStroke[1]);
|
||||
assert.ok(Math.abs(echoBox.halfW - bracketBox.halfW - echo.spreadPx / 2) < 1e-3,
|
||||
`echo ${echoBox.halfW} vs bracket ${bracketBox.halfW}`);
|
||||
assert.ok(Math.abs(echoBox.halfH - bracketBox.halfH - echo.spreadPx / 2) < 1e-3);
|
||||
const echoAlpha = echoStroke[4];
|
||||
const bracketAlpha = bracketStroke[4];
|
||||
assert.ok(echoAlpha > 0 && echoAlpha < bracketAlpha, `${echoAlpha} vs ${bracketAlpha}`);
|
||||
assert.ok(Math.abs(echoAlpha - bracketAlpha / 2) < 1e-6, `${echoAlpha} vs ${bracketAlpha}`);
|
||||
} finally {
|
||||
clearAwarenessEchoField();
|
||||
env.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test('under the Cyber sonar sweep an echo is never brighter than its own bracket', () => {
|
||||
const env = installEnvironment();
|
||||
// The cyber theme with its HUD open turns the contact sonar on; its sweep
|
||||
// dims brackets it is not passing over.
|
||||
env.document.documentElement = {
|
||||
// The lowest sweep floor, so dimmed brackets drop a whole alpha band.
|
||||
dataset: { uiTheme: 'cyber', cyberSonarOpacity: '35' },
|
||||
style: { setProperty() {}, removeProperty() {} },
|
||||
};
|
||||
const hud = env.document.createElement('div');
|
||||
hud.id = 'intel-hud';
|
||||
hud.classList = { contains: (name) => name === 'active' };
|
||||
env.document.body.appendChild(hud);
|
||||
const echo = {
|
||||
layerIds: ['military'],
|
||||
fadeMs: 60_000,
|
||||
color: 'rgb(1, 2, 3)',
|
||||
spreadPx: 8,
|
||||
lineWidth: 3.25,
|
||||
};
|
||||
const contact = {
|
||||
id: 'military',
|
||||
getDetectableObjects: () => [{
|
||||
position: new Cesium.Cartesian3(0.5, 0.3, 6_356_752),
|
||||
sourceId: 'sonar-pin',
|
||||
id: 'SONAR',
|
||||
metric: 'FL300',
|
||||
type: 'AIR',
|
||||
tier: 'military',
|
||||
}],
|
||||
};
|
||||
try {
|
||||
setAwarenessEchoField({
|
||||
center: Cesium.Cartesian3.fromDegrees(0, 89, 0),
|
||||
radiusM: 250_000,
|
||||
pulse: { count: 1000, periodMs: 1000, startFraction: 0 },
|
||||
echo,
|
||||
level: () => 1,
|
||||
});
|
||||
initWorldOverlay(env.viewer);
|
||||
initDetection(env.viewer, [contact], () => {});
|
||||
setMode('DENSE');
|
||||
setDetectionStyle('normal');
|
||||
settleFrame(env);
|
||||
let dimmed = 0;
|
||||
let compared = 0;
|
||||
for (let frame = 0; frame < 40; frame++) {
|
||||
env.detectionCtx.calls.length = 0;
|
||||
settleFrame(env);
|
||||
const strokes = env.detectionCtx.calls.filter(([name]) => name === 'stroke');
|
||||
const echoStroke = strokes.find(([, , style, width]) => style === echo.color && width === echo.lineWidth);
|
||||
const bracketStroke = strokes.find(([, path, style, width]) =>
|
||||
path instanceof MockPath2D && path.points.length && width !== echo.lineWidth && style !== echo.color);
|
||||
if (!bracketStroke) continue;
|
||||
const bracketAlpha = bracketStroke[4];
|
||||
if (bracketAlpha < 0.99) dimmed++;
|
||||
if (!echoStroke) continue;
|
||||
compared++;
|
||||
assert.ok(
|
||||
echoStroke[4] <= bracketAlpha + 1e-9,
|
||||
`echo ${echoStroke[4]} over bracket ${bracketAlpha} on frame ${frame}`,
|
||||
);
|
||||
}
|
||||
assert.ok(dimmed > 0, 'the sweep dimmed the bracket on some frame');
|
||||
assert.ok(compared > 0, 'an echo was painted');
|
||||
} finally {
|
||||
clearAwarenessEchoField();
|
||||
env.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test('resting Global Context pulses skip echo work for the whole frame, not per contact', () => {
|
||||
const env = installEnvironment();
|
||||
// Six echo-eligible flights on screen; the identity camera maps x/y
|
||||
// straight to device coordinates.
|
||||
const flights = Array.from({ length: 6 }, (_, index) => ({
|
||||
position: new Cesium.Cartesian3(-0.5 + index * 0.2, 0, 6_356_752),
|
||||
sourceId: `flight-${index}`,
|
||||
id: `ECHO${index}`,
|
||||
metric: `FL${300 + index}`,
|
||||
type: 'AIR',
|
||||
}));
|
||||
const layer = { id: 'flights', getDetectableObjects: () => flights };
|
||||
let levelCalls = 0;
|
||||
try {
|
||||
setAwarenessEchoField({
|
||||
center: Cesium.Cartesian3.fromDegrees(0, 89, 0),
|
||||
radiusM: 250_000,
|
||||
pulse: { count: 1000, periodMs: 1000, startFraction: 0 },
|
||||
echo: {
|
||||
layerIds: ['flights'],
|
||||
fadeMs: 60_000,
|
||||
color: 'rgb(1, 2, 3)',
|
||||
spreadPx: 8,
|
||||
lineWidth: 3.25,
|
||||
},
|
||||
level: () => {
|
||||
levelCalls++;
|
||||
return 0;
|
||||
},
|
||||
});
|
||||
initWorldOverlay(env.viewer);
|
||||
initDetection(env.viewer, [layer], () => {});
|
||||
setMode('DENSE');
|
||||
settleFrame(env);
|
||||
levelCalls = 0;
|
||||
settleFrame(env);
|
||||
const painted = getDetectionDiagnostics().visibleCount;
|
||||
assert.equal(painted, flights.length, 'every flight is on screen');
|
||||
// One check per painted frame, however many contacts are on screen.
|
||||
assert.ok(levelCalls >= 1, 'the frame asks whether echoes are live');
|
||||
assert.ok(levelCalls < painted, `${levelCalls} level checks for ${painted} contacts`);
|
||||
assert.ok(
|
||||
!env.detectionCtx.calls.some(
|
||||
([name, , style]) => name === 'stroke' && style === 'rgb(1, 2, 3)',
|
||||
),
|
||||
'no echoes while the pulses rest',
|
||||
);
|
||||
} finally {
|
||||
clearAwarenessEchoField();
|
||||
env.cleanup();
|
||||
}
|
||||
});
|
||||
|
||||
test('pathological detection paint holds alternate frames without freezing shared lanes', () => {
|
||||
// Opts into the telemetry banner: the held-frame assertions count banner paints.
|
||||
const env = installEnvironment({ search: '?detectDebug=1' });
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { expandApplicationHtml } from '../../build/application-html.js';
|
||||
import { renderApplicationHtml } from '../testSupport/applicationHtml.mjs';
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
@@ -19,7 +19,7 @@ import {
|
||||
} from './detectionPolicy.js';
|
||||
import { KEYHOLE_OUTSIDE_OPACITY_DEFAULT } from '../celestialRing.js';
|
||||
|
||||
const indexHtml = expandApplicationHtml(fs.readFileSync(new URL('../../index.html', import.meta.url), 'utf8'));
|
||||
const indexHtml = await renderApplicationHtml(fs.readFileSync(new URL('../../index.html', import.meta.url), 'utf8'));
|
||||
|
||||
test('side aircraft brackets stay readable without changing zero-opacity intent', () => {
|
||||
assert.equal(detectionBracketAlpha('AIR', 0), 0);
|
||||
|
||||
@@ -849,6 +849,8 @@ test('route numbers follow the page language and never break from their unit', (
|
||||
assert.equal(routeDistanceText(994), '990\u00a0m');
|
||||
assert.equal(routeDistanceText(996), '1.0\u00a0km');
|
||||
assert.equal(routeDistanceText(1500), '1.5\u00a0km');
|
||||
assert.equal(routeDistanceText(9940), '9.9\u00a0km');
|
||||
assert.equal(routeDistanceText(9960), '10\u00a0km');
|
||||
assert.equal(routeDistanceText(2_345_000), '2345\u00a0km');
|
||||
assert.equal(routeDurationText(39), '39\u00a0s');
|
||||
assert.equal(routeDurationText(59.4), '59\u00a0s');
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Kilometre decimals for a distance: one below 10 km, none from there on.
|
||||
* The cut is taken on the tenth that prints, so 9.96 km reads 10 km, not 10.0.
|
||||
* @param {number} meters
|
||||
* @returns {0|1}
|
||||
*/
|
||||
export function kilometreDigits(meters) {
|
||||
return Math.round(meters / 100) < 100 ? 1 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* The unit and precision a distance prints with: metres below 1 km, then
|
||||
* kilometres with `kilometreDigits`. Metres round to `metreStep` (10 for tens),
|
||||
* except below `exactBelowM`, where they stay whole. Each cut is taken after
|
||||
* rounding, so 999.6 m reads 1.0 km rather than 1000 m.
|
||||
* @param {number} meters
|
||||
* @param {{metreStep?: number, exactBelowM?: number}} [options]
|
||||
* @returns {{value: number, unit: 'm'|'km', digits: 0|1}|null} null for a
|
||||
* distance that is negative or not finite. The value is already rounded to
|
||||
* `digits`, so toFixed and Intl render it the same way.
|
||||
*/
|
||||
export function distanceParts(meters, { metreStep = 1, exactBelowM = 0 } = {}) {
|
||||
if (!Number.isFinite(meters) || meters < 0) return null;
|
||||
const step = meters < exactBelowM ? 1 : metreStep;
|
||||
const shownMeters = Math.round(meters / step) * step;
|
||||
if (shownMeters < 1000) return { value: shownMeters, unit: 'm', digits: 0 };
|
||||
const digits = kilometreDigits(meters);
|
||||
const value =
|
||||
digits === 1 ? Math.round(meters / 100) / 10 : Math.round(meters / 1000);
|
||||
return { value, unit: 'km', digits };
|
||||
}
|
||||
|
||||
/**
|
||||
* Plain `850 m` / `4.6 km` / `12 km` text for labels that are not localized.
|
||||
* @param {number} meters
|
||||
* @param {{metreStep?: number, exactBelowM?: number}} [options]
|
||||
* @returns {string|null}
|
||||
*/
|
||||
export function formatDistanceText(meters, options) {
|
||||
const parts = distanceParts(meters, options);
|
||||
if (!parts) return null;
|
||||
return `${parts.value.toFixed(parts.digits)} ${parts.unit}`;
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import {
|
||||
distanceParts,
|
||||
formatDistanceText,
|
||||
kilometreDigits,
|
||||
} from './distanceFormat.js';
|
||||
|
||||
test('a distance switches to kilometres where its metres round to 1,000', () => {
|
||||
assert.equal(formatDistanceText(999.4), '999 m');
|
||||
assert.equal(formatDistanceText(999.5), '1.0 km');
|
||||
assert.equal(formatDistanceText(999.6), '1.0 km');
|
||||
assert.equal(formatDistanceText(994, { metreStep: 10 }), '990 m');
|
||||
assert.equal(formatDistanceText(995, { metreStep: 10 }), '1.0 km');
|
||||
});
|
||||
|
||||
test('kilometres drop their decimal where the tenth rounds to 10.0', () => {
|
||||
assert.equal(kilometreDigits(9949), 1);
|
||||
assert.equal(kilometreDigits(9950), 0);
|
||||
assert.equal(formatDistanceText(9949), '9.9 km');
|
||||
assert.equal(formatDistanceText(9950), '10 km');
|
||||
assert.equal(formatDistanceText(9960), '10 km');
|
||||
assert.equal(formatDistanceText(99950), '100 km');
|
||||
});
|
||||
|
||||
test('metres below exactBelowM stay whole while the rest round to the step', () => {
|
||||
const options = { metreStep: 10, exactBelowM: 100 };
|
||||
assert.equal(formatDistanceText(8, options), '8 m');
|
||||
assert.equal(formatDistanceText(99.4, options), '99 m');
|
||||
assert.equal(formatDistanceText(846, options), '850 m');
|
||||
assert.deepEqual(distanceParts(846, options), {
|
||||
value: 850,
|
||||
unit: 'm',
|
||||
digits: 0,
|
||||
});
|
||||
});
|
||||
|
||||
test('a negative or non-finite distance has no parts', () => {
|
||||
for (const value of [-1, Number.NaN, Infinity, -Infinity, null, undefined]) {
|
||||
assert.equal(distanceParts(value), null);
|
||||
assert.equal(formatDistanceText(value), null);
|
||||
}
|
||||
assert.equal(formatDistanceText(0), '0 m');
|
||||
});
|
||||
|
||||
test('kilometres come back rounded, so toFixed and Intl agree', () => {
|
||||
assert.deepEqual(distanceParts(1450), { value: 1.5, unit: 'km', digits: 1 });
|
||||
assert.equal(formatDistanceText(1450), '1.5 km');
|
||||
assert.equal(formatDistanceText(1150), '1.2 km');
|
||||
});
|
||||
@@ -0,0 +1,292 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { droneAirspaceProxy } from '../../server/providers/droneAirspace.js';
|
||||
|
||||
const feature = (id = 310, type = 'P') => ({
|
||||
properties: {
|
||||
NAME: `${type}-${id}`,
|
||||
TYPE_CODE: type,
|
||||
OBJECTID: id,
|
||||
UPPER_DESC: 'TNI',
|
||||
},
|
||||
geometry: {
|
||||
type: 'Polygon',
|
||||
coordinates: [
|
||||
[
|
||||
[-77, 38],
|
||||
[-76, 38],
|
||||
[-76, 39],
|
||||
[-77, 38],
|
||||
],
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
function install(options = {}, hook = 'configureServer') {
|
||||
let handler;
|
||||
const plugin = droneAirspaceProxy(options);
|
||||
assert.equal(typeof plugin.configureServer, 'function');
|
||||
assert.equal(typeof plugin.configurePreviewServer, 'function');
|
||||
plugin[hook]({
|
||||
middlewares: {
|
||||
use(path, callback) {
|
||||
assert.equal(path, '/api/drone-airspace');
|
||||
handler = callback;
|
||||
},
|
||||
},
|
||||
});
|
||||
return async (url = '/', method = 'GET', peer = 'local', headers = {}) => {
|
||||
const res = {
|
||||
headers: {},
|
||||
writeHead(status, headers) {
|
||||
this.status = status;
|
||||
this.headers = headers;
|
||||
},
|
||||
setHeader(name, value) {
|
||||
this.headers[name] = value;
|
||||
},
|
||||
end(body) {
|
||||
this.status ??= this.statusCode;
|
||||
this.body = JSON.parse(body);
|
||||
},
|
||||
};
|
||||
await handler(
|
||||
{ url, method, headers, socket: { remoteAddress: peer } },
|
||||
res,
|
||||
);
|
||||
return res;
|
||||
};
|
||||
}
|
||||
|
||||
for (const hook of ['configureServer', 'configurePreviewServer']) {
|
||||
test(`${hook}: paging follows offsets and normalizes the combined snapshot`, async () => {
|
||||
const calls = [];
|
||||
const request = install(
|
||||
{
|
||||
now: () => 1234,
|
||||
fetchImpl: async (url, options) => {
|
||||
calls.push(new URL(url));
|
||||
assert.ok(options.signal instanceof AbortSignal);
|
||||
assert.equal(options.redirect, 'error');
|
||||
return Response.json({
|
||||
features: [feature(calls.length)],
|
||||
exceededTransferLimit: calls.length < 3,
|
||||
});
|
||||
},
|
||||
},
|
||||
hook,
|
||||
);
|
||||
const res = await request('/?url=https://invalid.example&resultOffset=999');
|
||||
assert.equal(res.status, 200);
|
||||
assert.equal(res.body.fetchedAt, 1234);
|
||||
assert.equal(res.body.rows.length, 3);
|
||||
assert.equal(calls.length, 3);
|
||||
assert.equal(calls[0].searchParams.get('where'), "TYPE_CODE IN ('P','R')");
|
||||
assert.equal(calls[0].searchParams.get('f'), 'geojson');
|
||||
assert.equal(calls[0].searchParams.has('resultOffset'), false);
|
||||
assert.equal(calls[1].searchParams.get('resultOffset'), '1');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Serve one good snapshot, then let the upstream answer `bad` after the TTL:
|
||||
* the bad answer must not replace it, so the client gets the last good rows
|
||||
* marked stale, and a cold proxy answers 502 rather than caching the bad one.
|
||||
*/
|
||||
async function assertRejectedSnapshot(bad) {
|
||||
let now = 1000;
|
||||
let broken = false;
|
||||
let calls = 0;
|
||||
const request = install({
|
||||
now: () => now,
|
||||
fetchImpl: async () => {
|
||||
calls += 1;
|
||||
return broken ? bad(calls) : Response.json({ features: [feature(7)] });
|
||||
},
|
||||
});
|
||||
const first = await request();
|
||||
assert.equal(first.status, 200);
|
||||
broken = true;
|
||||
now += 3_600_001;
|
||||
const stale = await request();
|
||||
assert.equal(stale.status, 200);
|
||||
assert.equal(stale.headers['X-Data-Stale'], 'true');
|
||||
assert.equal(stale.body.stale, true);
|
||||
assert.equal(stale.body.fetchedAt, first.body.fetchedAt);
|
||||
assert.deepEqual(
|
||||
stale.body.rows.map((row) => row.stableId),
|
||||
['7'],
|
||||
);
|
||||
calls = 0;
|
||||
const cold = install({ fetchImpl: async () => bad(++calls) });
|
||||
const res = await cold();
|
||||
assert.equal(res.status, 502);
|
||||
assert.equal(res.body.error, 'drone_airspace_unavailable');
|
||||
}
|
||||
|
||||
test('an empty upstream snapshot keeps the last good one', () =>
|
||||
assertRejectedSnapshot(() => Response.json({ features: [] })));
|
||||
|
||||
test('a page whose every feature is invalid keeps the last good one', () =>
|
||||
assertRejectedSnapshot(() =>
|
||||
Response.json({
|
||||
features: [
|
||||
{
|
||||
...feature(8),
|
||||
properties: { ...feature(8).properties, TYPE_CODE: 'W' },
|
||||
},
|
||||
{ ...feature(9), geometry: null },
|
||||
],
|
||||
}),
|
||||
));
|
||||
|
||||
test('paging that exhausts its page limit still flagged keeps the last good one', () =>
|
||||
assertRejectedSnapshot((call) =>
|
||||
Response.json({
|
||||
features: [feature(100 + call)],
|
||||
exceededTransferLimit: true,
|
||||
}),
|
||||
));
|
||||
|
||||
test('a flagged page that adds no features keeps the last good one', () =>
|
||||
assertRejectedSnapshot((call) =>
|
||||
Response.json(
|
||||
call % 2
|
||||
? { features: [feature(100 + call)], exceededTransferLimit: true }
|
||||
: { features: [], properties: { exceededTransferLimit: true } },
|
||||
),
|
||||
));
|
||||
|
||||
test('a cached snapshot is reused until TTL, then refreshed', async () => {
|
||||
let now = 1000;
|
||||
let fetches = 0;
|
||||
const request = install({
|
||||
now: () => now,
|
||||
fetchImpl: async () => {
|
||||
fetches += 1;
|
||||
return Response.json({ features: [feature(fetches)] });
|
||||
},
|
||||
});
|
||||
const first = await request();
|
||||
now += 3_599_000;
|
||||
const cached = await request();
|
||||
now += 2000;
|
||||
const refreshed = await request();
|
||||
assert.equal(first.body.rows[0].stableId, '1');
|
||||
assert.equal(cached.body.rows[0].stableId, '1');
|
||||
assert.equal(refreshed.body.rows[0].stableId, '2');
|
||||
assert.equal(fetches, 2);
|
||||
});
|
||||
|
||||
test('a failed refresh serves the last good snapshot as stale', async () => {
|
||||
let now = 1000;
|
||||
let fail = false;
|
||||
const request = install({
|
||||
now: () => now,
|
||||
fetchImpl: async () => {
|
||||
if (fail) return new Response('nope', { status: 503 });
|
||||
return Response.json({ features: [feature(7)] });
|
||||
},
|
||||
});
|
||||
const first = await request();
|
||||
fail = true;
|
||||
now += 3_600_001;
|
||||
const stale = await request();
|
||||
assert.equal(first.status, 200);
|
||||
assert.equal(stale.status, 200);
|
||||
assert.equal(stale.headers['X-Data-Stale'], 'true');
|
||||
assert.equal(stale.body.stale, true);
|
||||
assert.equal(stale.body.rows[0].stableId, '7');
|
||||
});
|
||||
|
||||
test('method, unknown routes and rate limits are rejected', async () => {
|
||||
const request = install({
|
||||
fetchImpl: async () => Response.json({ features: [feature()] }),
|
||||
});
|
||||
assert.equal((await request('/', 'POST')).status, 405);
|
||||
assert.equal((await request('/nope')).status, 404);
|
||||
const limited = install({
|
||||
fetchImpl: async () => Response.json({ features: [feature()] }),
|
||||
});
|
||||
let last;
|
||||
for (let i = 0; i < 61; i++) last = await limited('/', 'GET', '10.0.0.9');
|
||||
assert.equal(last.status, 429);
|
||||
});
|
||||
|
||||
test('a cold upstream failure is 502, not an empty snapshot', async () => {
|
||||
const request = install({
|
||||
fetchImpl: async () => new Response('nope', { status: 503 }),
|
||||
});
|
||||
const res = await request();
|
||||
assert.equal(res.status, 502);
|
||||
assert.equal(res.body.error, 'drone_airspace_unavailable');
|
||||
});
|
||||
|
||||
test('a stale snapshot is served for at most a day, then refused', async () => {
|
||||
let now = 1_000_000_000;
|
||||
let up = true;
|
||||
const request = install({
|
||||
now: () => now,
|
||||
fetchImpl: async () => {
|
||||
if (!up) throw new Error('FAA unreachable');
|
||||
return Response.json({ features: [feature(7)] });
|
||||
},
|
||||
});
|
||||
const fresh = await request();
|
||||
assert.equal(fresh.status, 200);
|
||||
up = false;
|
||||
now += 23 * 60 * 60 * 1000;
|
||||
const stale = await request();
|
||||
assert.equal(stale.status, 200);
|
||||
assert.equal(stale.body.stale, true);
|
||||
assert.equal(stale.body.fetchedAt, fresh.body.fetchedAt);
|
||||
now += 2 * 60 * 60 * 1000;
|
||||
assert.equal((await request()).status, 502, 'a day-old snapshot is refused');
|
||||
});
|
||||
|
||||
test('a cross-site page is refused before it spends quota or reaches FAA', async () => {
|
||||
let fetches = 0;
|
||||
const request = install({
|
||||
fetchImpl: async () => {
|
||||
fetches += 1;
|
||||
return Response.json({ features: [feature()] });
|
||||
},
|
||||
});
|
||||
const host = 'localhost:5173';
|
||||
const refused = [
|
||||
{ host, 'sec-fetch-site': 'cross-site' },
|
||||
{ host, origin: 'https://evil.example' },
|
||||
{ host, origin: 'https://evil.example', 'sec-fetch-site': 'cross-site' },
|
||||
{ host, 'x-forwarded-for': '203.0.113.9', 'sec-fetch-site': 'cross-site' },
|
||||
];
|
||||
// More refusals than the 60/min per-client quota, all from one peer.
|
||||
for (let i = 0; i < 64; i++) {
|
||||
const headers = refused[i % refused.length];
|
||||
const res = await request('/', 'GET', '10.0.0.5', headers);
|
||||
assert.equal(res.status, 403, JSON.stringify(headers));
|
||||
}
|
||||
assert.equal(fetches, 0, 'refusals cost no upstream call');
|
||||
const app = await request('/', 'GET', '10.0.0.5', {
|
||||
host,
|
||||
origin: `http://${host}`,
|
||||
'sec-fetch-site': 'same-origin',
|
||||
});
|
||||
assert.equal(app.status, 200, 'the app keeps its full quota');
|
||||
assert.equal(fetches, 1);
|
||||
});
|
||||
|
||||
test('the app served behind a reverse proxy still gets the zones', async () => {
|
||||
const request = install({
|
||||
fetchImpl: async () => Response.json({ features: [feature()] }),
|
||||
});
|
||||
const host = 'gev.example.com';
|
||||
const res = await request('/', 'GET', '127.0.0.1', {
|
||||
host,
|
||||
origin: `https://${host}`,
|
||||
'sec-fetch-site': 'same-origin',
|
||||
'x-forwarded-for': '203.0.113.9',
|
||||
'x-forwarded-proto': 'https',
|
||||
});
|
||||
assert.equal(res.status, 200);
|
||||
assert.equal(res.body.rows.length, 1);
|
||||
});
|
||||
@@ -14,6 +14,7 @@ import {
|
||||
FIRMS_OVERLAY_SOURCE_ID,
|
||||
} from './firmsLabels.js';
|
||||
import { FIRE_ANCHOR_LIFT_M } from './fireAnchors.js';
|
||||
import { getLocale, setLocale } from '../i18n/index.js';
|
||||
import { reportMeshFloorCell, setMeshFloorPreferred } from './groundFloor.js';
|
||||
|
||||
const NOW = Date.UTC(2026, 6, 17, 4, 0);
|
||||
@@ -100,6 +101,30 @@ test('buildCellCard: plural noun, max FRP and newest age, accent passthrough', (
|
||||
assert.equal(card.accent, accentForSeverity('orange'));
|
||||
});
|
||||
|
||||
test('buildCellCard: the count picks the plural form of the language', () => {
|
||||
const title = (count) =>
|
||||
buildCellCard(
|
||||
{
|
||||
cell: { count, maxFrp: 10, newestAcqMs: 0 },
|
||||
position: { x: 0, y: 0, z: 0 },
|
||||
},
|
||||
NOW,
|
||||
).title;
|
||||
const previous = getLocale();
|
||||
try {
|
||||
assert.equal(title(1), '1 FIRE');
|
||||
setLocale('ar');
|
||||
assert.deepEqual(
|
||||
[2, 3, 14].map((count) => title(count).replace(/[\u2068\u2069]/g, '')),
|
||||
['حريقان (2)', '3 حرائق', '14 حريقًا'],
|
||||
);
|
||||
setLocale('ru');
|
||||
assert.equal(title(14), '14 ПОЖАРОВ');
|
||||
} finally {
|
||||
setLocale(previous);
|
||||
}
|
||||
});
|
||||
|
||||
// Owner field finding 2026-07-21: anchors must sit on the DEM once the shared
|
||||
// ground floor is warm — and the cached per-fire position must re-anchor when
|
||||
// the floor lands AFTER the first (cold, height-0) render. Distinct coords
|
||||
|
||||
@@ -1,7 +1,19 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import fs from 'node:fs';
|
||||
import test from 'node:test';
|
||||
import { EventEmitter } from 'node:events';
|
||||
import dns from 'node:dns/promises';
|
||||
import dnsLookup from 'node:dns';
|
||||
import https from 'node:https';
|
||||
import net from 'node:net';
|
||||
import { Readable } from 'node:stream';
|
||||
import { filterTrailing24h, parseFirmsCsv } from './firmsCsv.js';
|
||||
import {
|
||||
describeFetchError,
|
||||
fetchFirms,
|
||||
fetchIpv4,
|
||||
isAddressSelectionFailure,
|
||||
} from '../../server/providers/firms.js';
|
||||
|
||||
const config = fs.readFileSync(new URL('../../server/providers/firms.js', import.meta.url), 'utf8');
|
||||
const start = config.indexOf(' async function refreshUpstream(key) {');
|
||||
@@ -17,8 +29,8 @@ const recent = { acqDate: '2026-09-11', acqTime: '1100' };
|
||||
// Inject only its upstream, clock and filter dependencies; keep its aggregation
|
||||
// and source-status code intact, including failures while consuming records.
|
||||
function createRefresh(fetchSource, filter = filterTrailing24h) {
|
||||
return new Function('SOURCES', 'fetchSource', 'filterTrailing24h', 'Date', 'console',
|
||||
`return (${refreshSource});`)(SOURCES, fetchSource, filter, { now: () => NOW }, { warn() {} });
|
||||
return new Function('SOURCES', 'fetchSource', 'filterTrailing24h', 'describeFetchError', 'Date', 'console',
|
||||
`return (${refreshSource});`)(SOURCES, fetchSource, filter, describeFetchError, { now: () => NOW }, { warn() {} });
|
||||
}
|
||||
|
||||
test('FIRMS retains large sources in order and filters expired rows', async () => {
|
||||
@@ -78,3 +90,220 @@ test('FIRMS distinguishes all-source failure from successful empty sources', asy
|
||||
assert.deepEqual(result.fires, []);
|
||||
assert.deepEqual(result.sources, SOURCES.map(source => ({ source, count: 0, ok: true })));
|
||||
});
|
||||
|
||||
// #68: Node's network-family auto-selection gives each address a short attempt
|
||||
// timeout, abandons a slow IPv4 handshake for an unreachable IPv6 address, and
|
||||
// reports only `fetch failed`. This is the shape Node 24 throws for it.
|
||||
function addressSelectionFailure() {
|
||||
const v4 = Object.assign(new Error('connect ETIMEDOUT 198.118.194.34:443'), { code: 'ETIMEDOUT' });
|
||||
const v6 = Object.assign(new Error('connect ENETUNREACH 2001:4d0:241a:40c0::34:443'), { code: 'ENETUNREACH' });
|
||||
const cause = Object.assign(new AggregateError([v4, v6]), { code: 'ETIMEDOUT' });
|
||||
return new TypeError('fetch failed', { cause });
|
||||
}
|
||||
// Node 26's fetch wraps the same AggregateError in a ConnectTimeoutError.
|
||||
function wrappedAddressSelectionFailure() {
|
||||
const inner = addressSelectionFailure().cause;
|
||||
const cause = Object.assign(new Error('Connect Timeout Error (attempted addresses: 198.118.194.34:443, 2001:4d0:241a:40c0::34:443, timeout: 10000ms)'),
|
||||
{ name: 'ConnectTimeoutError', code: 'UND_ERR_CONNECT_TIMEOUT', cause: inner });
|
||||
return new TypeError('fetch failed', { cause });
|
||||
}
|
||||
const URL_WITH_KEY = 'https://firms.modaps.eosdis.nasa.gov/api/area/csv/SECRET/VIIRS_SNPP_NRT/world/2';
|
||||
|
||||
test('FIRMS failures log the socket cause, never the keyed URL', () => {
|
||||
const described = describeFetchError(addressSelectionFailure());
|
||||
assert.equal(described,
|
||||
'fetch failed (connect ETIMEDOUT 198.118.194.34:443; connect ENETUNREACH 2001:4d0:241a:40c0::34:443)');
|
||||
assert.ok(!described.includes('SECRET'));
|
||||
assert.equal(describeFetchError(wrappedAddressSelectionFailure()), described, 'Node 26 reports the same attempts');
|
||||
const single = new TypeError('fetch failed', { cause: Object.assign(new Error('getaddrinfo ENOTFOUND x'), { code: 'ENOTFOUND' }) });
|
||||
assert.equal(describeFetchError(single), 'fetch failed (getaddrinfo ENOTFOUND x)');
|
||||
assert.equal(describeFetchError(new Error('HTTP 503')), 'HTTP 503');
|
||||
});
|
||||
|
||||
test('FIRMS retries once over IPv4 when every address fails to connect', async () => {
|
||||
for (const shape of [addressSelectionFailure, wrappedAddressSelectionFailure]) {
|
||||
const retried = [];
|
||||
await fetchFirms(URL_WITH_KEY, {}, {
|
||||
fetchImpl: async () => { throw shape(); },
|
||||
fetchIpv4Impl: async (url) => { retried.push(url); return new Response('csv'); },
|
||||
warn() {},
|
||||
});
|
||||
assert.deepEqual(retried, [URL_WITH_KEY], `${shape.name} is retried`);
|
||||
}
|
||||
const signal = new AbortController().signal;
|
||||
const ok = new Response('csv');
|
||||
const retried = [];
|
||||
const warnings = [];
|
||||
const response = await fetchFirms(URL_WITH_KEY, { signal }, {
|
||||
fetchImpl: async () => { throw addressSelectionFailure(); },
|
||||
fetchIpv4Impl: async (url, options) => { retried.push([url, options]); return ok; },
|
||||
warn: (message) => warnings.push(message),
|
||||
});
|
||||
assert.equal(response, ok);
|
||||
assert.deepEqual(retried, [[URL_WITH_KEY, { signal }]], 'one retry, same URL and deadline');
|
||||
assert.equal(warnings.length, 1);
|
||||
assert.match(warnings[0], /ETIMEDOUT 198\.118\.194\.34:443; .*ENETUNREACH .* retrying over IPv4/);
|
||||
assert.ok(!warnings[0].includes('SECRET'));
|
||||
|
||||
const failure = new Error('connect ETIMEDOUT 198.118.194.34:443');
|
||||
await assert.rejects(fetchFirms(URL_WITH_KEY, {}, {
|
||||
fetchImpl: async () => { throw addressSelectionFailure(); },
|
||||
fetchIpv4Impl: async () => { throw failure; },
|
||||
warn() {},
|
||||
}), (err) => err === failure, 'a failed retry reports its own error');
|
||||
});
|
||||
|
||||
test('FIRMS does not retry anything but an address-selection failure', async () => {
|
||||
const deps = (fetchImpl) => ({
|
||||
fetchImpl,
|
||||
fetchIpv4Impl: async () => assert.fail('must not retry'),
|
||||
warn: () => assert.fail('must not warn'),
|
||||
});
|
||||
const serverError = new Response('down', { status: 503 });
|
||||
assert.equal(await fetchFirms(URL_WITH_KEY, {}, deps(async () => serverError)), serverError);
|
||||
for (const thrown of [
|
||||
new TypeError('fetch failed', { cause: Object.assign(new Error('getaddrinfo ENOTFOUND x'), { code: 'ENOTFOUND' }) }),
|
||||
new TypeError('fetch failed', { cause: new AggregateError([]) }),
|
||||
new TypeError('fetch failed'),
|
||||
new DOMException('The operation was aborted due to timeout', 'TimeoutError'),
|
||||
]) {
|
||||
await assert.rejects(fetchFirms(URL_WITH_KEY, {}, deps(async () => { throw thrown; })), (err) => err === thrown);
|
||||
}
|
||||
const controller = new AbortController();
|
||||
controller.abort();
|
||||
const aborted = addressSelectionFailure();
|
||||
await assert.rejects(fetchFirms(URL_WITH_KEY, { signal: controller.signal },
|
||||
deps(async () => { throw aborted; })), (err) => err === aborted, 'an expired deadline is not retried');
|
||||
});
|
||||
|
||||
test('the IPv4 retry connects to an IPv4 address only', async (t) => {
|
||||
// `localhost` resolves to both ::1 and 127.0.0.1. Listen on both with the
|
||||
// same port and record which one the retry reaches; the TLS handshake then
|
||||
// fails against a plain socket, which is fine — only the connection matters.
|
||||
const reached = [];
|
||||
const listen = (host, port) => new Promise((resolve, reject) => {
|
||||
const server = net.createServer((socket) => { reached.push(host); socket.destroy(); });
|
||||
server.once('error', reject).listen(port, host, () => resolve(server));
|
||||
});
|
||||
const v4 = await listen('127.0.0.1', 0);
|
||||
t.after(() => v4.close());
|
||||
const { port } = v4.address();
|
||||
let v6;
|
||||
try {
|
||||
v6 = await listen('::1', port);
|
||||
} catch {
|
||||
t.skip('no IPv6 loopback on this host, so IPv4-only cannot be told apart');
|
||||
return;
|
||||
}
|
||||
t.after(() => v6.close());
|
||||
const order = await dns.lookup('localhost', { all: true });
|
||||
if (order[0]?.family !== 6) {
|
||||
t.skip('localhost resolves IPv4 first here, so IPv4-only cannot be told apart');
|
||||
return;
|
||||
}
|
||||
await assert.rejects(fetchIpv4(`https://localhost:${port}/`, { signal: AbortSignal.timeout(5_000) }));
|
||||
assert.deepEqual(reached, ['127.0.0.1']);
|
||||
});
|
||||
|
||||
// Answer the IPv4 retry with `status`, invoking the response callback
|
||||
// asynchronously as `https.request` does, outside the caller's promise.
|
||||
// The returned promise rejects on an uncaught exception, so a regression fails
|
||||
// the race at once instead of crashing the test runner.
|
||||
function mockIpv4Status(t, status, statusMessage = '') {
|
||||
let crash;
|
||||
const crashed = new Promise((_resolve, reject) => (crash = reject));
|
||||
const onUncaught = (error) =>
|
||||
crash(new Error(`uncaught exception: ${error.message}`));
|
||||
process.on('uncaughtException', onUncaught);
|
||||
t.after(() => process.off('uncaughtException', onUncaught));
|
||||
t.mock.method(https, 'request', (_url, _options, callback) => {
|
||||
const request = new EventEmitter();
|
||||
request.end = () =>
|
||||
setImmediate(() =>
|
||||
callback(
|
||||
Object.assign(Readable.from([]), {
|
||||
statusCode: status,
|
||||
statusMessage,
|
||||
headers: { 'content-type': 'text/csv' },
|
||||
}),
|
||||
),
|
||||
);
|
||||
return request;
|
||||
});
|
||||
return crashed;
|
||||
}
|
||||
|
||||
for (const status of [204, 205, 304]) {
|
||||
test(`the IPv4 retry answering null-body status ${status} resolves instead of crashing`, async (t) => {
|
||||
const crashed = mockIpv4Status(t, status);
|
||||
const response = await Promise.race([fetchIpv4(URL_WITH_KEY), crashed]);
|
||||
assert.equal(response.status, status);
|
||||
assert.equal(response.body, null);
|
||||
});
|
||||
}
|
||||
|
||||
for (const status of [600, 999]) {
|
||||
test(`the IPv4 retry answering out-of-range status ${status} rejects instead of crashing`, async (t) => {
|
||||
const crashed = mockIpv4Status(t, status);
|
||||
await assert.rejects(
|
||||
Promise.race([fetchIpv4(URL_WITH_KEY), crashed]),
|
||||
new RegExp(`unsupported status ${status}`),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
test('the IPv4 retry answering an invalid reason phrase rejects instead of crashing', async (t) => {
|
||||
const crashed = mockIpv4Status(t, 200, 'OK\x7f');
|
||||
await assert.rejects(Promise.race([fetchIpv4(URL_WITH_KEY), crashed]), TypeError);
|
||||
});
|
||||
|
||||
// The fixtures above copy Node's error shape; check it against a real fetch so
|
||||
// a Node or undici change that stops matching fails here instead of silently
|
||||
// disabling the retry. A closed port refuses both loopback addresses; resolve
|
||||
// `localhost` to both here, since some hosts map it to 127.0.0.1 only.
|
||||
test('a real all-addresses connect failure is recognised as address selection', async (t) => {
|
||||
const probe = net.createServer();
|
||||
try {
|
||||
await new Promise((resolve, reject) => probe.once('error', reject).listen(0, '::1', resolve));
|
||||
} catch {
|
||||
t.skip('no IPv6 loopback on this host');
|
||||
return;
|
||||
}
|
||||
const { port } = probe.address();
|
||||
await new Promise((resolve) => probe.close(resolve));
|
||||
const v4 = net.createServer();
|
||||
await new Promise((resolve, reject) => v4.once('error', reject).listen(port, '127.0.0.1', resolve));
|
||||
await new Promise((resolve) => v4.close(resolve));
|
||||
const loopback = [{ address: '::1', family: 6 }, { address: '127.0.0.1', family: 4 }];
|
||||
const lookup = t.mock.method(dnsLookup, 'lookup', (_host, _options, callback) => callback(null, loopback));
|
||||
const err = await fetch(`http://localhost:${port}/`).then(() => null, (error) => error);
|
||||
assert.equal(lookup.mock.callCount(), 1, 'fetch resolves localhost through dns.lookup');
|
||||
assert.ok(err, 'a closed port refuses the connection');
|
||||
assert.equal(isAddressSelectionFailure(err), true, describeFetchError(err));
|
||||
assert.match(describeFetchError(err), /ECONNREFUSED .*; .*ECONNREFUSED/);
|
||||
});
|
||||
|
||||
// #68 only stays fixed while both upstream calls go through fetchFirms; the
|
||||
// refresh harness injects fetchSource, so guard the call sites directly.
|
||||
test('every FIRMS upstream request goes through the IPv4 fallback', async () => {
|
||||
assert.doesNotMatch(config, /await fetch\(/, 'no FIRMS request bypasses fetchFirms');
|
||||
const fetchStart = config.indexOf(' async function fetchSource(key, source) {');
|
||||
assert.notEqual(fetchStart, -1, 'FIRMS fetchSource exists');
|
||||
const fetchSourceText = config.slice(fetchStart, config.indexOf('\n }', fetchStart) + 4);
|
||||
const calls = [];
|
||||
const response = new Response('latitude,longitude\n');
|
||||
const fetchSource = new Function('fetchFirms', 'readResponseTextCapped', 'parseFirmsCsv',
|
||||
'FIRMS_MAX_RESPONSE_BYTES', 'AbortSignal', 'fetch', `return (${fetchSourceText});`)(
|
||||
async (url, options) => { calls.push(['fetchFirms', url, options.signal]); return response; },
|
||||
async (res, cap, signal) => { calls.push(['read', res, signal]); return 'csv'; },
|
||||
() => [],
|
||||
1024,
|
||||
AbortSignal,
|
||||
() => assert.fail('fetchSource must call fetchFirms, not fetch'),
|
||||
);
|
||||
assert.deepEqual(await fetchSource('SECRET', 'MODIS_NRT'), []);
|
||||
assert.equal(calls.length, 2);
|
||||
assert.equal(calls[0][0], 'fetchFirms');
|
||||
assert.ok(calls[0][2] instanceof AbortSignal);
|
||||
assert.deepEqual(calls[1], ['read', response, calls[0][2]], 'the body read shares the request deadline');
|
||||
});
|
||||
@@ -41,3 +41,14 @@
|
||||
2026-09-25. Each record names its XYZ tile and expected traffic eligibility.
|
||||
Modified, test-only OpenStreetMap data; same ODbL attribution and database
|
||||
share-alike terms as the OpenFreeMap fixtures above.
|
||||
|
||||
- `ofm-outlines-austin-14-3743-{6745,6746}.pbf` — OpenFreeMap / OpenMapTiles
|
||||
z14 tiles from
|
||||
`https://tiles.openfreemap.org/planet/20260913_164504_pt/{z}/{x}/{y}.pbf`,
|
||||
retrieved 2026-09-28. Trimmed to the `transportation_name` features for
|
||||
Congress Avenue, South Congress Avenue and East 11th Street, and the
|
||||
`building` features within about 150 m of the Texas Capitol and the
|
||||
`landcover` park polygon around it, preserving
|
||||
original geometry and dictionaries. Used by the street and building outline
|
||||
tests. Same OpenFreeMap / OpenMapTiles / OpenStreetMap attribution and ODbL
|
||||
1.0 share-alike terms as the fixtures above. Test-only.
|
||||
Binary file not shown.
@@ -0,0 +1,175 @@
|
||||
¬
|
||||
transportation_name\œÝ”�——–———"> Ú €BŠ-3oxÇ:ÑNƒøçÀË‚£~—ˆ�ô©~§Ð‡b—èó:©
|
||||
ref_lengthsubclassrefclassnamename_int
|
||||
name:latinname_dename_enname:esroute_1_refroute_2_networkroute_1_networkroute_2_refnetworklayer"0"
|
||||
|
||||
junction"
|
||||
233"
|
||||
|
||||
motorway"
|
||||
232"0"
|
||||
234B"
|
||||
234A"
|
||||
South Interstate 35"
|
||||
secondary_construction"
|
||||
|
||||
The Circle"
|
||||
footway"
|
||||
path"$
|
||||
"Lady Bird Lake Hike and Bike Trail"
|
||||
|
||||
cycleway"
|
||||
Waller Creek Greenbelt Trail"&
|
||||
$Ann & Roy Butler Hike and Bike Trail"
|
||||
North Interstate 35"
|
||||
path_construction"
|
||||
Woodland Trail"
|
||||
Harper's Branch Connection"
|
||||
steps"
|
||||
|
||||
Snake Path"
|
||||
Sendero del Serpiente"
|
||||
Nellie Street Crossing"
|
||||
Woodland Avenue"
|
||||
Alameda Drive"
|
||||
minor"
|
||||
Forest Avenue"
|
||||
South 2nd Street"
|
||||
Post Road"
|
||||
Taylor Street"
|
||||
Pecan Grove Road"
|
||||
East Avenue"
|
||||
Fletcher Street"
|
||||
Lockhart Drive"
|
||||
Alta Vista Avenue"
|
||||
Retama Street"
|
||||
Haywood Avenue"
|
||||
Ramona Street"
|
||||
Ravine Drive"
|
||||
Betty Jo Drive"
|
||||
Spence Street"
|
||||
|
||||
Rebel Road"
|
||||
Bickler Road"
|
||||
Clifton Street"
|
||||
Columbus Street"
|
||||
Reagan Terrace"
|
||||
Daniel Drive"
|
||||
East Mary Street"
|
||||
Lindell Avenue"
|
||||
Drake Avenue"
|
||||
Mariposa Drive"
|
||||
Travis Heights Boulevard"
|
||||
Christopher Street"
|
||||
|
||||
Music Lane"
|
||||
Flores Street"
|
||||
Sunset Lane"
|
||||
Mission Ridge"
|
||||
Oak Heights Drive"
|
||||
Bonniview Street"
|
||||
Algarita Avenue"
|
||||
Edgecliff Terrace"
|
||||
Melissa Lane"
|
||||
|
||||
Sunny Lane"
|
||||
Le Grande Avenue"
|
||||
Avondale Road"
|
||||
Milam Place"
|
||||
Fairmount Avenue"
|
||||
River Street"
|
||||
Garden Street"
|
||||
Rosedale Terrace"
|
||||
Nash Hernandez Senior Road"
|
||||
West Monroe Street"
|
||||
Gillespie Place"
|
||||
Newning Avenue"
|
||||
West James Street"
|
||||
College Avenue"
|
||||
Sylvan Drive"
|
||||
Leland Street"
|
||||
Bonham Terrace"
|
||||
Sunny Vale Street"
|
||||
Bartlett Street"
|
||||
Ebony Street"
|
||||
Lupine Lane"
|
||||
Terrace Drive"
|
||||
Newton Street"
|
||||
Parkinson Drive"
|
||||
Inglewood Street"
|
||||
Manlove Street"
|
||||
Academy Drive"
|
||||
Clermont Avenue"
|
||||
Copeland Street"
|
||||
South 3rd Street"
|
||||
Crockett Street"
|
||||
East Gibson Street"
|
||||
West Gibson Street"
|
||||
Summit Street"
|
||||
Chelsea Lane"
|
||||
Willow Street"
|
||||
San Marcos Street"
|
||||
East Side Drive"
|
||||
Lone Oak Drive"
|
||||
East Elizabeth Street"
|
||||
West Elizabeth Street"
|
||||
Lambie Street"
|
||||
Wilson Street"
|
||||
|
||||
Eva Street"
|
||||
Roma Street"
|
||||
Waller Street"
|
||||
Elmhurst Drive"
|
||||
Kenwood Avenue"
|
||||
Brackenridge Street"
|
||||
Hillside Avenue"
|
||||
East Milton Street"
|
||||
West Milton Street"
|
||||
Fairlawn Lane"
|
||||
Euclid Avenue"
|
||||
Rutherford Place"
|
||||
Cummings Street"
|
||||
Nickerson Street"
|
||||
Nellie Street"
|
||||
Park Lane"
|
||||
Bellaire Drive"
|
||||
West Johanna Street"
|
||||
Post Oak Street"
|
||||
Rainey Street"
|
||||
Taylor Gaines Street"
|
||||
Harwood Place"
|
||||
Brooklyn Street"
|
||||
Jewell Street"
|
||||
LBJ Way"
|
||||
Bierce Street"
|
||||
Festival Beach Road"
|
||||
Art Dilly Drive"
|
||||
Haskell Street"
|
||||
Holly Street"
|
||||
|
||||
tertiary"
|
||||
West Mary Street"
|
||||
West Live Oak Street"
|
||||
East Live Oak Street"
|
||||
East Monroe Street"
|
||||
Bouldin Avenue"
|
||||
East Annie Street"
|
||||
West Annie Street"
|
||||
Dawson Road"
|
||||
secondary"
|
||||
South 1st Street"
|
||||
West Oltorf Street"
|
||||
East Riverside Drive"
|
||||
primary"
|
||||
South Congress Avenue"
|
||||
Barton Springs Road"
|
||||
35"
|
||||
Purple Heart Trail"
|
||||
US:US"
|
||||
US:I"
|
||||
290"
|
||||
us-interstate"0"
|
||||
Skyline Views"
|
||||
Blunn Creek Connection"
|
||||
Waterfront Promenade"
|
||||
Hartman Bridge"0(€ x
|
||||
@@ -139,6 +139,7 @@ export function createFlowSegmentIndex(flowSegments) {
|
||||
roadType,
|
||||
level,
|
||||
closure,
|
||||
flow,
|
||||
};
|
||||
const key = cellKey(
|
||||
Math.floor((seg.ax + seg.bx) / 2 / CELL_SIZE_M),
|
||||
@@ -158,7 +159,8 @@ export function createFlowSegmentIndex(flowSegments) {
|
||||
const radius2 = MATCH_RADIUS_M * MATCH_RADIUS_M;
|
||||
/**
|
||||
* Nearest direction-compatible segment within 35 m of a projected point.
|
||||
* `radiusFor(segment)` may tighten the radius per segment (never widen it).
|
||||
* `radiusFor(segment)` may tighten the radius per segment (never widen it);
|
||||
* 0 leaves the segment out.
|
||||
*/
|
||||
function nearest(px, py, bearing, radiusFor = null) {
|
||||
const cx = Math.floor(px / CELL_SIZE_M);
|
||||
@@ -177,7 +179,7 @@ export function createFlowSegmentIndex(flowSegments) {
|
||||
candidate = true; // within radius, bearing not yet checked
|
||||
if (radiusFor) {
|
||||
const radius = Math.min(MATCH_RADIUS_M, radiusFor(seg));
|
||||
if (d2 > radius * radius) continue;
|
||||
if (!(radius > 0) || d2 > radius * radius) continue;
|
||||
}
|
||||
const diff = bearingDiffDeg(seg.bearing, bearing);
|
||||
if (
|
||||
|
||||
@@ -65,7 +65,8 @@ const KML_REMOVED_ELEMENTS = new Set([
|
||||
/**
|
||||
* An error whose message is meant for the person who chose the file. The
|
||||
* message stays English; `template` and `values`, when given, let the UI show
|
||||
* it in the active language.
|
||||
* it in the active language. Numbers stay numbers in `values`: the UI formats
|
||||
* them in that language's numerals.
|
||||
*/
|
||||
export class GeoImportError extends Error {
|
||||
constructor(message, template = message, values = {}) {
|
||||
@@ -259,7 +260,7 @@ function overLimitError({ over, features }) {
|
||||
return new GeoImportError(
|
||||
`That file creates more than ${MAX_IMPORT_ENTITIES.toLocaleString()} map objects (the limit).`,
|
||||
msg('That file creates more than {limit} map objects (the limit).'),
|
||||
{ limit: MAX_IMPORT_ENTITIES.toLocaleString() },
|
||||
{ limit: MAX_IMPORT_ENTITIES },
|
||||
);
|
||||
if (over === 'links')
|
||||
return new GeoImportError(
|
||||
@@ -267,13 +268,13 @@ function overLimitError({ over, features }) {
|
||||
msg(
|
||||
'That file has more than {limit} style definitions and image links after cleanup (the limit).',
|
||||
),
|
||||
{ limit: MAX_KML_LINKS.toLocaleString() },
|
||||
{ limit: MAX_KML_LINKS },
|
||||
);
|
||||
if (over === 'features')
|
||||
return new GeoImportError(
|
||||
`That file has more than ${MAX_IMPORT_ENTITIES.toLocaleString()} features (the limit).`,
|
||||
msg('That file has more than {limit} features (the limit).'),
|
||||
{ limit: MAX_IMPORT_ENTITIES.toLocaleString() },
|
||||
{ limit: MAX_IMPORT_ENTITIES },
|
||||
);
|
||||
const limit = MAX_IMPORT_POSITIONS.toLocaleString();
|
||||
if (features)
|
||||
@@ -282,12 +283,12 @@ function overLimitError({ over, features }) {
|
||||
msg(
|
||||
'That file has more than {limit} points (the limit) across {features} features.',
|
||||
),
|
||||
{ limit, features: features.toLocaleString() },
|
||||
{ limit: MAX_IMPORT_POSITIONS, features },
|
||||
);
|
||||
return new GeoImportError(
|
||||
`That file has more than ${limit} points (the limit).`,
|
||||
msg('That file has more than {limit} points (the limit).'),
|
||||
{ limit },
|
||||
{ limit: MAX_IMPORT_POSITIONS },
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1466,8 +1467,8 @@ export async function loadGeoFile(
|
||||
`That file has ${entityCount.toLocaleString()} map objects; the limit is ${MAX_IMPORT_ENTITIES.toLocaleString()}.`,
|
||||
msg('That file has {count} map objects; the limit is {limit}.'),
|
||||
{
|
||||
count: entityCount.toLocaleString(),
|
||||
limit: MAX_IMPORT_ENTITIES.toLocaleString(),
|
||||
count: entityCount,
|
||||
limit: MAX_IMPORT_ENTITIES,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
/** Normalize a heading into the [0, 360) range; 0 when it is not finite. */
|
||||
export function normalizeHeading(value) {
|
||||
if (!Number.isFinite(value)) return 0;
|
||||
// Only a negative remainder takes the extra turn, so a positive bearing
|
||||
// keeps its precision (0.49999999999999 must not become 360.5).
|
||||
const remainder = value % 360;
|
||||
const wrapped = remainder < 0 ? remainder + 360 : remainder;
|
||||
return wrapped === 360 ? 0 : wrapped;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whole degrees for display, 0–359. 359.5° and above rounds to north (0),
|
||||
* and negative or multi-turn values wrap. Null when the value is not finite,
|
||||
* so each caller keeps its own placeholder.
|
||||
*/
|
||||
export function roundHeadingDegrees(value) {
|
||||
if (!Number.isFinite(value)) return null;
|
||||
return Math.round(normalizeHeading(value)) % 360;
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { normalizeHeading, roundHeadingDegrees } from './headingDegrees.js';
|
||||
|
||||
test('normalizeHeading wraps into [0, 360) and reads a non-finite value as 0', () => {
|
||||
assert.equal(normalizeHeading(370), 10);
|
||||
assert.equal(normalizeHeading(-10), 350);
|
||||
assert.equal(normalizeHeading(720), 0);
|
||||
assert.equal(normalizeHeading(Number.NaN), 0);
|
||||
assert.equal(normalizeHeading(Infinity), 0);
|
||||
});
|
||||
|
||||
test('roundHeadingDegrees reads 359.5° and above as north, never 360', () => {
|
||||
assert.equal(roundHeadingDegrees(359.4), 359);
|
||||
assert.equal(roundHeadingDegrees(359.5), 0);
|
||||
assert.equal(roundHeadingDegrees(359.6), 0);
|
||||
assert.equal(roundHeadingDegrees(360), 0);
|
||||
assert.equal(roundHeadingDegrees(0), 0);
|
||||
assert.equal(roundHeadingDegrees(194.2), 194);
|
||||
});
|
||||
|
||||
test('roundHeadingDegrees wraps negative and multi-turn bearings', () => {
|
||||
assert.equal(Object.is(roundHeadingDegrees(-0.4), 0), true);
|
||||
assert.equal(roundHeadingDegrees(-0.6), 359);
|
||||
assert.equal(roundHeadingDegrees(-1), 359);
|
||||
assert.equal(roundHeadingDegrees(719.6), 0);
|
||||
assert.equal(roundHeadingDegrees(-360.6), 359);
|
||||
});
|
||||
|
||||
test('roundHeadingDegrees returns null for a value that is not finite', () => {
|
||||
for (const value of [
|
||||
Number.NaN,
|
||||
Infinity,
|
||||
-Infinity,
|
||||
null,
|
||||
undefined,
|
||||
'12',
|
||||
]) {
|
||||
assert.equal(roundHeadingDegrees(value), null);
|
||||
}
|
||||
});
|
||||
|
||||
test('normalizeHeading keeps a positive bearing just under a half degree', () => {
|
||||
assert.equal(roundHeadingDegrees(0.49999999999999), 0);
|
||||
assert.equal(roundHeadingDegrees(359.49999999999994), 359);
|
||||
assert.equal(normalizeHeading(-1e-15) < 360, true);
|
||||
});
|
||||
@@ -17,6 +17,7 @@ export const LAYER_FEED_STATES = Object.freeze([
|
||||
'loading',
|
||||
'degraded',
|
||||
'stale',
|
||||
'partial',
|
||||
'fallback',
|
||||
'unavailable',
|
||||
]);
|
||||
@@ -27,6 +28,7 @@ export const LAYER_FEED_STATE_LABELS = Object.freeze({
|
||||
loading: 'LOADING',
|
||||
degraded: 'DEGRADED',
|
||||
stale: 'STALE',
|
||||
partial: 'PARTIAL',
|
||||
fallback: 'FALLBACK',
|
||||
unavailable: 'UNAVAILABLE',
|
||||
});
|
||||
@@ -48,8 +50,9 @@ export const FEED_STATE_SEVERITY = Object.freeze({
|
||||
degraded: 2,
|
||||
stale: 3,
|
||||
fallback: 4,
|
||||
nominal: 5,
|
||||
off: 6,
|
||||
partial: 5,
|
||||
nominal: 6,
|
||||
off: 7,
|
||||
});
|
||||
|
||||
export { layerFeedState } from './feedState.js';
|
||||
@@ -90,7 +93,7 @@ export function snapshotAgeLabel(lastUpdate, now = Date.now()) {
|
||||
/**
|
||||
* Pick the most severe feed-state from a list.
|
||||
* @param {Iterable<string|null|undefined>} states Feed-state strings.
|
||||
* @returns {'nominal'|'loading'|'degraded'|'stale'|'fallback'|'unavailable'|'off'|null}
|
||||
* @returns {'nominal'|'loading'|'degraded'|'stale'|'partial'|'fallback'|'unavailable'|'off'|null}
|
||||
*/
|
||||
export function worstFeedState(states) {
|
||||
let worst = null;
|
||||
@@ -205,6 +208,8 @@ export function feedProvenanceNote(layers = [], overall = null) {
|
||||
return `${s.name || s.id} is ${String(s.feedState).toUpperCase()}${extras ? ` (${extras})` : ''}`;
|
||||
});
|
||||
const body = bits.join('; ') || `${String(overall).toUpperCase()} feed`;
|
||||
if (overall === 'partial')
|
||||
return `${body}. Narrate that coverage is incomplete with any count; do not claim full coverage.`;
|
||||
return `${body}. Narrate that provenance with any count; do not describe this as live.`;
|
||||
}
|
||||
|
||||
@@ -251,3 +256,63 @@ export function viewStateLayerRow(layer, options) {
|
||||
lastUpdate: snap.lastUpdate,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* The feed state and up to two layer names of a provenance envelope that is
|
||||
* not nominal, or null; the worst layers come first, so the names match the
|
||||
* state. Values stay English (`state` is a feed-state id, `names` are
|
||||
* `layer.name`); the HUD translates them for display.
|
||||
* @param {{ overall?: string|null, layers?: Array<object> }|null} envelope
|
||||
* @returns {{ state: string, names: string[] }|null}
|
||||
*/
|
||||
export function provenanceTag(envelope) {
|
||||
const overall = envelope?.overall;
|
||||
if (!overall || overall === 'nominal' || overall === 'off') return null;
|
||||
const names = (envelope.layers || [])
|
||||
.filter(
|
||||
(s) => s.feedState && s.feedState !== 'nominal' && s.feedState !== 'off',
|
||||
)
|
||||
.sort(
|
||||
(a, b) =>
|
||||
FEED_STATE_SEVERITY[a.feedState] - FEED_STATE_SEVERITY[b.feedState],
|
||||
)
|
||||
.map((s) => String(s.name || s.id || 'LAYER'))
|
||||
.slice(0, 2);
|
||||
return { state: overall, names };
|
||||
}
|
||||
|
||||
const upperCase = (word) => word.toUpperCase();
|
||||
|
||||
/**
|
||||
* `STATE | text | LAYERS`: the state leads so a narrow readout never clips
|
||||
* it; the layer names trail so they never push out the text.
|
||||
* @param {string} text
|
||||
* @param {{ state: string, names: string[] }|null} tag From `provenanceTag`.
|
||||
* @param {(state: string) => string} [stateLabel]
|
||||
* @param {(name: string) => string} [layerLabel]
|
||||
* @returns {string}
|
||||
*/
|
||||
export function provenanceLine(
|
||||
text,
|
||||
tag,
|
||||
stateLabel = upperCase,
|
||||
layerLabel = upperCase,
|
||||
) {
|
||||
if (!tag) return text;
|
||||
return [stateLabel(tag.state), text, tag.names.map(layerLabel).join('/')]
|
||||
.filter(Boolean)
|
||||
.join(' | ');
|
||||
}
|
||||
|
||||
/**
|
||||
* Require a matching feedState for warning states: a view that is not
|
||||
* nominal falls back on a missing or different state.
|
||||
* @param {{ feedState?: string|null }|null} response The proxy's reply.
|
||||
* @param {{ overall?: string|null }|null} provenance The context's envelope.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function hudSummaryMatchesProvenance(response, provenance) {
|
||||
const state = provenance?.overall;
|
||||
if (!state || state === 'nominal' || state === 'off') return true;
|
||||
return response?.feedState === state;
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
layerFeedState,
|
||||
layerSnapshot,
|
||||
layerSnapshots,
|
||||
provenanceTag,
|
||||
snapshotAgeLabel,
|
||||
snapshotAgeSec,
|
||||
viewStateLayerRow,
|
||||
@@ -90,7 +91,15 @@ test('layerFeedState matches the chip classifier for every honesty class', () =>
|
||||
test('chip labels and severity cover every feed-state the envelope can emit', () => {
|
||||
assert.deepEqual(
|
||||
[...LAYER_FEED_STATES],
|
||||
['nominal', 'loading', 'degraded', 'stale', 'fallback', 'unavailable'],
|
||||
[
|
||||
'nominal',
|
||||
'loading',
|
||||
'degraded',
|
||||
'stale',
|
||||
'partial',
|
||||
'fallback',
|
||||
'unavailable',
|
||||
],
|
||||
);
|
||||
assert.deepEqual([...SNAPSHOT_FEED_STATES], [...LAYER_FEED_STATES, 'off']);
|
||||
for (const state of LAYER_FEED_STATES) {
|
||||
@@ -107,6 +116,33 @@ test('chip labels and severity cover every feed-state the envelope can emit', ()
|
||||
assert.equal(worstFeedState([]), null);
|
||||
});
|
||||
|
||||
test('partial is a feed-state of its own: above nominal, below every fault', () => {
|
||||
const layer = (id, stats) => ({ id, name: id, enabled: true, stats });
|
||||
const partial = layer('flights', {
|
||||
partial: true,
|
||||
count: 4,
|
||||
lastUpdate: NOW,
|
||||
});
|
||||
const nominal = layer('vessels', { count: 9, lastUpdate: NOW });
|
||||
const stale = layer('cctv', { stale: true, count: 2, lastUpdate: NOW });
|
||||
const overall = (layers) =>
|
||||
feedProvenanceEnvelope(layers, { now: NOW }).overall;
|
||||
assert.equal(overall([partial]), 'partial');
|
||||
assert.equal(overall([partial, nominal]), 'partial');
|
||||
assert.equal(overall([nominal, partial]), 'partial');
|
||||
assert.equal(overall([partial, stale]), 'stale');
|
||||
assert.equal(overall([stale, partial]), 'stale');
|
||||
assert.equal(LAYER_FEED_STATE_LABELS.partial, 'PARTIAL');
|
||||
const note = feedProvenanceEnvelope([partial], { now: NOW }).note;
|
||||
assert.match(note, /coverage is incomplete/);
|
||||
assert.doesNotMatch(note, /do not describe this as live/);
|
||||
assert.equal(
|
||||
FEED_STATE_SEVERITY.fallback < FEED_STATE_SEVERITY.partial &&
|
||||
FEED_STATE_SEVERITY.partial < FEED_STATE_SEVERITY.nominal,
|
||||
true,
|
||||
);
|
||||
});
|
||||
|
||||
test('a disabled layer is off even when leftover stats would read stale', () => {
|
||||
const snap = layerSnapshot(
|
||||
{
|
||||
@@ -258,3 +294,18 @@ test('age labels match the Data Layers meta clock', () => {
|
||||
assert.equal(snapshotAgeLabel(NOW - 240_000, NOW), '4m ago');
|
||||
assert.equal(snapshotAgeLabel(NOW - 7_200_000, NOW), '2h ago');
|
||||
});
|
||||
|
||||
test('the warning tag names the layers in the reported state first', () => {
|
||||
const tag = provenanceTag({
|
||||
overall: 'unavailable',
|
||||
layers: [
|
||||
{ name: 'Live Flights', feedState: 'partial' },
|
||||
{ name: 'Live AIS Vessels', feedState: 'partial' },
|
||||
{ name: 'CCTV', feedState: 'unavailable' },
|
||||
],
|
||||
});
|
||||
assert.deepEqual(tag, {
|
||||
state: 'unavailable',
|
||||
names: ['CCTV', 'Live Flights'],
|
||||
});
|
||||
});
|
||||
@@ -598,6 +598,11 @@ export const LAYER_STATE_REGISTRY = Object.freeze([
|
||||
optionOwner: 'cctv',
|
||||
}),
|
||||
Object.freeze({ id: 'directions', token: 'n', disposition: 'enabled-only' }),
|
||||
Object.freeze({
|
||||
id: 'drone-airspace',
|
||||
token: '8',
|
||||
disposition: 'enabled-only',
|
||||
}),
|
||||
Object.freeze({ id: 'earthquakes', token: 'e', disposition: 'enabled-only' }),
|
||||
Object.freeze({
|
||||
id: 'fire-perimeters',
|
||||
@@ -666,6 +671,8 @@ export const LAYER_STATE_REGISTRY = Object.freeze([
|
||||
disposition: 'enabled+options',
|
||||
optionOwner: 'satellites',
|
||||
}),
|
||||
Object.freeze({ id: 'sea-marks', token: '6', disposition: 'enabled-only' }),
|
||||
Object.freeze({ id: 'ski-pistes', token: '7', disposition: 'enabled-only' }),
|
||||
Object.freeze({
|
||||
id: 'street-level',
|
||||
token: '0',
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { encodeParams, decodeParams } from '../layers/streetLevel/params.js';
|
||||
import { readShellSource } from '../testSupport/readShellSource.mjs';
|
||||
import { expandApplicationHtml } from '../../build/application-html.js';
|
||||
import { renderApplicationHtml } from '../testSupport/applicationHtml.mjs';
|
||||
import { readLayerSource } from '../testSupport/readLayerSource.mjs';
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
@@ -202,8 +202,8 @@ function encode(state) {
|
||||
|
||||
test('production registry is exact, canonical, and rejects incomplete contracts', async () => {
|
||||
assert.equal(validateLayerStateRegistry(), true);
|
||||
assert.equal(REGISTERED_LAYER_IDS.length, 32);
|
||||
assert.equal(new Set(REGISTERED_LAYER_IDS).size, 32);
|
||||
assert.equal(REGISTERED_LAYER_IDS.length, 35);
|
||||
assert.equal(new Set(REGISTERED_LAYER_IDS).size, 35);
|
||||
assert.ok(REGISTERED_LAYER_IDS.includes('transit'));
|
||||
assert.deepEqual(REGISTERED_LAYER_IDS, [...REGISTERED_LAYER_IDS].sort());
|
||||
assert.deepEqual(LEGACY_LAYER_STATE_TOKENS, {
|
||||
@@ -242,20 +242,18 @@ test('production registry is exact, canonical, and rejects incomplete contracts'
|
||||
for (const [id, token] of Object.entries(LEGACY_LAYER_STATE_TOKENS)) {
|
||||
assert.equal(LAYER_STATE_TOKEN_RESERVATIONS[id], token);
|
||||
}
|
||||
assert.equal(nextLayerStateToken(), '6');
|
||||
assert.equal(nextLayerStateToken(), '9');
|
||||
assert.equal(
|
||||
nextLayerStateToken({
|
||||
...LAYER_STATE_TOKEN_RESERVATIONS,
|
||||
alpha: '6',
|
||||
bravo: '7',
|
||||
alpha: '9',
|
||||
bravo: '00',
|
||||
}),
|
||||
'8',
|
||||
'01',
|
||||
);
|
||||
const digitsExhausted = {
|
||||
...LAYER_STATE_TOKEN_RESERVATIONS,
|
||||
...Object.fromEntries(
|
||||
[...'6789'].map((digit) => [`prior-${digit}`, digit]),
|
||||
),
|
||||
...Object.fromEntries([...'9'].map((digit) => [`prior-${digit}`, digit])),
|
||||
};
|
||||
assert.equal(nextLayerStateToken(digitsExhausted), '00');
|
||||
assert.equal(
|
||||
@@ -307,8 +305,8 @@ test('production registry is exact, canonical, and rejects incomplete contracts'
|
||||
assert.equal(
|
||||
validateLayerStateAllocations(LAYER_STATE_TOKEN_RESERVATIONS, {
|
||||
...LAYER_STATE_TOKEN_RESERVATIONS,
|
||||
future: '6',
|
||||
next: '7',
|
||||
future: '9',
|
||||
next: '00',
|
||||
}),
|
||||
true,
|
||||
);
|
||||
@@ -318,7 +316,7 @@ test('production registry is exact, canonical, and rejects incomplete contracts'
|
||||
...LAYER_STATE_TOKEN_RESERVATIONS,
|
||||
future: '00',
|
||||
}),
|
||||
/next free token 6/,
|
||||
/next free token 9/,
|
||||
);
|
||||
const beforeLastDigit = { ...digitsExhausted };
|
||||
delete beforeLastDigit['prior-9'];
|
||||
@@ -341,10 +339,10 @@ test('production registry is exact, canonical, and rejects incomplete contracts'
|
||||
assert.throws(
|
||||
() =>
|
||||
validateLayerStateAllocations(
|
||||
{ ...LAYER_STATE_TOKEN_RESERVATIONS, merged: '6' },
|
||||
{ ...LAYER_STATE_TOKEN_RESERVATIONS, merged: '6', competing: '6' },
|
||||
{ ...LAYER_STATE_TOKEN_RESERVATIONS, merged: '9' },
|
||||
{ ...LAYER_STATE_TOKEN_RESERVATIONS, merged: '9', competing: '9' },
|
||||
),
|
||||
/next free token 7/,
|
||||
/next free token 00/,
|
||||
);
|
||||
assert.throws(
|
||||
() => validateLayerStateAllocations({ future: '00' }, { future: '01' }),
|
||||
@@ -734,18 +732,27 @@ test('a fresh boot starts 3D aircraft ON in proximity — codec, both layers, an
|
||||
/this\.(?:flightState\.)?_models3dMode = 'proximity';/,
|
||||
'ui.js: and believes the mode is proximity',
|
||||
);
|
||||
const html = expandApplicationHtml(
|
||||
const html = await renderApplicationHtml(
|
||||
await readFile(new URL('../../index.html', import.meta.url), 'utf8'),
|
||||
);
|
||||
assert.match(
|
||||
html,
|
||||
/class="pp-toggle-btn active" id="models3d-toggle" aria-pressed="true"/,
|
||||
/<button(?=[^>]*\sid="models3d-toggle")(?=[^>]*\sclass="(?=[^"]*\bpp-toggle-btn\b)(?=[^"]*\bactive\b))(?=[^>]*\saria-pressed="true")/,
|
||||
'index.html: the 3D button paints lit on first paint, before ui.js runs — and says so',
|
||||
);
|
||||
assert.match(
|
||||
ui,
|
||||
/this\._models3dBtn\?\.setAttribute\(\s*'aria-pressed',\s*String\(this\.(?:flightState\.)?_models3dEnabled\),?\s*\)/,
|
||||
'ui.js: and keeps aria-pressed synchronized, so the lit state is not colour-only',
|
||||
/this\._models3dPressedShown = this\._models3dEnabled;/,
|
||||
'ui.js: and keeps the pressed state synchronized, so the lit state is not colour-only',
|
||||
);
|
||||
const panel = await readFile(
|
||||
new URL('../ui/views/panels/DisplayPanel.vue', import.meta.url),
|
||||
'utf8',
|
||||
);
|
||||
assert.match(
|
||||
panel,
|
||||
/:pressed="models3dOn" pressed-class="active" id="models3d-toggle"/,
|
||||
'DisplayPanel.vue: the view renders aria-pressed with the lit state',
|
||||
);
|
||||
assert.match(
|
||||
html,
|
||||
@@ -2687,6 +2694,22 @@ test('the recent-imagery split is share-link only: never stored locally, and a s
|
||||
);
|
||||
});
|
||||
|
||||
test('drone restrictions uses digit 8 without colliding with fire perimeters', () => {
|
||||
const decoded = decodeLayerStateParams(new URLSearchParams('v=2&l=8.2'));
|
||||
assert.deepEqual(decoded.enabledLayerIds, [
|
||||
'drone-airspace',
|
||||
'fire-perimeters',
|
||||
]);
|
||||
assert.equal(
|
||||
LAYER_STATE_REGISTRY.find(({ id }) => id === 'drone-airspace').token,
|
||||
'8',
|
||||
);
|
||||
assert.deepEqual(
|
||||
decodeLayerStateParams(new URLSearchParams(encode(decoded))),
|
||||
decoded,
|
||||
);
|
||||
});
|
||||
|
||||
test('GNSS interference uses digit 3 without colliding with other digit tokens', () => {
|
||||
const decoded = decodeLayerStateParams(new URLSearchParams('v=2&l=3.2.1'));
|
||||
assert.deepEqual(decoded.enabledLayerIds, [
|
||||
|
||||
@@ -128,7 +128,7 @@ test('reservation ledger is complete, pinned, and rejects duplicate or malformed
|
||||
{ ...parseLayerStateTokenReservations(reservationRows) },
|
||||
{ ...LAYER_STATE_TOKEN_RESERVATIONS },
|
||||
);
|
||||
assert.equal(Object.keys(LAYER_STATE_TOKEN_RESERVATIONS).length, 32);
|
||||
assert.equal(Object.keys(LAYER_STATE_TOKEN_RESERVATIONS).length, 35);
|
||||
assert.deepEqual(
|
||||
{ ...LAYER_STATE_TOKEN_RESERVATIONS },
|
||||
{
|
||||
@@ -137,6 +137,9 @@ test('reservation ledger is complete, pinned, and rejects duplicate or malformed
|
||||
'gnss-integrity': '3',
|
||||
'air-quality': '4',
|
||||
's2-ghostmaps': '5',
|
||||
'sea-marks': '6',
|
||||
'ski-pistes': '7',
|
||||
'drone-airspace': '8',
|
||||
},
|
||||
);
|
||||
assert.throws(
|
||||
@@ -162,9 +165,9 @@ test('reservation ledger is complete, pinned, and rejects duplicate or malformed
|
||||
/Duplicate layer-state token reservation/,
|
||||
);
|
||||
assert.equal(
|
||||
parseLayerStateTokenReservations([...reservationRows, ['future', '6']])
|
||||
parseLayerStateTokenReservations([...reservationRows, ['future', '9']])
|
||||
.future,
|
||||
'6',
|
||||
'9',
|
||||
);
|
||||
assert.throws(
|
||||
() =>
|
||||
@@ -182,14 +185,14 @@ test('reservation ledger is complete, pinned, and rejects duplicate or malformed
|
||||
|
||||
test('published retired digits and competing PRs advance the merge-time allocation', () => {
|
||||
withPublishedBase(
|
||||
{ rows: [...reservationRows, ['retired-layer', '6']] },
|
||||
{ rows: [...reservationRows, ['retired-layer', '9']] },
|
||||
(cwd) => {
|
||||
const published = readPublishedLayerStateReservations('HEAD', cwd);
|
||||
assert.equal(nextLayerStateToken(published), '7');
|
||||
assert.equal(nextLayerStateToken(published), '00');
|
||||
assert.equal(
|
||||
validateLayerStateAllocations(published, {
|
||||
...published,
|
||||
newcomer: '7',
|
||||
newcomer: '00',
|
||||
}),
|
||||
true,
|
||||
);
|
||||
@@ -197,15 +200,15 @@ test('published retired digits and competing PRs advance the merge-time allocati
|
||||
() =>
|
||||
validateLayerStateAllocations(published, {
|
||||
...published,
|
||||
competing: '6',
|
||||
competing: '9',
|
||||
}),
|
||||
/next free token 7/,
|
||||
/next free token 00/,
|
||||
);
|
||||
assert.throws(
|
||||
() =>
|
||||
validateLayerStateAllocations(published, {
|
||||
...LAYER_STATE_TOKEN_RESERVATIONS,
|
||||
newcomer: '6',
|
||||
newcomer: '9',
|
||||
}),
|
||||
/changed or removed: retired-layer/,
|
||||
);
|
||||
@@ -213,8 +216,8 @@ test('published retired digits and competing PRs advance the merge-time allocati
|
||||
);
|
||||
});
|
||||
|
||||
test('PR B manually replaces provisional 6 with 7 after PR A publishes 6', () => {
|
||||
withPublishedBase({ rows: [...reservationRows, ['pr-a', '6']] }, (cwd) => {
|
||||
test('PR B manually replaces provisional 9 with 00 after PR A publishes 9', () => {
|
||||
withPublishedBase({ rows: [...reservationRows, ['pr-a', '9']] }, (cwd) => {
|
||||
mkdirSync(path.join(cwd, 'scripts'));
|
||||
const fixtureChecker = path.join(
|
||||
cwd,
|
||||
@@ -235,8 +238,8 @@ test('PR B manually replaces provisional 6 with 7 after PR A publishes 6', () =>
|
||||
|
||||
writeCodecFixture(
|
||||
cwd,
|
||||
[...reservationRows, ['pr-b', '6']],
|
||||
[{ id: 'pr-b', token: '6' }],
|
||||
[...reservationRows, ['pr-b', '9']],
|
||||
[{ id: 'pr-b', token: '9' }],
|
||||
);
|
||||
const beforeRebase = runCheck();
|
||||
assert.equal(beforeRebase.status, 1);
|
||||
@@ -244,10 +247,10 @@ test('PR B manually replaces provisional 6 with 7 after PR A publishes 6', () =>
|
||||
|
||||
writeCodecFixture(
|
||||
cwd,
|
||||
[...reservationRows, ['pr-a', '6'], ['pr-b', '6']],
|
||||
[...reservationRows, ['pr-a', '9'], ['pr-b', '9']],
|
||||
[
|
||||
{ id: 'pr-a', token: '6' },
|
||||
{ id: 'pr-b', token: '6' },
|
||||
{ id: 'pr-a', token: '9' },
|
||||
{ id: 'pr-b', token: '9' },
|
||||
],
|
||||
);
|
||||
const staleRebase = runCheck();
|
||||
@@ -255,16 +258,16 @@ test('PR B manually replaces provisional 6 with 7 after PR A publishes 6', () =>
|
||||
assert.match(staleRebase.stderr, /Duplicate layer-state token reservation/);
|
||||
|
||||
const published = readPublishedLayerStateReservations('HEAD', cwd);
|
||||
assert.equal(nextLayerStateToken(published), '7');
|
||||
const validBaselineRows = [...reservationRows, ['pr-a', '6']];
|
||||
writeCodecFixture(cwd, validBaselineRows, [{ id: 'pr-a', token: '6' }]);
|
||||
assert.equal(nextLayerStateToken(published), '00');
|
||||
const validBaselineRows = [...reservationRows, ['pr-a', '9']];
|
||||
writeCodecFixture(cwd, validBaselineRows, [{ id: 'pr-a', token: '9' }]);
|
||||
const helper = spawnSync(
|
||||
process.execPath,
|
||||
[realpathSync(fixtureNext), 'pr-b'],
|
||||
{ cwd, encoding: 'utf8' },
|
||||
);
|
||||
assert.equal(helper.status, 0, helper.stderr);
|
||||
assert.match(helper.stdout, /pr-b: 7/);
|
||||
assert.match(helper.stdout, /pr-b: 00/);
|
||||
assert.deepEqual(
|
||||
JSON.parse(readFileSync(path.join(cwd, LEDGER_PATH), 'utf8')),
|
||||
validBaselineRows,
|
||||
@@ -272,20 +275,20 @@ test('PR B manually replaces provisional 6 with 7 after PR A publishes 6', () =>
|
||||
);
|
||||
writeCodecFixture(
|
||||
cwd,
|
||||
[...reservationRows, ['pr-a', '6'], ['pr-b', '7']],
|
||||
[...reservationRows, ['pr-a', '9'], ['pr-b', '00']],
|
||||
[
|
||||
{ id: 'pr-a', token: '6' },
|
||||
{ id: 'pr-b', token: '7' },
|
||||
{ id: 'pr-a', token: '9' },
|
||||
{ id: 'pr-b', token: '00' },
|
||||
],
|
||||
);
|
||||
const corrected = runCheck();
|
||||
assert.equal(corrected.status, 0, corrected.stderr);
|
||||
assert.match(corrected.stdout, /33 published, 1 new/);
|
||||
assert.match(corrected.stdout, /36 published, 1 new/);
|
||||
});
|
||||
});
|
||||
|
||||
test('allocation batches cross the last digit and base-36 pair boundaries in order', () => {
|
||||
const digitRows = [...'6789'].map((digit) => [`retired-${digit}`, digit]);
|
||||
const digitRows = [...'9'].map((digit) => [`retired-${digit}`, digit]);
|
||||
const allDigits = parseLayerStateTokenReservations([
|
||||
...reservationRows,
|
||||
...digitRows,
|
||||
@@ -337,7 +340,7 @@ test('allocation batches cross the last digit and base-36 pair boundaries in ord
|
||||
test('an isolated valid two-character fixture round-trips an l field beyond the old 64-character cap', async () => {
|
||||
const cwd = mkdtempSync(path.join(tmpdir(), 'gev-layer-token-width-'));
|
||||
try {
|
||||
const priorDigits = [...'6789'].map((digit) => [
|
||||
const priorDigits = [...'9'].map((digit) => [
|
||||
`qa-prior-digit-${digit}`,
|
||||
digit,
|
||||
]);
|
||||
@@ -374,7 +377,7 @@ test('an isolated valid two-character fixture round-trips an l field beyond the
|
||||
const params = new URLSearchParams([['v', '2']]);
|
||||
codec.encodeLayerStateParams(params, state);
|
||||
assert.ok(params.get('l').length > 64, 'fixture must cross the old cap');
|
||||
assert.equal(params.get('l').length, 75);
|
||||
assert.equal(params.get('l').length, 81);
|
||||
const restored = codec.decodeLayerStateParams(params);
|
||||
assert.deepEqual(restored?.enabledLayerIds, expectedLayerIds);
|
||||
assert.deepEqual(restored?.options, state.options);
|
||||
@@ -392,7 +395,7 @@ test('checker reads a complete future base ledger and rejects retired-token reus
|
||||
},
|
||||
(cwd) => {
|
||||
const published = readPublishedLayerStateReservations('HEAD', cwd);
|
||||
assert.equal(Object.keys(published).length, 33);
|
||||
assert.equal(Object.keys(published).length, 36);
|
||||
assert.equal(published['retired-layer'], '00');
|
||||
assert.throws(
|
||||
() =>
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
["bikeshare", "b"],
|
||||
["cctv", "c"],
|
||||
["directions", "n"],
|
||||
["drone-airspace", "8"],
|
||||
["earthquakes", "e"],
|
||||
["fire-perimeters", "2"],
|
||||
["flights", "f"],
|
||||
@@ -22,6 +23,8 @@
|
||||
["rocket-launches", "x"],
|
||||
["s2-ghostmaps", "5"],
|
||||
["satellites", "s"],
|
||||
["sea-marks", "6"],
|
||||
["ski-pistes", "7"],
|
||||
["street-level", "0"],
|
||||
["telegeography-submarine-cables", "u"],
|
||||
["traffic", "t"],
|
||||
|
||||
@@ -90,6 +90,8 @@ async function createRealLocalLayerHarness({
|
||||
globalThis.window = { dispatchEvent() {} };
|
||||
let sampleHeightImpl = sampleHeight;
|
||||
const sampleCalls = { count: 0 };
|
||||
// The camera frustum, reduced to the one answer ground sampling asks of it.
|
||||
let baseVisibility = Cesium.Intersect.INSIDE;
|
||||
const overlayHost = {
|
||||
setVisible: (...args) => hostCalls.push(['visible', ...args]),
|
||||
setEntries: (...args) => hostCalls.push(['entries', ...args]),
|
||||
@@ -107,7 +109,19 @@ async function createRealLocalLayerHarness({
|
||||
},
|
||||
camera: {
|
||||
positionWC: Cesium.Cartesian3.fromDegrees(-97.695, 30.205, 100_000),
|
||||
frustum: { fov: Math.PI / 3 },
|
||||
directionWC: new Cesium.Cartesian3(),
|
||||
upWC: new Cesium.Cartesian3(),
|
||||
frustum: {
|
||||
fov: Math.PI / 3,
|
||||
// No planes: everything is in view. One plane no point satisfies:
|
||||
// nothing is.
|
||||
computeCullingVolume: () => ({
|
||||
planes:
|
||||
baseVisibility === Cesium.Intersect.OUTSIDE
|
||||
? [new Cesium.Cartesian4(0, 0, 0, -1)]
|
||||
: [],
|
||||
}),
|
||||
},
|
||||
moveEnd,
|
||||
flyTo() {},
|
||||
},
|
||||
@@ -151,6 +165,10 @@ async function createRealLocalLayerHarness({
|
||||
sampleCalls,
|
||||
/** Swap scene.sampleHeight mid-test (e.g. tiles finally arrive). */
|
||||
setSampleHeight(next) { sampleHeightImpl = next; },
|
||||
/** Put the feature's base inside (true) or outside the camera frustum. */
|
||||
setBaseInView(inView) {
|
||||
baseVisibility = inView ? Cesium.Intersect.INSIDE : Cesium.Intersect.OUTSIDE;
|
||||
},
|
||||
cleanup() {
|
||||
if (originalWindow === undefined) delete globalThis.window;
|
||||
else globalThis.window = originalWindow;
|
||||
@@ -736,6 +754,136 @@ test('ground sampling waits for visible globe tiles before caching a height', as
|
||||
assert.ok(Math.abs(baseHeightM(env) - 117) < 0.01);
|
||||
});
|
||||
|
||||
test('an unseen base is not sampled and arms no retry until it is in view', async (t) => {
|
||||
// Out of view the scene has no surface under the base, so the depth sample
|
||||
// would pass through the Earth (about -6,344 km) and fail on every retry.
|
||||
const env = await createRealLocalLayerHarness({
|
||||
sampleHeightSupported: true, sampleHeight: () => 117,
|
||||
});
|
||||
_resetRenderGovernorForTest();
|
||||
const governorScene = { renders: 0, requestRender() { this.renders += 1; } };
|
||||
installRenderGovernor({ scene: governorScene });
|
||||
governorScene.renders = 0; // discard the governor's own install settling frame
|
||||
t.mock.timers.enable({ apis: ['setTimeout'] });
|
||||
const clock = installFakeClock(t);
|
||||
t.after(() => {
|
||||
env.layer.destroy(env.viewer);
|
||||
env.cleanup();
|
||||
_resetRenderGovernorForTest();
|
||||
});
|
||||
env.viewer.scene.globe = { show: true, tilesLoaded: true, getHeight: () => 117 };
|
||||
setCameraAltitude(env, 20_000);
|
||||
env.setBaseInView(false);
|
||||
runArmedRetryChain(env, t, clock, 5);
|
||||
assert.equal(env.sampleCalls.count, 0, 'an off-screen base must not be sampled');
|
||||
assert.equal(governorScene.renders, 0, 'an off-screen base must not keep a parked camera rendering');
|
||||
assert.ok(Math.abs(baseHeightM(env)) < 0.01);
|
||||
|
||||
// In the frustum but over the horizon: 50 m up, about 67 km away.
|
||||
env.setBaseInView(true);
|
||||
env.viewer.camera.positionWC = Cesium.Cartesian3.fromDegrees(-97.0, 30.205, 50);
|
||||
runArmedRetryChain(env, t, clock, 5);
|
||||
assert.equal(env.sampleCalls.count, 0, 'a base over the horizon must not be sampled');
|
||||
assert.equal(governorScene.renders, 0);
|
||||
|
||||
setCameraAltitude(env, 20_000);
|
||||
env.preRender.raise();
|
||||
assert.equal(env.sampleCalls.count, 1, 'the base is sampled on the first walk that sees it');
|
||||
assert.ok(Math.abs(baseHeightM(env) - 117) < 0.01);
|
||||
});
|
||||
|
||||
/**
|
||||
* Give the harness a real Cesium camera `southM` metres south of the base at
|
||||
* `cameraM` metres above the ellipsoid, looking at the base's ground at
|
||||
* `groundM` (or directly away from it).
|
||||
*/
|
||||
function aimRealCamera(env, { groundM, cameraM, southM, away = false, fov = Math.PI / 3 }) {
|
||||
const entity = env.dataSources[0].entities.values[0];
|
||||
const base = Cesium.Cartographic.fromCartesian(entity.__localBaseCartesian);
|
||||
const ground = Cesium.Cartesian3.fromRadians(base.longitude, base.latitude, groundM);
|
||||
const position = Cesium.Cartesian3.fromRadians(
|
||||
base.longitude,
|
||||
base.latitude - southM / 6_371_000,
|
||||
cameraM,
|
||||
);
|
||||
const direction = Cesium.Cartesian3.normalize(
|
||||
away
|
||||
? Cesium.Cartesian3.subtract(position, ground, new Cesium.Cartesian3())
|
||||
: Cesium.Cartesian3.subtract(ground, position, new Cesium.Cartesian3()),
|
||||
new Cesium.Cartesian3(),
|
||||
);
|
||||
const right = Cesium.Cartesian3.normalize(
|
||||
Cesium.Cartesian3.cross(
|
||||
direction,
|
||||
Cesium.Ellipsoid.WGS84.geodeticSurfaceNormal(position),
|
||||
new Cesium.Cartesian3(),
|
||||
),
|
||||
new Cesium.Cartesian3(),
|
||||
);
|
||||
const up = Cesium.Cartesian3.cross(right, direction, new Cesium.Cartesian3());
|
||||
const frustum = new Cesium.PerspectiveFrustum({
|
||||
fov,
|
||||
aspectRatio: 800 / 600,
|
||||
near: 1,
|
||||
far: 1e8,
|
||||
});
|
||||
Object.assign(env.viewer.camera, {
|
||||
positionWC: position,
|
||||
directionWC: direction,
|
||||
upWC: up,
|
||||
frustum,
|
||||
});
|
||||
return frustum
|
||||
.computeCullingVolume(position, direction, up)
|
||||
.computeVisibility(new Cesium.BoundingSphere(entity.__localBaseCartesian, 1));
|
||||
}
|
||||
|
||||
const loadedTerrain = (height) => ({ show: true, tilesLoaded: true, getHeight: () => height });
|
||||
const hiddenGlobe = { show: false, tilesLoaded: true, getHeight: () => undefined };
|
||||
|
||||
for (const { label, globe, groundM, cameraM, southM, fov, baseOffScreen } of [
|
||||
// The Dead Sea (about -430 m) under a hidden globe, seen steeply down
|
||||
// through a narrow view: both 0 m and 9,000 m above it are off screen.
|
||||
{ label: 'hidden-globe depression', globe: hiddenGlobe, groundM: -430, cameraM: 20, southM: 180, fov: Math.PI / 12, baseOffScreen: true },
|
||||
// 2,500 m terrain from 3 km away at a shallow angle: the ellipsoid-height
|
||||
// base is far below the bottom of the screen.
|
||||
{ label: 'high ground with loaded terrain', globe: loadedTerrain(2_500), groundM: 2_500, cameraM: 3_500, southM: 3_000, baseOffScreen: true },
|
||||
{ label: 'high ground under a hidden globe', globe: hiddenGlobe, groundM: 2_500, cameraM: 3_500, southM: 3_000, baseOffScreen: true },
|
||||
// A low-geoid coast (about -63 m near Mumbai) from a camera 50 m above the
|
||||
// ellipsoid: the ellipsoidal horizon would hide the ground itself.
|
||||
{ label: 'ground below the ellipsoid', globe: loadedTerrain(-63), groundM: -63, cameraM: 50, southM: 2_000, baseOffScreen: false },
|
||||
]) {
|
||||
test(`${label} in view is sampled`, async (t) => {
|
||||
const env = await createRealLocalLayerHarness({
|
||||
sampleHeightSupported: true, sampleHeight: () => groundM,
|
||||
});
|
||||
const clock = installFakeClock(t);
|
||||
t.after(() => { env.layer.destroy(env.viewer); env.cleanup(); });
|
||||
env.viewer.scene.globe = globe;
|
||||
const baseVisibility = aimRealCamera(env, { groundM, cameraM, southM, fov });
|
||||
if (baseOffScreen)
|
||||
assert.equal(baseVisibility, Cesium.Intersect.OUTSIDE, 'precondition: the ellipsoid-height base is off screen');
|
||||
|
||||
clock.advance(2_100);
|
||||
env.preRender.raise();
|
||||
assert.equal(env.sampleCalls.count, 1, 'the ground in view is sampled');
|
||||
assert.ok(Math.abs(baseHeightM(env) - groundM) < 0.01);
|
||||
});
|
||||
}
|
||||
|
||||
test('under a hidden globe, ground behind the camera is not sampled', async (t) => {
|
||||
const env = await createRealLocalLayerHarness({
|
||||
sampleHeightSupported: true, sampleHeight: () => 2_500,
|
||||
});
|
||||
const clock = installFakeClock(t);
|
||||
t.after(() => { env.layer.destroy(env.viewer); env.cleanup(); });
|
||||
env.viewer.scene.globe = hiddenGlobe;
|
||||
aimRealCamera(env, { groundM: 2_500, cameraM: 3_500, southM: 3_000, away: true });
|
||||
clock.advance(2_100);
|
||||
env.preRender.raise();
|
||||
assert.equal(env.sampleCalls.count, 0);
|
||||
});
|
||||
|
||||
test('settled terrain refinement lifts an already sampled stem without another GPU sample', async (t) => {
|
||||
const env = await createRealLocalLayerHarness({
|
||||
sampleHeightSupported: true, sampleHeight: () => 117,
|
||||
|
||||
@@ -1000,9 +1000,9 @@ export function createLocalGeoJsonLayer(
|
||||
// governor the retry's preRender never arrives on a parked camera
|
||||
// and the stem stays at ellipsoid height (buried/floating) until
|
||||
// the user happens to move. Schedule the frame the retry needs.
|
||||
// Gated on a sampleable scene and in-range records only, so a far
|
||||
// camera (or a keyless scene) stays fully idle; the distance is
|
||||
// only computed for still-unsampled stems.
|
||||
// Gated on a sampleable scene and in-range, in-view records only,
|
||||
// so a far camera (or a keyless scene) stays fully idle; the
|
||||
// distance is only computed for still-unsampled stems.
|
||||
if (
|
||||
canSampleGround &&
|
||||
!record.groundSampled &&
|
||||
@@ -1010,7 +1010,8 @@ export function createLocalGeoJsonLayer(
|
||||
Cesium.Cartesian3.distance(
|
||||
viewer.camera.positionWC,
|
||||
record.base,
|
||||
) < GROUND_SAMPLE_MAX_DISTANCE_M
|
||||
) < GROUND_SAMPLE_MAX_DISTANCE_M &&
|
||||
groundSampleInView(viewer, record)
|
||||
) {
|
||||
groundRetryPending = true;
|
||||
}
|
||||
@@ -1130,9 +1131,87 @@ function refreshLocalTerrainFloor(viewer, record) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const groundSampleOccluder = new Cesium.EllipsoidalOccluder(
|
||||
Cesium.Ellipsoid.WGS84,
|
||||
);
|
||||
|
||||
const groundSampleCarto = new Cesium.Cartographic();
|
||||
const groundSampleLow = new Cesium.Cartesian3();
|
||||
const groundSampleHigh = new Cesium.Cartesian3();
|
||||
|
||||
/** The record's vertical at `height` metres above the ellipsoid. */
|
||||
function groundSamplePoint(record, height, result) {
|
||||
groundSampleCarto.longitude = record.carto.longitude;
|
||||
groundSampleCarto.latitude = record.carto.latitude;
|
||||
groundSampleCarto.height = height;
|
||||
return Cesium.Cartographic.toCartesian(
|
||||
groundSampleCarto,
|
||||
Cesium.Ellipsoid.WGS84,
|
||||
result,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the camera can see the ground under the record: inside the view
|
||||
* frustum and above the horizon. scene.sampleHeight reads only surface
|
||||
* rendered for the current view, so a sample of unseen ground passes through
|
||||
* the Earth (about -6,344 km near Ashburn on Esri) and fails on every 2 s
|
||||
* retry, each one a full offscreen render; 110 unseen data centres there held
|
||||
* rest frames at 58-589 ms. Unsampled bases sit on the ellipsoid, so the test
|
||||
* uses loaded globe terrain when there is some. Otherwise (a hidden globe) it
|
||||
* tests the vertical across +/-GROUND_SAMPLE_MAX_ABS_HEIGHT_M, every height a
|
||||
* sample can accept, so high or below-ellipsoid ground in view is never
|
||||
* mistaken for an unseen base. Unseen ground is sampled on the first walk that
|
||||
* sees it.
|
||||
*/
|
||||
function groundSampleInView(viewer, record) {
|
||||
const camera = viewer.camera;
|
||||
const globe = viewer.scene.globe;
|
||||
const terrain = globe?.show ? globe.getHeight?.(record.carto) : undefined;
|
||||
const known =
|
||||
Number.isFinite(terrain) &&
|
||||
Math.abs(terrain) <= GROUND_SAMPLE_MAX_ABS_HEIGHT_M;
|
||||
const low = groundSamplePoint(
|
||||
record,
|
||||
known ? terrain : -GROUND_SAMPLE_MAX_ABS_HEIGHT_M,
|
||||
groundSampleLow,
|
||||
);
|
||||
const high = known
|
||||
? low
|
||||
: groundSamplePoint(
|
||||
record,
|
||||
GROUND_SAMPLE_MAX_ABS_HEIGHT_M,
|
||||
groundSampleHigh,
|
||||
);
|
||||
// The vertical is unseen only when both ends are outside the same plane.
|
||||
const { planes } = camera.frustum.computeCullingVolume(
|
||||
camera.positionWC,
|
||||
camera.directionWC,
|
||||
camera.upWC,
|
||||
);
|
||||
for (const plane of planes) {
|
||||
if (
|
||||
Cesium.Cartesian3.dot(plane, low) + plane.w < 0 &&
|
||||
Cesium.Cartesian3.dot(plane, high) + plane.w < 0
|
||||
)
|
||||
return false;
|
||||
}
|
||||
// The ellipsoidal occluder hides every point below the ellipsoid from a
|
||||
// camera near it, so ground below 0 m (low-geoid coasts, the Dead Sea) is
|
||||
// tested at 0 m; unknown ground at the top of the vertical.
|
||||
const horizonHeight = known
|
||||
? Math.max(terrain, 0)
|
||||
: GROUND_SAMPLE_MAX_ABS_HEIGHT_M;
|
||||
groundSampleOccluder.cameraPosition = camera.positionWC;
|
||||
return groundSampleOccluder.isPointVisible(
|
||||
groundSamplePoint(record, horizonHeight, groundSampleHigh),
|
||||
);
|
||||
}
|
||||
|
||||
function sampleLocalGroundHeight(viewer, record, now) {
|
||||
if (record.groundSampled || !viewer.scene.sampleHeightSupported) return false;
|
||||
if (now - record.lastGroundSampleMs < GROUND_SAMPLE_RETRY_MS) return false;
|
||||
if (!groundSampleInView(viewer, record)) return false;
|
||||
record.lastGroundSampleMs = now;
|
||||
const globe = viewer.scene.globe;
|
||||
if (globe?.show && globe.tilesLoaded === false) return false;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { readFileSync } from 'node:fs';
|
||||
import { rm } from 'node:fs/promises';
|
||||
import {
|
||||
LOCAL_RECEIVERS_ROUTE,
|
||||
createLocalReceiversHandler,
|
||||
@@ -8,6 +9,10 @@ import {
|
||||
parseLocalReceiverFeeds,
|
||||
} from '../../server/providers/local-receivers.js';
|
||||
import { localProviderPlugins } from '../../server/providers/local.js';
|
||||
import { makeFixtureRoot } from '../tooling/fixtureRoot.mjs';
|
||||
|
||||
const nominatimStorageDir = await makeFixtureRoot('gev-receivers-composition-');
|
||||
test.after(() => rm(nominatimStorageDir, { recursive: true, force: true }));
|
||||
|
||||
const FIXTURE = readFileSync(
|
||||
new URL('./fixtures/adsb-austin-dump1090-aircraft.json', import.meta.url),
|
||||
@@ -118,7 +123,7 @@ test('construction mounts the route once and neither parses nor fetches', (t) =>
|
||||
t.mock.method(globalThis, 'fetch', () => {
|
||||
throw Error('construction must not fetch');
|
||||
});
|
||||
const plugins = localProviderPlugins();
|
||||
const plugins = localProviderPlugins({ nominatimStorageDir });
|
||||
assert.equal(
|
||||
plugins.filter((plugin) => plugin.name === 'local-receivers-proxy').length,
|
||||
1,
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"AK","state":"Alaska","fips":"02","features":[{"geoid":"0200065","name":"Adak","full":"Adak city","lsad":"city","polygons":[[[-1766965,518536,115,-143,3,-288,815,0,533,339,-114,0,-127,-30,-39,-2,-35,-34,-50,-11,-6,-11,-45,-3,16,41,-38,-6,-28,11,5,56,19,6,4,14,31,24,-8,17,19,7,6,10,68,10,-65,38,-44,-15,8,-20,-25,-19,-25,3,-15,11,-24,-11,-32,0,-36,11,-96,3,-27,-11,-40,10,-49,0,-37,-11,-67,4,-16,-29,-59,-8,-48,9,-14,17,-8,19,10,42,123,22,23,13,94,8,18,19,22,44,-22,21,-8,65,12,20,0,51,76,163,23,15,157,49,40,4,37,-5,36,24,63,24,115,22,75,-7,31,-11,2,-41,16,-15,45,8,10,9,-23,16,9,29,14,14,52,24,-16,30,5,17,25,18,8,25,24,20,-32,22,-34,3,-96,71,-41,98,-10,0,-17,49,-70,21,-455,7,-56,44,-56,10,-78,-32,-176,-51,-96,1,-9,-21,24,-39,-7,-48,23,-17,37,2,61,-18,23,2,12,-20,35,-26,4,-23,28,-14,-1,-22,-22,-33,7,-12,26,-11,23,0,22,-19,-13,-14,-111,0,-468,-437]]]},{"geoid":"0200650","name":"Akhiok","full":"Akhiok city","lsad":"city","polygons":[[[-1542668,569259,517,0,528,72,0,114,39,18,-7,13,36,12,-11,22,-21,-1,-5,20,-19,-4,53,42,9,18,-25,25,16,10,-1111,0]]]},{"geoid":"0200760","name":"Akiachak","full":"Akiachak CDP","lsad":"CDP","cdp":true,"polygons":[[[-1614587,609108,106,-27,47,9,21,-11,45,0,45,-14,-58,1,-41,10,-48,-4,38,-30,36,-13,147,-22,67,11,80,48,61,16,64,-4,91,-37,107,-82,66,27,34,28,-16,17,-54,22,-68,8,-33,35,42,19,63,14,30,-10,18,-26,5,-29,17,-16,25,-3,13,16,-23,19,19,18,61,4,35,-6,53,12,-4,10,-54,36,-3,42,-121,158,-29,-1,-30,22,19,18,-24,-2,-18,10,3,37,-117,-10,-76,18,-22,-4,-17,-24,-27,-2,-38,11,-15,34,-49,6,-46,-6,-79,-34,53,-21,-9,-24,37,-17,-32,-23,20,-27,-34,-3,-40,16,-20,-17,-23,-1,-7,-15,25,-13,-27,-13,-41,-6,4,-23,-20,-27,-55,44,-57,19,-7,-22,-24,-17,-3,-58,-96,-14]]]},{"geoid":"0200870","name":"Akiak","full":"Akiak city","lsad":"city","polygons":[[[-1612344,608917,445,0,-1,289,-446,0]]]},{"geoid":"0201090","name":"Akutan","full":"Akutan city","lsad":"city","polygons":[[[-1659430,541813,247,0,0,-578,246,0,0,-145,731,0,0,-145,738,0,0,145,736,0,-5,19,15,18,128,53,24,19,-5,14,-43,14,-9,25,9,34,-102,26,-36,-25,-35,-4,-19,-23,-7,-26,-131,-19,-83,-42,-131,-7,-7,32,-17,18,-62,0,-33,-34,-5,-33,-73,-24,-169,45,-93,4,-81,25,-61,-1,-36,23,-64,7,-60,24,-52,0,-59,17,-171,-2,-19,26,7,30,38,21,78,13,195,-20,31,-18,45,1,38,18,57,-5,29,15,95,2,64,16,57,41,114,40,88,-5,26,6,-45,33,-43,-3,-16,14,-10,30,-90,85,-38,10,-45,-6,-105,43,-67,-5,-68,22,-100,57,-81,-22,-38,-20,-33,3,-27,21,0,24,29,32,45,22,41,4,21,14,2,15,-45,17,-59,-14,-81,-48,-202,-163,-45,-3,-233,51,-55,25,-17,21,5,28,-57,22,-59,38,-24,32,2,21,55,35,26,7,10,54,26,23,31,10,19,25,-12,31,5,25,-67,76,-159,39,-69,7,-57,-19,-67,-36,-109,-12,-81,9,-43,14,-7,65,-40,31,0,19,-22,17,-47,-17,-22,-31]],[[-1656791,542343,100,-53,316,4,114,49,19,19,2,21,38,18,24,29,38,18,140,-22,95,-35,57,-50,22,-40,0,-46,-34,-30,-42,-16,-41,-44,-78,-3,-188,-89,-71,-19,-36,-45,-45,-29,-10,-31,50,-27,62,-77,50,-42,74,-29,145,-11,26,-24,-2,-40,-17,-57,-33,-36,-81,-50,-36,-42,-93,-66,-45,-15,-69,10,-102,-21,-43,-22,86,-10,43,-13,43,-23,0,-24,23,-17,45,-8,41,-22,28,-63,48,-10,12,-48,40,-21,31,22,57,4,240,-78,112,-4,17,31,33,12,90,3,36,22,14,57,26,23,33,11,19,46,-19,21,-59,26,-50,8,-90,-1,-12,18,19,18,26,4,29,21,-29,16,-5,21,69,15,50,29,41,6,38,-7,90,-46,-1,663,-493,0,-1,289,-106,0,0,145,-494,0,0,-145,-489,0]]]},{"geoid":"0201200","name":"Alakanuk","full":"Alakanuk city","lsad":"city","polygons":[[[-1647500,627112,305,0,4,-722,1568,0,0,144,308,0,-3,433,315,0,-1,289,-1249,1,1,144,-1248,0]]]},{"geoid":"0201305","name":"Alatna","full":"Alatna CDP","lsad":"CDP","cdp":true,"polygons":[[[-1530015,665958,25,-62,23,-27,81,-60,52,-5,44,-17,21,-46,120,-63,7,-16,-17,-35,8,-10,1,-71,39,-23,-47,-33,0,-16,68,-18,86,0,56,-9,-1,-7,94,-14,91,-1,64,-15,79,8,30,-16,41,6,72,-8,68,10,51,-5,120,37,44,0,24,11,36,-4,22,9,106,-19,20,-19,18,-2,18,-39,38,-12,74,-7,16,-11,-25,-3,-25,-53,-58,-19,-17,-20,-72,-5,-40,-27,2,-16,-37,-6,27,-19,-43,-4,11,-25,-43,-17,20,-13,-42,-2,4,-17,-92,-88,210,-6,187,5,329,-33,53,2,68,21,16,32,45,15,14,34,-6,42,-15,37,-25,36,-14,7,10,33,62,37,118,54,57,45,35,12,34,-1,71,-15,-8,-11,74,-4,70,8,53,12,100,68,76,26,158,12,68,-19,-1,345,163,0,13,15,-97,98,-33,-8,-642,14,-2462,147,5,-35,-47,-30]]]},{"geoid":"0201390","name":"Alcan Border","full":"Alcan Border CDP","lsad":"CDP","cdp":true,"polygons":[[[-1413223,626355,17,-62,101,-91,134,-59,3,-37,-57,-55,72,-56,-24,-3,16,-19,-12,-17,28,-10,-36,-2,23,-8,18,-26,14,1,-17,-23,70,-32,4,18,21,-17,5,17,52,-22,19,10,14,-10,29,1,24,14,14,-9,-26,-13,25,0,-24,-14,24,-11,42,0,-42,-20,66,5,-1,-16,24,-5,3,12,68,-26,-28,-13,36,-22,-9,-8,-53,-1,-22,-18,51,8,33,-5,9,-22,-14,-12,57,-15,19,9,30,-2,-14,-11,58,0,31,-21,-1,25,17,1,3,-16,18,-10,46,4,17,-4,-23,-5,64,-19,-10,12,46,4,-1,-13,38,-9,8,16,-27,12,66,2,14,17,0,-22,20,-5,75,6,6,12,27,-20,-19,-7,19,-12,-31,6,-17,-11,19,4,29,-16,4,12,19,-15,69,-14,-23,-24,31,-1,-17,11,61,2,22,10,5,-14,55,-12,-13,-27,36,-6,-2,16,30,-17,-1,12,25,-4,1,-12,67,13,14,-20,33,-6,56,16,-4,11,-38,6,62,23,33,3,3,9,38,-3,39,24,130,-27,30,-14,37,Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"AL","state":"Alabama","fips":"01","features":[{"geoid":"0100100","name":"Abanda","full":"Abanda CDP","lsad":"CDP","cdp":true,"polygons":[[[-855420,331037,13,-55,47,-73,4,-26,72,-49,-9,-23,-40,-43,-9,-29,46,9,98,0,42,22,0,43,83,21,-1,29,-96,106,-35,19,-34,-12,25,44,47,5,30,17,-7,45,-271,-6,0,-27]]]},{"geoid":"0100124","name":"Abbeville","full":"Abbeville city","lsad":"city","polygons":[[[-852958,315472,246,0,0,31,86,0,31,-64,-7,-118,77,1,2,38,88,-6,4,68,134,-5,-4,-53,91,-5,2,26,27,-2,-2,-26,34,-3,3,23,31,-2,2,28,-22,1,-9,14,-32,3,16,281,-9,147,-81,4,-7,72,-71,3,-12,72,-38,0,10,-71,-506,12,2,-190,-45,-4,-2,-124,-38,1]]]},{"geoid":"0100460","name":"Adamsville","full":"Adamsville city","lsad":"city","polygons":[[[-870488,336355,26,-1,16,8,1,-19,44,0,1,-72,212,0,-3,12,12,24,21,-1,1,-36,-23,1,0,-38,-47,1,0,-36,17,-16,17,-59,-32,1,1,-37,46,-1,8,65,18,-29,19,0,0,9,93,23,1,-181,11,-11,16,0,6,11,40,0,0,-18,-16,0,-20,-27,-9,0,0,-18,-30,18,2,-27,87,-1,1,54,5,0,1,-23,36,12,1,-25,23,0,2,18,14,-4,-19,-28,23,-5,-1,-36,-32,0,-11,15,-22,-15,0,-36,-22,0,0,-37,36,-36,48,-1,-1,-62,7,-10,55,-1,20,-49,11,27,36,21,5,-13,19,0,8,-9,10,14,-2,-16,53,-23,0,-22,-20,-16,-18,-42,8,-6,118,-20,43,-60,18,-9,36,-1,10,19,2,28,15,7,32,-21,63,2,-6,-4,27,-20,18,0,34,17,-5,18,-25,8,-1,9,17,7,-26,1,0,7,25,-1,0,14,-40,4,-11,18,-4,66,27,-5,9,10,6,-14,38,-6,0,-158,24,-59,16,0,5,-85,-10,-19,12,6,9,-15,-16,-5,-1,-50,-13,-7,39,-18,36,14,-18,10,13,23,-13,19,1,175,97,-11,1,9,-22,0,0,9,32,0,1,27,-154,1,1,112,43,-1,0,37,-18,0,0,-21,-21,0,0,14,-19,-5,15,13,0,29,28,-4,4,10,-32,1,2,69,-38,-18,-20,21,55,37,4,-18,80,-5,-2,16,-77,15,0,11,17,9,-4,21,-23,-7,10,-5,-1,-36,-15,0,1,30,-12,13,0,-13,-17,-4,11,21,-42,15,-1,-24,32,-2,0,-9,-63,-6,-5,34,7,27,-28,15,4,51,-39,9,-4,64,-58,-3,-29,4,-16,10,-5,-8,-20,7,3,14,84,-9,-4,38,-87,2,-1,60,-14,-3,-15,10,-6,16,-5,-26,-8,7,-42,-1,-83,-19,44,-1,1,-21,-25,-1,-20,10,1,-29,11,0,0,-18,-45,0,0,18,-37,9,-3,-26,-13,0,0,35,43,0,0,35,-40,0,0,10,-33,27,-27,0,8,-8,-14,-15,-3,23,-108,4,0,37,85,-3,0,66,8,6,81,1,-2,207,11,11,12,0,22,71,-141,3,1,53,-86,22,-44,0,-4,22,-37,-34,-5,-19,3,62,-27,-36,-24,-13,-28,21,-47,64,-35,35,-19,11,-20,-3,-27,-22,-48,-90,8,-19,19,0,-7,-20,17,1,0,5,34,-5,3,20,41,-18,-52,-36,-100,-38,-24,-34,-19,-47,1,-55,-21,0,-40,-23],[-869779,335825,89,-1,-1,73,174,-2,-1,-36,-86,1,-3,-110,-174,2]],[[-869343,335929,44,-1,1,37,35,-1,8,35,13,0,1,-19,15,-1,0,-16,15,0,-1,-37,43,-1,0,-30,-54,4,10,-9,152,-3,-7,11,28,-1,1,79,43,-1,0,-38,25,0,0,14,17,-12,-1,75,-40,5,-1,47,22,-1,-22,17,6,21,-28,0,0,-37,-56,1,1,65,-52,9,0,37,-43,0,0,-18,-23,0,22,-5,-1,-50,43,-1,1,-36,-108,3,-22,14,0,-13,-45,0,1,-28,23,1,3,-14,-69,5]],[[-869707,336730,6,-82,8,-5,-12,-14,-21,-80,66,0,14,26,43,35,-21,50,42,20,-8,13,-55,2,4,-18,-35,-3,-20,41,0,42,36,0,-3,10,-33,6,0,20,-19,9,-12,26,8,13,-16,0]]]},{"geoid":"0100484","name":"Addison","full":"Addison town","lsad":"town","polygons":[[[-872034,342013,49,-1,0,-44,15,-15,14,-1,6,15,12,0,4,-28,-15,-10,-33,-2,6,-24,21,0,22,28,10,0,1,-35,-13,-25,11,-39,64,0,-9,-7,13,-26,7,23,-7,10,7,79,44,0,1,27,38,0,0,-76,14,14,-2,26,35,1,4,19,16,0,0,15,156,0,0,-33,45,0,0,30,10,-2,14,14,0,15,-24,9,-45,-8,-8,14,0,68,-121,-1,1,71,43,4,0,-12,24,0,0,37,26,20,0,-13,14,0,1,15,-12,0,32,23,26,-13,15,29,-32,14,-94,-73,0,42,-85,0,0,-36,-133,1,0,-32,-51,0,0,-41,-42,-1,0,-34,-79,7,-17,-8]]]},{"geoid":"0100676","name":"Akron","full":"Akron town","lsad":"town","polygons":[[[-877497,328726,160,-2,1,29,-107,134,-53,-58]]]},{"geoid":"0100820","name":"Alabaster","full":"Alabaster city","lsad":"city","d":5,"polygons":[[[-8687877,3323076,438,-6,-8,-594,434,-7,-1,-140,769,-20,-8,-144,-99,-323,-240,6,-1,-257,268,-1,39,-153,163,-219,-185,3,-4,-36,-523,5,36,-59,477,-9,-6,-30,-285,-60,-89,2,187,-155,114,-12,-1,-67,43,-146,-181,208,-493,8,1,374,-301,1,-133,-40,5,-1042,432,-20,13,-2548,431,-15,-8,366,492,-10,83,357,-321,7,-41,-268,-218,-14,-19,1032,489,-38,-37,-73,300,20,-16,100,-115,341,260,-2,-3,-378,434,-7,-2,-368,291,-6,4,379,133,-47,-9,-703,452,-10,2,-351,1141,-31,153,-117,-5,-247,434,-10,6,366,177,52,-34,1,35,60,220,69,-119,-121,241,101,-60,-177,1,-500,481,-5,-8,-62,282,-6,4,553,-328,8,-1,94,-320,0,-62,158,-11,80,1019,-77,-185,-273,41,-538,141,-270,115,-60,347,78,57,-161,131,-6,-282,-224,311,-5,1,245,243,134,-151,177,-46,-33,-126,-38,0,387,29,172,242,-10,-1,-143,208,-11,32,240,432,-22,9,-862,16,-3,2,129,422,-13,-4,178,438,-6,1,180,589,-12,-571,1125,757,-25,-2,47,43,-1,27,-642,167,-252,214,-92,81,3,-7,361,445,-16,0,381,59,-109,888,-46,-166,307,241,102,78,-119,663,-16,7,735,-895,17,-5,125,-537,24,-129,215,-145,126,-67,-163,-496,-59,65,133,-136,5,-84,362,237,48,-186,210,-250,521,536,-34,-3,333,-67,55,-263,-19,-1,75,-220,-11,1,-80,-309,-11,-9,-186,202,-229,-176,-160,-186,151,-419,9,8,130,-689,34,-623,769,462,-2,-1,194,-234,30,-66,-116,-176,-106,-126,205,7,250,287,-98,307,-12,2,184,68,46,-4,116,-65,-4,-4,390,1094,-22,25,336,-32,4,4,-337,-1094,21,3,-395,69,-107,-150,-44,-176,150,-48,-206,-34,262,-137,166,-257,425,90,123,632,-15,-1,723,425,3,-3,356,437,Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"AR","state":"Arkansas","fips":"05","features":[{"geoid":"0500190","name":"Acorn","full":"Acorn CDP","lsad":"CDP","cdp":true,"polygons":[[[-942258,346517,72,-69,24,-34,32,-78,-5,-80,-34,-42,37,-22,88,17,30,-2,25,-11,10,-28,15,-8,16,0,38,34,10,49,-9,13,0,35,44,12,25,19,15,45,-16,29,-17,3,-18,28,-4,29,18,4,1,47,-93,2,-18,39,-107,1,-1,-66,-15,5,-38,53,-36,14,-62,-2,-61,-19]]]},{"geoid":"0500250","name":"Adona","full":"Adona city","lsad":"city","polygons":[[[-929103,350346,221,-3,3,109,-222,4]]]},{"geoid":"0500580","name":"Alexander","full":"Alexander city","lsad":"city","polygons":[[[-924723,346094,46,-2,0,-37,277,-2,-4,34,7,16,-19,18,-13,-5,12,30,-21,0,3,28,44,22,1,36,-35,1,-7,15,45,2,6,19,-49,0,50,44,-47,38,-22,-15,2,44,-8,15,9,9,3,61,-52,-8,-2,-31,8,0,8,-47,-27,0,-27,-11,0,-9,43,-1,-1,-52,32,-12,-21,-23,-191,-143,-49,1]]]},{"geoid":"0500700","name":"Alicia","full":"Alicia town","lsad":"town","polygons":[[[-910886,358875,100,-5,2,110,-56,3,30,36,-10,6,4,-8,-28,-33,-39,2]]]},{"geoid":"0500730","name":"Alix","full":"Alix CDP","lsad":"CDP","cdp":true,"polygons":[[[-937366,354212,40,-1,5,-38,12,1,-1,-33,45,-2,0,34,45,0,-24,54,-17,10,1,18,43,23,-132,7,-1,-20,21,0,-1,-30,-34,-7]]]},{"geoid":"0500820","name":"Alleene","full":"Alleene CDP","lsad":"CDP","cdp":true,"polygons":[[[-942841,337672,290,-175,24,37,4,39,14,12,-10,21,41,19,16,32,77,27,-313,76,-18,-6,-18,-25,-24,-11,-19,4,-5,-21,-39,-12]]]},{"geoid":"0500940","name":"Allport","full":"Allport town","lsad":"town","polygons":[[[-917973,345415,110,-1,4,-39,17,7,-1,-58,-17,1,17,-6,-1,-46,-20,1,0,-10,23,0,2,119,45,0,1,51,10,8,-48,1,-6,19,-1,-33,-26,-3,0,-8,-104,2,-5,6,0,-6]]]},{"geoid":"0500970","name":"Alma","full":"Alma city","lsad":"city","polygons":[[[-942543,354939,9,-12,134,-2,-14,-6,-1,-12,24,-15,-1,-77,40,-1,8,-36,18,-12,24,6,-2,-67,134,-3,-1,-36,24,0,0,-14,-24,0,0,-23,45,0,1,54,-30,1,-11,18,86,-1,2,72,-27,1,5,22,-22,-1,1,20,135,9,24,57,66,-2,4,36,82,6,91,35,65,12,1,44,-49,76,-110,-2,0,-8,42,-2,0,-58,-67,1,-19,-25,37,-17,47,-8,-49,-16,9,-30,-71,-7,-155,15,0,21,-150,-23,-15,-16,-17,6,2,18,37,9,0,17,20,12,2,44,17,32,-22,17,1,17,26,16,15,1,9,21,47,-8,16,11,-31,15,17,21,-19,45,-13,-5,0,-23,-32,-17,-58,-51,-15,-18,-8,-28,-57,52,8,-31,13,-5,0,-9,-12,-6,-44,2,0,18,-33,0,-11,18,-2,-72,-40,1,-14,-26,-28,1,-7,19,6,32,-12,12,-32,0,2,-35,20,-1,0,-24,17,5,-2,-8,-39,1,-1,8,-20,1,0,18,-22,1,-2,-46,45,-1,-1,-28,-66,2]]]},{"geoid":"0501030","name":"Almyra","full":"Almyra town","lsad":"town","polygons":[[[-914176,344020,133,0,2,74,-133,0]]]},{"geoid":"0501060","name":"Alpena","full":"Alpena town","lsad":"town","polygons":[[[-933157,362819,84,0,6,-31,43,-1,1,31,44,0,2,74,92,0,2,80,-270,-5]]]},{"geoid":"0501090","name":"Alpine","full":"Alpine CDP","lsad":"CDP","cdp":true,"polygons":[[[-933999,342255,19,-8,17,2,35,-29,142,10,7,-52,115,27,41,79,3,24,-77,-7,1,70,-21,-19,-145,-26,-36,-15,-9,4,-14,-33,-23,-4,-9,-9,-18,5,-31,-10]]]},{"geoid":"0501150","name":"Altheimer","full":"Altheimer city","lsad":"city","polygons":[[[-918728,343168,161,-5,0,-26,155,-11,2,71,76,-3,3,118,-44,1,1,72,-14,0,23,41,-310,-229,-53,-18]]]},{"geoid":"0501210","name":"Altus","full":"Altus city","lsad":"city","polygons":[[[-937892,354759,58,-12,-1,-12,31,-15,-13,-18,15,-6,37,-72,-18,0,-1,-24,31,-1,-1,-11,-30,1,1,-11,41,-31,3,22,40,-62,-2,-50,-28,-16,-17,1,-1,-37,44,-1,-2,-72,223,-7,2,73,-44,1,4,109,-134,4,2,37,-37,1,-1,-28,-11,3,-22,44,27,-1,1,18,-41,1,-37,74,35,-1,1,19,-44,1,3,54,43,-1,2,36,45,-2,2,37,-90,3,-1,-37,-23,1,-1,-33,-12,1,9,18,-18,15,2,36,-12,1,-2,-53,-58,18]]]},{"geoid":"0501270","name":"Amagon","full":"Amagon town","lsad":"town","polygons":[[[-911119,355604,30,-3,8,12,18,2,1,41,-60,0]]]},{"geoid":"0501360","name":"Amity","full":"Amity city","lsad":"city","polygons":[[[-934804,342563,11,24,34,0,-1,-17,-18,-37,304,-5,0,32,-22,6,1,35,17,-1,26,-22,2,58,-44,1,1,36,-44,1,1,36,44,0,0,18,44,-1,1,55,-44,1,1,26,-44,1,-1,-27,-263,4,-4,-135]]]},{"geoid":"0501457","name":"Anthonyville","full":"Anthonyville town","lsad":"town","polygons":[[[-903425,350372,21,-1,0,12,25,0,1,36,-47,1]]]},{"geoid":"0501540","name":"Antoine","full":"Antoine town","lsad":"town","polygons":[[[-934283,340278,88,0,-1,61,61,7,-26,34,-30,20,-88,2]]]},{"geoid":"0501630","name":"Aplin","full":"Aplin CDP","lsad":"CDP","cdp":true,"polygons":[[[-930023,349657,38,-10,30,1,32,-30,38,-13,19,-31,43,1,14,8,8,26,14,2,-1,-25,16,-16,34,-7,-1,35,23,7,18,-6,25,-27,10,0,35,31,-26,14,7,33,30,55,-10,26,-79,9,-15,31,-34,-11,-1,15,-19,0,-35,-26,-211,1]]]},{"geoid":"0501660","name":"Appleton","full":"Appleton CDP","lsad":"CDP","cdp":true,"polygons":[[[-929068,354342,11,-23,32,-14,28,-32,26,-10,22,-52,33,-39,8,10,34,-23,2,-20,44,-21,41,-62,40,-35,113,-57,114,-24,6,336,-44,-8,-64,6,17,31,-9,21,11,19,-397,5,-59,10]]]},{"geoid":"0501870","name":"Arkadelphia","full":"Arkadelphia city","lsad":"city","polygons":[[[-931112,341076,49,-1,38,36,44,-2,0,22,17,0,5,14,18,-1,-7,-13,10,-9,-16,0,-28,-48,42,-2,1,36,64,-2,1,36,22,0,-1,-36,42,-1,0,-37,45,-1,1,18,88,-3,Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"AS","state":"American Samoa","fips":"60","features":[{"geoid":"6000100","name":"Aasu","full":"Aasu village","lsad":"village","polygons":[[[-1707739,-143135,28,-8,32,1,42,-13,32,7,-8,-11,14,-21,10,17,62,4,31,15,28,-47,26,31,3,48,40,69,7,43,12,14,59,10,-101,68,-12,-9,-30,-4,-21,9,-27,-24,-11,-24,-11,-1,-19,46,-14,4,-31,-11,-16,9,10,28,-10,11,-18,-4,-10,-20,-26,8,-10,-4,-57,-138,2,-86]]]},{"geoid":"6002500","name":"Afao","full":"Afao village","lsad":"village","polygons":[[[-1708043,-143324,28,5,21,-11,0,-9,27,178,-5,11,-68,2,-9,-21]]]},{"geoid":"6003300","name":"Afono","full":"Afono village","lsad":"village","polygons":[[[-1706592,-142641,29,-13,24,-60,78,15,13,79,63,77,-16,71,-6,-2,4,-42,-10,-13,-17,-1,0,25,-24,13,-5,-20,6,-20,-8,-22,-17,-5,-12,9,-12,-11,-3,-25,-19,-4,-14,12,-1,16,7,48,12,20,-8,8,-42,-93,-34,-33]]]},{"geoid":"6004500","name":"Agugulu","full":"Agugulu village","lsad":"village","polygons":[[[-1708215,-143310,20,-2,12,-12,10,4,-34,131,-13,-34]]]},{"geoid":"6004900","name":"Alao","full":"Alao village","lsad":"village","polygons":[[[-1705782,-142619,110,-61,12,-27,15,9,-5,12,30,88,2,17,-10,11,-15,-9,-22,5,-68,-7,-28,-21]]]},{"geoid":"6006500","name":"Alega","full":"Alega village","lsad":"village","polygons":[[[-1706461,-142699,10,-36,49,-130,11,19,0,33,9,11,41,-8,-66,109,-46,3]]]},{"geoid":"6007300","name":"Alofau","full":"Alofau village","lsad":"village","polygons":[[[-1706049,-142725,13,-48,-36,-31,49,-37,35,23,24,6,-1,105,-37,26,-71,-38]]]},{"geoid":"6008100","name":"Amaluia","full":"Amaluia village","lsad":"village","polygons":[[[-1707946,-143337,10,-14,6,12,13,0,14,-7,-1,-13,10,-10,62,179,27,39,-33,9,-37,31,-19,6,-8,-2,2,-42,-11,-29,9,-24,-4,-20,-21,-14,-17,-78]]]},{"geoid":"6008900","name":"Amanave","full":"Amanave village","lsad":"village","polygons":[[[-1708462,-143233,46,-11,23,7,33,-23,36,13,23,-20,8,-31,27,33,-13,6,21,54,-24,6,-119,-22,-19,10,-49,-13]]]},{"geoid":"6009700","name":"Amaua","full":"Amaua village","lsad":"village","polygons":[[[-1706316,-142664,31,-46,44,-33,1,11,30,20,-13,50,-21,39,-49,-32]]]},{"geoid":"6010500","name":"Amouli","full":"Amouli village","lsad":"village","polygons":[[[-1705964,-142812,8,10,45,5,13,21,30,10,-5,11,24,16,23,6,16,-3,1,-11,23,-1,20,8,-27,28,-30,61,-116,-69,-26,13,-5,-12]]]},{"geoid":"6011300","name":"Anua","full":"Anua village","lsad":"village","polygons":[[[-1706893,-142718,35,3,-24,61,-16,6]]]},{"geoid":"6012100","name":"Aoa","full":"Aoa village","lsad":"village","polygons":[[[-1705939,-142720,116,69,22,-1,19,33,21,17,-103,60,2,-29,14,-30,-26,-16,-31,-3,-11,43,-47,-131]]]},{"geoid":"6012800","name":"Aoloau","full":"Aoloau village","lsad":"village","polygons":[[[-1707946,-142928,29,-44,15,-135,27,-4,37,-31,145,-44,80,-11,0,38,8,11,-32,-7,-102,20,6,17,-2,86,57,138,-62,-37,-13,21,-27,-10,-6,-23,-21,-8,-22,77,-21,-2,-6,-25,-42,-3,-7,6,-12,-8,-29,-2]]]},{"geoid":"6013700","name":"Asili","full":"Asili village","lsad":"village","polygons":[[[-1707975,-143316,25,1,4,-22,19,101,21,14,4,20,-9,24,11,29,-2,42,-37,-9,-33,-34,5,-11,-27,-178]]]},{"geoid":"6014500","name":"Atu'u","full":"Atu'u village","lsad":"village","polygons":[[[-1706876,-142674,20,-37,14,14,-16,46,-19,-1]]]},{"geoid":"6015300","name":"Aua","full":"Aua village","lsad":"village","polygons":[[[-1706671,-142699,19,-10,10,-26,-14,-27,10,-26,-5,-14,4,-39,14,-37,43,56,51,108,-24,60,-58,18,-78,-5,-18,-54]]]},{"geoid":"6016100","name":"Auasi","full":"Auasi village","lsad":"village","polygons":[[[-1705823,-142651,30,-61,27,-28,2,11,30,18,9,-2,-5,22,-52,72,-19,-33]]]},{"geoid":"6016900","name":"Auma","full":"Auma village","lsad":"village","polygons":[[[-1707860,-143368,33,37,-15,41,-12,-6,-7,15,-32,-86]]]},{"geoid":"6017700","name":"Aumi","full":"Aumi village","lsad":"village","polygons":[[[-1706544,-142729,12,-40,31,-57,-12,-52,4,-17,40,21,17,-8,22,18,28,-1,-59,166,-78,-15]]]},{"geoid":"6018500","name":"Aunu'u","full":"Aunu'u village","lsad":"village","polygons":[[[-1705617,-142857,30,-24,26,-5,16,11,39,-17,24,9,23,26,2,25,-33,36,-16,-3,-29,16,-50,-14,-17,-13,-8,-28]]]},{"geoid":"6020100","name":"Auto","full":"Auto village","lsad":"village","polygons":[[[-1706324,-142776,41,-21,8,33,34,21,-44,33,-31,46,-38,-14]]]},{"geoid":"6020900","name":"Avaio","full":"Avaio village","lsad":"village","polygons":[[[-1706341,-142810,21,-3,37,16,-41,21,-30,98,-53,-23]]]},{"geoid":"6022500","name":"Faga'alu","full":"Faga'alu village","lsad":"village","polygons":[[[-1706952,-142918,44,-25,42,2,49,-19,46,10,-3,8,-54,28,18,25,16,1,38,31,-119,-17,-20,26,-32,-25,-14,-40]]]},{"geoid":"6023300","name":"Faga'itua","full":"Faga'itua village","lsad":"village","polygons":[[[-1706199,-142663,20,-45,32,27,33,-4,4,-17,8,14,69,41,-22,0,-41,25,-56,-6,-52,6]]]},{"geoid":"6024900","name":"Fagali'i","full":"Fagali'i village","lsad":"village","polygons":[[[-1708274,-143171,16,-34,17,1,62,32,-58,147,-34,-51,-22,-5,-30,-28]]]},{"geoid":"6025700","name":"Fagamalo","full":"Fagamalo village","lsad":"village","polygons":[[[-1708122,-1Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"AZ","state":"Arizona","fips":"04","features":[{"geoid":"0400730","name":"Aguila","full":"Aguila CDP","lsad":"CDP","cdp":true,"polygons":[[[-1131855,339431,59,-3,31,7,-39,-19,1,-59,38,0,0,-73,217,3,1,143,-43,0,-1,42,-84,-18,-178,0]]]},{"geoid":"0400870","name":"Ajo","full":"Ajo CDP","lsad":"CDP","cdp":true,"polygons":[[[-1129509,323966,33,-131,4,-72,19,-21,-4,-11,11,-24,30,-20,41,-46,29,-13,40,14,37,-35,29,-55,19,-12,65,0,41,-22,22,-1,21,-22,19,-7,36,-7,17,-12,68,-10,40,-21,60,-1,65,-16,53,6,23,-17,29,-5,55,10,111,-22,38,41,22,10,84,11,40,26,16,38,-7,61,-99,89,-122,24,-32,27,-39,0,30,113,74,126,86,307,2,24,-18,60,2,25,31,104,-37,45,-69,7,-4,54,-94,67,-153,2,19,-68,-1,-186,16,1,-1,-71,-303,-3,-28,-42,-10,-32,8,-25,-11,-51,-44,-49,-43,-29,-37,-46,-22,-4,-6,-17,-89,-28,-117,29,-56,-22,-18,-28,-12,-2]]]},{"geoid":"0400940","name":"Ak Chin","full":"Ak Chin CDP","lsad":"CDP","cdp":true,"polygons":[[[-1120184,322839,19,-9,53,9,18,-38,43,16,17,19,11,49,-4,12,-33,7,10,41,-64,9,2,-37,11,-19,-30,1,-18,-33,-19,6]]]},{"geoid":"0401090","name":"Ak-Chin Village","full":"Ak-Chin Village CDP","lsad":"CDP","cdp":true,"polygons":[[[-1121173,330003,692,-2,2,363,-86,0,0,35,-87,-1,0,71,-37,-12,15,-13,-6,-9,-244,-2,-32,-53,-12,-4,-19,-22,-29,-4,-4,-20,15,-40,-166,2,-1,-17]]]},{"geoid":"0401170","name":"Alamo Lake","full":"Alamo Lake CDP","lsad":"CDP","cdp":true,"polygons":[[[-1136127,342297,10,-11,48,-15,16,-18,47,4,30,-15,11,7,13,32,-21,9,8,28,37,9,5,-12,50,-22,40,1,-5,-9,8,-8,97,-5,410,-167,-2,-20,12,3,16,22,-7,25,-14,14,-7,38,18,28,212,-186,54,-12,71,14,60,-61,12,78,33,60,-3,75,14,37,-8,35,44,-73,107,-52,70,-10,-76,249,307,-145,-4,31,-51,122,-22,34,-1,17,-10,14,-67,33,45,23,-2,21,-11,12,7,20,12,6,46,-11,35,21,-19,40,49,53,7,50,-7,42,21,28,53,24,32,-3,26,18,39,-10,43,8,10,13,1,21,-30,22,-5,20,2,33,23,14,-24,39,16,8,-68,18,-40,-2,-27,12,-134,-22,-58,7,-135,39,-15,0,-32,-20,-19,1,-12,24,-24,10,-51,-22,-87,20,-47,-23,-86,0,-49,19,-25,-4,-62,60,-29,2,-8,-16,-40,-1,-25,17,-41,-5,-84,-36,-75,-91,1,-9,-69,-108,-16,-3,-63,-52,-43,-45,-27,-10,-4,-47,-7,-10,-37,-15,-27,-32,-59,-45,-13,-19,-34,-145,-105,-62,-22,-39,-56,-38,-11,-2,-13,24,-48,-7]]]},{"geoid":"0401560","name":"Ali Chuk","full":"Ali Chuk CDP","lsad":"CDP","cdp":true,"polygons":[[[-1125721,318126,139,-30,-25,-21,45,-10,15,22,36,-7,15,10,18,28,1,43,22,18,-1,40,-23,30,-45,12,-6,-15,-38,-33,3,24,-136,12]]]},{"geoid":"0401570","name":"Ali Chukson","full":"Ali Chukson CDP","lsad":"CDP","cdp":true,"polygons":[[[-1118201,319030,52,-35,94,-9,15,12,6,32,34,31,21,-3,19,-17,60,22,-18,60,56,-5,7,38,17,23,-75,85,-19,4,-8,-23,-32,-5,-42,-20,-30,-67,-12,-11,-64,-8,-45,11,-18,-12,12,-64,-22,-20]]]},{"geoid":"0401620","name":"Ali Molina","full":"Ali Molina CDP","lsad":"CDP","cdp":true,"polygons":[[[-1117875,318989,-19,-13,9,-25,69,18,86,11,-6,-14,48,15,-19,10,-22,44,-27,30,12,54,-43,-9,13,-23,-46,3,-48,-20,-26,-23]]]},{"geoid":"0401920","name":"Alpine","full":"Alpine CDP","lsad":"CDP","cdp":true,"polygons":[[[-1091539,338431,35,11,0,-27,18,12,41,5,50,-5,41,-22,29,-4,16,23,-61,31,16,21,-13,2,-6,26,12,27,-21,-3,-19,-28,-33,8,-17,18,-22,-18,-19,7,-1,-44,-12,16,0,-23,-35,-6]]]},{"geoid":"0401990","name":"Amado","full":"Amado CDP","lsad":"CDP","cdp":true,"polygons":[[[-1110769,316988,9,-138,24,6,25,24,65,-3,16,-169,36,-180,82,-2,-24,81,25,74,-16,138,-65,45,-6,22,25,20,2,38,-11,24,71,-2,56,-35,13,5,-1,181,43,-1,-30,65,10,3,9,24,-9,15,32,39,-192,0,-36,-71,-26,-77,-15,9,-14,-6,4,-10,-53,-35,-72,-14]]]},{"geoid":"0402270","name":"Anegam","full":"Anegam CDP","lsad":"CDP","cdp":true,"polygons":[[[-1120524,323637,329,1,-4,98,-47,7,-8,46,-22,-8,18,143,-37,-16,-20,-29,-19,-11,-112,-34]]]},{"geoid":"0402410","name":"Antares","full":"Antares CDP","lsad":"CDP","cdp":true,"polygons":[[[-1138169,354165,84,21,87,-2,4,97,-94,1,0,-10,-82,0]]]},{"geoid":"0402430","name":"Anthem","full":"Anthem CDP","lsad":"CDP","cdp":true,"polygons":[[[-1121434,338483,-13,-147,8,-62,89,1,0,147,522,5,1,254,-43,0,0,36,-478,-5,0,72,-120,0]]]},{"geoid":"0402830","name":"Apache Junction","full":"Apache Junction city","lsad":"city","polygons":[[[-1115849,334164,43,5,-1,-292,17,0,0,-12,24,-22,3,-55,-80,0,1,-63,164,1,0,-36,-44,0,0,-36,-119,0,7,-582,27,-2,0,-69,583,0,-17,33,-19,101,-44,140,-153,234,688,0,-3,316,-126,0,0,36,-43,0,0,218,-86,0,-1,217,86,0,-1,218,-28,0,-14,-10,-1,-63,-86,0,0,73,-734,-1,-1,-300,-22,0,0,-26,-20,0]]]},{"geoid":"0403320","name":"Arivaca","full":"Arivaca CDP","lsad":"CDP","cdp":true,"polygons":[[[-1113553,315889,38,-28,-5,-10,102,-75,-36,-7,-19,-17,4,-22,18,-17,12,-46,-1,-57,32,-3,8,-19,-3,-46,55,-72,21,-125,16,-13,8,-39,16,-1,31,25,52,14,24,23,57,8,35,-4,-4,24,46,-6,41,6,39,-32,6,-18,17,-4,48,-68,22,-6,36,20,54,1,59,19,-8,16,17,14,16,5,11,-12,-52,135,-30,54,-18,4,4,22,-10,12,-21,0,-22,34,0,75,49,-20,76,10,51,-17,79,18,105,-23,41,0,13,-8,95,-5,10,72,-9,21,0,171,-75,0,-2,13,30,17,-11,31,33,25,-10,9,23,57,-16,75,-42,-12,-18,10,-25,-3,-31,16,-690,-23,-91,-69,-6,-16,-24,-15,-4,5,-35,-25,-197,-24,-33,-23]]]},{"geoiLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"CA","state":"California","fips":"06","features":[{"geoid":"0600135","name":"Acalanes Ridge","full":"Acalanes Ridge CDP","lsad":"CDP","cdp":true,"polygons":[[[-1220847,379081,41,-17,-1,-32,78,1,-4,5,19,4,-18,28,36,23,-51,0,-21,21,-30,-10,-68,2]]]},{"geoid":"0600156","name":"Acampo","full":"Acampo CDP","lsad":"CDP","cdp":true,"polygons":[[[-1212882,381773,1,-26,-13,0,2,-72,63,-1,0,-25,13,-5,77,1,-21,58,50,0,-3,117,-91,0,7,-20,-13,-7,-86,0]]]},{"geoid":"0600212","name":"Acton","full":"Acton CDP","lsad":"CDP","cdp":true,"polygons":[[[-1182577,344818,117,-1,10,-36,-3,-108,83,1,0,-40,174,-7,-1,30,117,4,2,-32,12,0,3,-68,216,-4,0,-20,356,-17,6,141,298,2,2,141,8,2,210,2,0,-73,170,0,0,219,-411,-2,-19,20,-7,31,-81,76,-14,0,-214,199,-87,-2,1,-39,-133,1,2,76,-92,-2,0,36,-43,2,1,36,-176,4,0,37,-132,1,0,-37,-353,2,-6,-6,6,-17,0,-411,-44,0]]]},{"geoid":"0600296","name":"Adelanto","full":"Adelanto city","lsad":"city","polygons":[[[-1175068,345575,31,0,1,-287,393,-2,2,72,559,0,0,-73,-265,0,0,-110,-252,1,1,35,-155,3,0,-37,-110,2,0,-109,868,-3,1,364,352,-1,1,142,-100,2,-1,148,-243,-2,0,73,-22,0,-1,219,109,0,0,146,-18,0,-1,296,327,-2,-11,24,4,19,-17,103,-393,1,0,-368,-176,-1,-177,3,-2,370,-529,1,-6,-293,89,0,0,-147,89,0,5,-293,-136,-2,-1,-73,-222,-1]]]},{"geoid":"0600310","name":"Adin","full":"Adin CDP","lsad":"CDP","cdp":true,"polygons":[[[-1209714,411843,335,-1,4,63,58,-1,38,14,22,18,17,33,35,28,-41,2,-83,64,-4,12,-13,-7,-38,9,8,-41,-33,-30,-24,-10,-17,0,-123,52,-142,0]]]},{"geoid":"0600394","name":"Agoura Hills","full":"Agoura Hills city","lsad":"city","polygons":[[[-1188004,341394,130,-31,176,-17,132,62,182,-80,16,-16,20,14,63,0,0,-11,46,1,-2,-63,43,0,0,37,-13,24,13,7,0,42,-43,-1,0,19,-51,3,-79,46,0,114,44,0,40,135,-602,3,-39,-222]]]},{"geoid":"0600450","name":"Agua Dulce","full":"Agua Dulce CDP","lsad":"CDP","cdp":true,"polygons":[[[-1183432,344674,-1,-63,27,38,32,13,74,8,-10,31,21,10,26,-2,-1,143,17,35,162,-1,-2,-72,197,2,20,26,9,55,31,26,122,47,102,15,22,9,28,24,1,352,-6,17,8,44,-9,7,-18,-5,-79,16,-14,-4,-30,-34,2,-12,-50,-55,-42,-6,-20,26,1,10,-37,3,-47,-15,1,16,-24,-10,-10,3,-32,-20,-4,10,-57,-24,-28,17,-56,12,-43,-39,-22,-10,-10,-16,-55,-26,-15,-20,-243,-3,-63,-16,-28,21,-32,-32,12,-29,-12,-17,2,-213,-111,-4,-32,-16,-15,-21,-7,-35,5,-78,-14,-136]]]},{"geoid":"0600464","name":"Aguanga","full":"Aguanga CDP","lsad":"CDP","cdp":true,"polygons":[[[-1169035,334466,13,7,9,-15,25,-5,5,-17,36,10,44,-26,117,-15,0,-28,-47,2,-9,-23,-32,-7,-6,-37,9,-19,30,-11,3,-13,620,0,13,15,20,6,6,41,-37,12,-4,12,8,27,-19,0,-20,13,18,13,0,171,-19,4,0,40,-37,16,-3,21,24,3,15,-11,30,28,14,-4,6,12,15,4,-7,9,36,22,-10,38,-15,7,-22,41,-18,-17,-10,-34,-21,-11,-17,6,-13,17,-10,-7,-52,7,3,63,-7,11,-83,-19,-53,-40,-56,0,-45,-18,-1,19,-18,18,-17,-2,-37,-32,-20,8,-19,-13,-15,8,-5,-8,-29,-1,12,-13,-16,-19,14,-49,-3,-20,39,-1,37,-24,-58,-6,-19,-63,-18,52,-73,79,-99,2,5,-138,-53,-13,16,-34,-1,-16,-15,-9,-24,1,-19,16,-22,1,12,-18,-15,-5]]]},{"geoid":"0600478","name":"Ahwahnee","full":"Ahwahnee CDP","lsad":"CDP","cdp":true,"polygons":[[[-1197528,373759,53,-62,1,-32,17,-12,-3,-24,44,-49,-24,-68,-18,-10,41,-55,21,16,23,-16,20,-2,16,15,11,-18,41,-14,79,-49,8,-20,65,-26,20,5,-10,-9,1,-30,130,1,-3,71,31,12,15,-8,64,22,43,-37,61,34,36,7,-18,6,-76,-6,-58,14,-44,-10,-23,8,20,20,5,74,15,-4,9,14,24,9,14,22,17,9,2,29,28,35,-102,85,-52,120,-2,13,9,7,4,24,45,18,26,20,8,19,-30,26,-38,9,-3,8,-10,-6,-25,9,-35,-10,-46,19,-24,-11,-6,32,-29,-11,-10,-13,-22,16,-23,-9,-34,-39,-1,-39,-13,-11,-2,-36,-43,-19,-11,-40,-23,7,-19,15,-6,18,-24,11,1,55,-34,9,-50,-7,-6,-13,-20,0,-29,-45,8,-7,2,-60]]]},{"geoid":"0600535","name":"Airport","full":"Airport CDP","lsad":"CDP","cdp":true,"polygons":[[[-1209782,376347,35,0,0,-37,69,-2,15,9,0,23,-17,0,0,15,-35,0,0,7,-32,-4,-1,10,-34,10]]]},{"geoid":"0600562","name":"Alameda","full":"Alameda city","lsad":"city","polygons":[[[-1223309,377951,-7,-80,36,-57,102,-17,24,-31,90,-5,65,-38,111,-36,-2,-41,59,-7,37,42,44,-24,31,-42,280,-97,-10,-15,-168,-69,7,-38,50,-39,75,-78,6,5,117,-85,79,78,15,0,3,204,31,-1,-8,148,-24,41,-139,68,-30,26,-13,28,-4,39,-14,17,-47,22,-27,-1,-61,-23,-84,34,-97,52,-78,5,-150,-16,-275,55,-45,16]]]},{"geoid":"0600618","name":"Alamo","full":"Alamo CDP","lsad":"CDP","cdp":true,"polygons":[[[-1220555,378731,25,-74,-11,-14,9,-10,8,-208,90,-5,1,-45,55,2,21,-7,98,-91,35,13,8,-12,12,32,47,45,-33,34,27,12,22,30,-19,16,35,13,33,1,44,-15,78,4,1,-81,101,3,0,72,209,7,-5,-17,9,-1,-4,-5,13,12,41,13,0,116,-44,15,-17,-5,-46,19,-23,23,-156,-5,-8,66,-84,14,12,25,-47,14,13,33,-30,8,-29,20,-35,-19,-18,-33,14,-27,-97,16,-2,-70,-30,-1,0,56,-29,14,-1,-69,-24,-7,-3,21,-66,-1,-15,-21,-18,30,-19,11,-7,-5,-35,36,2,12,-32,14,-29,52,-24,-15,14,-45,-20,-16]]]},{"geoid":"0600674","name":"Albany","full":"Albany city","lsad":"city","polygons":[[[-1223269,378887,107,-38,34,-36,159,22,140,-10,11,25,-9,4,10,29,-7,29,-46,-3,3,76,-32,-9,-63,13,-169,-16,36,-43,-16,-26,-43,18,-115,3,0,-29]]]},{"geoid":"0600716","name":"Albion","full":"Albion CDP","lsad":"CDP","cdpLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"CO","state":"Colorado","fips":"08","features":[{"geoid":"0800320","name":"Acres Green","full":"Acres Green CDP","lsad":"CDP","cdp":true,"polygons":[[[-1049042,395510,154,-2,15,30,13,3,4,9,-8,1,1,31,-32,1,-30,32,-42,6,-2,-9,-30,-1,-23,-10,0,-19,-26,0]]]},{"geoid":"0800620","name":"Aetna Estates","full":"Aetna Estates CDP","lsad":"CDP","cdp":true,"polygons":[[[-1046783,397364,94,0,0,-15,5,0,0,50,-99,-4]]]},{"geoid":"0800760","name":"Aguilar","full":"Aguilar town","lsad":"town","polygons":[[[-1046626,373994,26,3,32,-18,9,17,92,1,-34,28,0,22,-14,0,17,26,-3,22,-76,0,0,-49,-20,1,-5,-16,-24,0]]]},{"geoid":"0800870","name":"Air Force Academy","full":"Air Force Academy CDP","lsad":"CDP","cdp":true,"polygons":[[[-1048985,390014,9,-13,50,-9,9,-15,-5,-20,14,-17,40,6,4,-18,-7,-18,-24,-23,-2,-25,34,-28,8,-26,52,-11,67,-33,5,-43,38,-25,93,-17,24,-21,26,-7,5,-9,36,3,11,11,82,-30,4,-9,16,0,28,-30,13,90,22,71,-21,6,15,54,-15,125,-169,279,-136,-26,-141,16,-101,28,-61,-13,-4,-51,12,-22,-13,-57,-17,-24,-5,-21]]]},{"geoid":"0800925","name":"Akron","full":"Akron town","lsad":"town","polygons":[[[-1032256,401721,122,-20,-96,-5,3,-187,39,0,7,41,44,0,-7,-40,50,-1,-9,-66,-51,1,0,27,-35,0,-2,-75,90,-1,14,177,84,-11,5,64,40,0,-1,-69,29,-1,1,17,15,-6,2,93,-132,1,1,35,-45,0,0,36,-46,-1,0,-15,-119,19]],[[-1032463,401624,189,0,-3,144,-185,1]]]},{"geoid":"0801090","name":"Alamosa","full":"Alamosa city","lsad":"city","polygons":[[[-1059136,374832,357,-156,-7,-11,-42,18,7,10,-208,89,2,-143,90,0,0,47,51,0,0,-19,-32,0,0,-9,26,0,0,-11,18,0,0,-24,52,0,8,-38,14,0,0,17,45,0,-1,-8,-33,0,0,-9,36,-2,-14,-27,14,0,-9,-19,-15,0,-13,-26,38,0,0,-49,-17,2,-10,16,-28,0,-20,-37,49,10,0,-10,28,0,0,-28,187,-4,-1,28,38,-2,0,73,-45,0,-1,27,-45,10,0,26,60,14,37,-30,8,7,31,1,5,-11,30,6,-28,63,15,14,-3,19,-36,-8,-30,10,0,-37,-45,-7,0,61,-35,15,-11,18,0,55,43,4,0,36,-14,0,14,11,-2,65,-88,1,0,71,-44,-1,-1,73,-46,0,-1,73,-183,0,1,-39,27,-21,1,-51,-74,-1,-1,24,-24,-3,-2,-15,-24,-7,0,-20,36,-14,0,-13,-31,-6,0,-14,27,6,9,-6,-9,-20,2,-22,-26,0,0,-37,-27,1,-18,16,-46,-6,-16,7]]]},{"geoid":"0801145","name":"Alamosa East","full":"Alamosa East CDP","lsad":"CDP","cdp":true,"polygons":[[[-1058619,374708,11,-18,35,-15,0,-9,106,-1,258,-25,0,241,-369,-2,2,-65,-14,-11,14,0,0,-36,-43,-4,0,-32]]]},{"geoid":"0801420","name":"Allenspark","full":"Allenspark CDP","lsad":"CDP","cdp":true,"polygons":[[[-1055426,402250,100,1,-3,-56,-24,-1,-4,-21,31,-8,1,-51,-102,-8,-1,-201,11,4,-1,-20,40,-2,3,23,48,20,-6,-220,72,24,37,79,286,-9,0,35,95,-4,0,-35,47,-1,-2,-100,60,32,37,-1,-7,-72,94,-1,8,13,4,45,37,25,-16,8,118,-5,0,90,-50,2,-3,38,-139,2,-1,35,-46,-3,-1,35,-142,-7,-188,29,-195,-4,-2,35,80,1,8,10,-50,91,11,11,45,0,-2,248,101,-3,-7,10,2,138,-93,2,0,34,-46,-1,0,72,-247,5]]],"label":[-105.5230877016129,40.21395]},{"geoid":"0801530","name":"Alma","full":"Alma town","lsad":"town","polygons":[[[-1060774,392893,31,-29,5,-28,24,0,21,-9,4,-9,46,0,0,-18,24,0,0,-9,16,10,19,-13,4,19,-16,15,9,13,-18,9,-13,22,-10,43,-91,-13,10,-42,-30,9,-40,35,42,0,1,27,-46,0,-1,-25,-55,9]]]},{"geoid":"0801640","name":"Alpine","full":"Alpine CDP","lsad":"CDP","cdp":true,"polygons":[[[-1066001,376839,43,0,0,-20,17,-12,32,0,65,31,116,2,2,22,40,-2,-5,46,-37,-24,-16,5,6,25,17,0,-23,10,1,7,-217,-1,1,-33,-22,23,-22,-2]]]},{"geoid":"0801740","name":"Altona","full":"Altona CDP","lsad":"CDP","cdp":true,"polygons":[[[-1053079,401147,11,-22,17,0,1,-29,19,-6,10,5,-23,11,0,69,59,-15,76,5,20,-8,25,-29,43,-8,-2,298,-40,0,-24,-9,-2,-11,-23,-12,2,-36,-7,-24,-21,2,-32,21,-57,-76,-18,-6,-16,-31,-7,-67]]]},{"geoid":"0801915","name":"Amherst","full":"Amherst CDP","lsad":"CDP","cdp":true,"polygons":[[[-1021835,406825,122,-49,126,86,-247,0]]]},{"geoid":"0802355","name":"Antonito","full":"Antonito town","lsad":"town","polygons":[[[-1060158,370752,44,0,0,-32,10,-1,-44,-27,21,-25,50,27,-1,23,18,1,2,109,-94,0]]]},{"geoid":"0802575","name":"Applewood","full":"Applewood CDP","lsad":"CDP","cdp":true,"polygons":[[[-1051829,397573,37,-15,-46,-43,-5,-114,177,1,56,11,-23,36,-21,-11,0,34,89,1,-4,-17,13,-10,26,25,19,2,-12,-14,23,-17,-15,-12,2,-43,-23,-3,7,-41,58,13,1,-28,-29,6,-31,-6,-11,-19,1,-18,163,0,0,72,48,5,0,33,-65,-1,0,-18,-21,-8,0,23,-56,-6,22,6,26,20,-2,165,-6,0,6,37,-28,3,0,18,-20,15,-47,-1,0,62,-33,9,-195,-10,0,-103,-50,6,-7,-13,-45,10]]]},{"geoid":"0802850","name":"Arapahoe","full":"Arapahoe CDP","lsad":"CDP","cdp":true,"polygons":[[[-1021839,388500,43,-2,13,-21,14,10,36,-7,-14,27,1,63,-93,0]]]},{"geoid":"0802905","name":"Arboles","full":"Arboles CDP","lsad":"CDP","cdp":true,"polygons":[[[-1074424,370000,316,0,121,111,10,43,-6,119,-11,22,-48,41,-83,-11,-42,97,9,38,-28,-6,-8,9,-10,-11,-51,-17,-27,-40,-143,2]]]},{"geoid":"0803015","name":"Aristocrat Ranchettes","full":"Aristocrat Ranchettes CDP","lsad":"CDP","cdp":true,"polygons":[[[-1047727,401019,282,2,1,71,-98,0,1,73,-188,-1]]]},{"geoid":"0803235","name":"Arriba","full":"Arriba town","lsad":"town","polygons":[[[-1032812,392808,47,0,-1,-20,91,-1,0,106,-137,0]]]},{"geoid":"0803455","name":"ALine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"CT","state":"Connecticut","fips":"09","features":[{"geoid":"0901150","name":"Ansonia","full":"Ansonia city","lsad":"city","polygons":[[[-731024,413529,69,-137,35,-1,18,-10,21,-30,108,-48,9,-13,43,-21,59,-5,12,-12,93,-13,166,28,-9,57,-19,52,-10,12,-8,35,-26,38,-9,144,-251,1,-84,23,-52,0,-53,-24,-36,2,-57,-67]]]},{"geoid":"0902480","name":"Ball Pond","full":"Ball Pond CDP","lsad":"CDP","cdp":true,"polygons":[[[-735362,414496,76,15,0,17,23,-10,28,10,-2,26,33,4,51,-8,-3,29,-11,13,-7,74,-7,1,1,12,-21,12,-10,37,-63,6,-43,-27,-31,0,-13,-194]]]},{"geoid":"0902550","name":"Baltic","full":"Baltic CDP","lsad":"CDP","cdp":true,"polygons":[[[-721076,416144,147,6,0,-33,33,0,6,-7,10,-72,241,45,-59,17,-27,21,-20,31,-42,17,-1,13,-42,19,-22,45,-33,-5,5,-42,-12,-9,-55,7,-29,36,-38,-28,-4,8,-28,-20,-42,-3]]]},{"geoid":"0902690","name":"Bantam","full":"Bantam borough","lsad":"borough","polygons":[[[-732545,417189,248,-1,-7,117,-237,5,-4,-101]]]},{"geoid":"0904790","name":"Bethel","full":"Bethel CDP","lsad":"CDP","cdp":true,"polygons":[[[-734350,413724,107,-371,182,30,31,110,104,152,24,20,50,-32,-5,38,-48,48,3,15,-10,46,16,12,-8,47,-27,18,-22,-7,-60,16,-62,31,-8,21,10,39,-166,-134,-87,-38,-12,-26]]]},{"geoid":"0904945","name":"Bethlehem Village","full":"Bethlehem Village CDP","lsad":"CDP","cdp":true,"polygons":[[[-732276,416389,36,-85,-38,-76,16,-68,19,-12,10,-23,81,-4,42,27,31,6,13,27,9,3,83,-12,62,-49,165,3,-3,14,-20,15,-33,52,-29,22,-17,24,0,104,-19,43,10,33,15,13,13,30,-7,20,60,2,-6,73,-60,115,-404,-21,24,-22,31,-10,1,-38,-14,-35,6,-71,8,-10,-76,7,-20,-6]]]},{"geoid":"0904965","name":"Bigelow Corners","full":"Bigelow Corners CDP","lsad":"CDP","cdp":true,"polygons":[[[-735161,414654,27,-21,23,-5,86,11,70,24,-8,16,11,19,-10,7,-27,2,-27,26,7,25,-40,38,-15,-4,3,-16,-42,-23,8,-15,-2,-30,-58,-29]]]},{"geoid":"0906050","name":"Blue Hills","full":"Blue Hills CDP","lsad":"CDP","cdp":true,"polygons":[[[-727078,418070,164,6,13,-68,41,-6,-10,264,-16,16,-16,-9,12,-21,-17,-18,-54,-9,7,-43,-136,-8]]]},{"geoid":"0906155","name":"Bogus Hill","full":"Bogus Hill CDP","lsad":"CDP","cdp":true,"polygons":[[[-734672,415081,61,-61,19,16,-1,43,-22,45,-12,4,-20,-26]]]},{"geoid":"0906680","name":"Botsford","full":"Botsford CDP","lsad":"CDP","cdp":true,"polygons":[[[-732786,413571,27,-52,29,0,22,19,4,-11,21,-12,121,59,7,71,20,-3,-39,22,-90,-47,-39,40,-18,1,-27,-37,-19,0,-19,-24]]]},{"geoid":"0907100","name":"Branchville","full":"Branchville CDP","lsad":"CDP","cdp":true,"polygons":[[[-734467,412687,15,-33,-3,-33,73,31,-68,101,-14,-46]]]},{"geoid":"0907345","name":"Branford Center","full":"Branford Center CDP","lsad":"CDP","cdp":true,"polygons":[[[-728310,412659,22,-16,12,6,14,-14,14,2,1,-17,34,-4,5,-19,31,17,65,15,2,10,-18,12,-28,5,-27,22,11,28,35,12,16,27,18,11,31,3,27,-11,11,11,4,10,-11,11,13,17,-16,21,16,2,7,14,-14,6,22,17,22,-7,39,49,12,-4,0,13,14,18,-3,6,-26,3,-129,-21,-112,-31,16,-26,-85,-83,-37,-22,5,-25,-20,-38]]]},{"geoid":"0908000","name":"Bridgeport","full":"Bridgeport city","lsad":"city","polygons":[[[-732191,411978,-13,-99,24,-46,-16,-18,3,-21,-38,-30,-8,-24,-16,-1,-21,-45,39,8,14,-13,-51,-48,-7,-20,-91,-70,0,-14,11,-13,24,-3,8,-45,-19,-36,72,-10,49,53,-11,18,25,12,16,20,26,-5,6,-41,10,-3,61,64,67,33,165,12,18,51,66,23,71,-18,-15,-58,74,-22,60,174,32,34,14,53,-9,70,13,25,-9,9,-81,268,17,44,20,13,15,25,-71,-28,-48,-28,-78,-5,-60,-16,-40,-2,-34,37,75,-5,-13,22,31,12,-69,4,-26,-25,-55,27,-47,6,-3,12,-59,-17,-51,7,-318,-19]]]},{"geoid":"0908140","name":"Bridgewater","full":"Bridgewater CDP","lsad":"CDP","cdp":true,"polygons":[[[-733692,415343,-4,-15,7,-12,35,7,1,-22,22,-12,27,8,-13,25,16,10,4,15,19,20,-40,-6,-8,23,5,10,-14,7,-52,-15,-1,-22,-21,-11]]]},{"geoid":"0908420","name":"Bristol","full":"Bristol city","lsad":"city","polygons":[[[-729831,416395,545,60,8,-48,58,4,-19,44,405,40,-149,737,-1002,-107]]]},{"geoid":"0908770","name":"Broad Brook","full":"Broad Brook CDP","lsad":"CDP","cdp":true,"polygons":[[[-725737,418798,16,23,12,-1,26,19,26,3,0,16,45,7,34,15,60,-21,-18,89,9,24,107,47,34,9,106,-24,128,-9,11,331,-42,-13,-15,14,-22,-14,-3,16,-29,11,-14,-25,15,60,-22,1,-18,-24,-116,-91,-79,7,-16,-8,9,-22,-11,-7,-6,-21,-25,0,7,-14,-33,-22,0,-26,-30,6,9,-29,-44,11,3,-14,-42,-22,-12,-16,-4,-24,-34,-18,-10,-16,19,-7,-23,-28,13,-10,-15,-18,3,-21,-13,-76,-38,2,-9,-9,-1,-26,11,-5,-27,-19]]]},{"geoid":"0909050","name":"Brookfield Center","full":"Brookfield Center CDP","lsad":"CDP","cdp":true,"polygons":[[[-733906,414669,9,-26,-25,-7,16,-48,-22,-25,8,-46,79,49,37,-4,-24,33,-9,68,17,22,-45,35,-65,-31]]]},{"geoid":"0909120","name":"Brooklyn","full":"Brooklyn CDP","lsad":"CDP","cdp":true,"polygons":[[[-719714,417866,21,-32,0,-12,62,1,6,-7,13,7,13,-6,92,-2,19,-9,13,35,51,19,-10,16,-16,2,7,32,18,18,-23,-1,0,9,-35,41,-14,33,-82,1,4,-19,-21,-4,-12,-29,12,-40,-6,-45,-17,-17,-58,31,-30,-21]]]},{"geoid":"0910660","name":"Byram","full":"Byram CDP","lsad":"CDP","cdp":true,"polygons":[[[-736593,409972,-3,-29,24,-34,-18,-20,12,-13,10,1,56,75,24,16,26,34,-2,16,41Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"DC","state":"District of Columbia","fips":"11","features":[{"geoid":"1150000","name":"Washington","full":"Washington city","lsad":"city","polygons":[[[-771179,389324,13,-35,32,-37,71,-61,29,-62,22,-18,110,-69,80,-23,121,-12,19,-9,9,-6,38,-106,52,-85,31,-1,11,-9,30,-39,-2,-20,22,-25,28,6,7,17,-10,19,12,3,48,-40,15,-31,-2,-38,53,-72,23,-66,-28,-100,-40,-12,-57,9,-8,-17,1,-38,14,-15,23,5,20,-15,11,-36,-10,-72,17,-72,-15,-134,-1,-92,1296,1012,-1316,1023,-788,-608]]]}]}
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"DE","state":"Delaware","fips":"10","features":[{"geoid":"1001400","name":"Arden","full":"Arden village","lsad":"village","polygons":[[[-754955,398114,40,-51,114,64,-41,23,-19,-15,-10,14,-26,2,-38,-25]]]},{"geoid":"1001530","name":"Ardencroft","full":"Ardencroft village","lsad":"village","polygons":[[[-754860,398022,39,29,-31,27,-9,-6,-17,14,-22,-14]]]},{"geoid":"1001660","name":"Ardentown","full":"Ardentown village","lsad":"village","polygons":[[[-754798,398035,20,12,47,3,1,11,-55,32,-16,34,-67,-35]]]},{"geoid":"1004130","name":"Bear","full":"Bear CDP","lsad":"CDP","cdp":true,"polygons":[[[-757148,396181,-5,-33,241,-150,73,39,172,25,23,22,206,99,-77,97,-16,40,-3,46,-105,-61,-67,-27,-73,60,-28,38,-17,-37,-16,-6,-46,26,-55,-34,-12,2,-19,-11,4,-11,-21,-1,-33,15,-36,-6,16,-54,13,-9,-15,-12,16,-18,-63,9,-63,-27]]]},{"geoid":"1004650","name":"Bellefonte","full":"Bellefonte town","lsad":"town","polygons":[[[-755041,397689,22,-14,-13,-13,61,-40,16,15,-8,5,11,11,13,-7,20,19,-59,33,-12,14,-42,-18]]]},{"geoid":"1005690","name":"Bethany Beach","full":"Bethany Beach town","lsad":"town","polygons":[[[-750753,385331,64,10,2,-9,56,-11,2,8,15,-8,45,1,2,-7,31,2,-12,141,-98,-13,-18,11,-40,3,-15,-7,-98,-8]]]},{"geoid":"1005820","name":"Bethel","full":"Bethel town","lsad":"town","polygons":[[[-756221,385643,11,7,5,28,14,10,54,-30,9,97,-76,19,-59,-58,6,-2,-9,-17,19,-8,-21,-40]]]},{"geoid":"1006730","name":"Blades","full":"Blades town","lsad":"town","polygons":[[[-756134,386369,40,-86,19,2,25,22,3,-20,58,53,13,-13,28,18,14,26,-28,-9,12,26,-73,-30,-25,13,-20,28,-22,2,-34,-18]]]},{"geoid":"1007250","name":"Bowers","full":"Bowers town","lsad":"town","polygons":[[[-754061,390570,-1,-19,54,0,50,41,-45,64,-21,3,-26,-9,-3,-24,-22,-10,16,-36,-20,2]]]},{"geoid":"1008680","name":"Bridgeville","full":"Bridgeville town","lsad":"town","polygons":[[[-756315,387387,47,-55,23,-5,58,32,39,-51,24,28,1,34,-12,10,-16,-3,57,36,21,-54,22,-10,2,-13,-28,0,-47,-223,22,-18,8,-24,-27,4,-24,-59,40,-32,0,-9,46,11,22,-11,4,-15,23,10,10,-15,109,42,2,14,-12,0,2,10,9,0,-10,7,-13,65,28,4,1,-6,66,20,-4,62,9,10,-83,-2,1,-11,-10,60,27,-5,29,-26,-1,45,13,36,-35,-17,-35,9,9,-27,-33,-4,0,10,24,0,-16,168,-30,-3,-15,40,38,1,1,17,16,-4,-2,19,-67,11,-11,18,-15,-2,8,16,-12,2,-2,-14,-21,-14,-44,84,-67,-26,16,-47,14,-10,30,8,8,-17,15,0,-61,-17,10,-24,-67,-8,-13,-12,-63,-19,-22,1,-30,-20]]]},{"geoid":"1009850","name":"Brookside","full":"Brookside CDP","lsad":"CDP","cdp":true,"polygons":[[[-757320,396487,282,59,69,36,8,115,-26,77,27,15,-21,8,-14,28,6,7,-32,26,-271,-83,9,-42,-26,-2,-53,-84,10,-6,-17,-6]]]},{"geoid":"1010760","name":"Camden","full":"Camden town","lsad":"town","polygons":[[[-755817,390758,41,-30,24,-8,8,14,-7,41,31,-2,11,20,31,3,-8,-69,54,10,4,26,57,0,4,25,48,20,51,126,-23,5,-20,15,52,-2,34,74,-63,35,20,30,60,-36,19,43,33,0,7,32,41,12,-8,29,-18,8,-7,-31,-24,6,40,85,-26,13,-39,-9,-33,-18,-24,17,-36,-11,-9,-15,-13,-1,14,-3,5,-22,-13,-1,-7,-17,-21,5,-11,-44,-58,-55,-31,13,14,26,-26,3,-3,-32,-35,1,-1,-29,-42,-1,-11,-28,-61,-2,-10,-13,21,-60,68,30,37,-73,13,2,0,11,40,4,-17,9,1,22,7,-16,17,-3,3,-14,20,2,-2,27,15,2,23,32,-4,-30,44,-7,-24,-8,4,-12,-16,-9,-32,1,-7,-24,26,1,1,-10,-27,-1,19,-14,4,-12,20,-7,-1,-7,-10,3,-4,-9,-27,7,-12,-29,-27,10,-46,-13,7,54,-30,21,-36,-39,-91,-21]]]},{"geoid":"1014660","name":"Cheswold","full":"Cheswold town","lsad":"town","polygons":[[[-756106,392211,-15,-12,9,-20,34,5,-14,39,43,6,12,-35,108,19,18,-8,-14,-17,43,-92,-37,-15,19,-17,-7,-18,24,-38,10,9,72,1,10,-8,13,22,-34,16,20,18,-19,4,35,23,-33,4,-13,41,-14,-7,-11,26,63,-6,16,5,-3,14,29,14,7,-11,40,4,8,-19,74,33,-39,23,-17,-4,4,-13,-34,-11,-23,7,-21,-8,-13,30,-11,-3,-6,10,6,3,-17,35,6,2,-4,9,-46,-13,-5,6,8,15,31,16,-4,7,-7,-7,-42,32,-21,-13,-34,-2,17,-39,-47,-6,-29,32,-42,-11,2,-6,-102,-19,-19,-14]]]},{"geoid":"1015310","name":"Claymont","full":"Claymont CDP","lsad":"CDP","cdp":true,"polygons":[[[-754847,397970,28,-17,14,-20,38,3,26,-12,13,13,67,-35,33,24,6,-13,105,68,144,151,-126,54,-50,-53,-77,-53,-31,-33,-39,-12,-64,9,-65,-32,-42,-41]]]},{"geoid":"1015440","name":"Clayton","full":"Clayton town","lsad":"town","polygons":[[[-756537,392984,53,-27,-2,-7,65,-47,27,-8,-10,-21,26,4,48,-18,-46,-73,36,4,-6,-12,1,-60,-15,-12,-79,53,-59,-38,93,-78,23,17,27,-18,28,17,-8,21,30,-5,40,10,24,76,-39,64,-27,11,56,72,-16,4,14,29,-30,-4,-14,18,15,10,-27,25,-14,-11,-16,36,-71,-3,-6,7,-88,17,1,-13]]],"label":[-75.6317651065449,39.28485]},{"geoid":"1018950","name":"Dagsboro","full":"Dagsboro town","lsad":"town","polygons":[[[-752653,385423,39,-8,7,3,-4,10,18,10,28,-34,36,4,66,44,8,-26,23,-24,21,-42,36,1,0,-7,27,1,-13,6,14,14,-6,51,54,-5,13,-14,11,35,-22,6,10,13,-35,34,-22,-6,-2,16,-29,9,-6,11,-22,7,-22,-6,-43,23,-16,-6,-39,10,-65,-35,-31,-47,10,-13,-43,-5]]]},{"geoid":"1019730","name":"Delaware City","full":"Delaware City city","lsad":"city","polygons":[[[-756157,395818,160,-61,-13,-11,-16,5,-5,-13,27,-14,11,13,21,-2,15,-14,-61,-55,78,-70,-5,-17,110,16,-13,38,-26,34,14,8,31,-31,21,5,66,47,-249,193,-146,Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"FL","state":"Florida","fips":"12","features":[{"geoid":"1200075","name":"Acacia Villas","full":"Acacia Villas CDP","lsad":"CDP","cdp":true,"polygons":[[[-801126,266434,37,3,6,41,-40,0,-1,-35]]]},{"geoid":"1200375","name":"Alachua","full":"Alachua city","lsad":"city","polygons":[[[-825571,297419,96,0,-2,36,97,-1,27,35,67,1,0,8,-25,0,-1,19,-17,1,45,46,97,0,1,71,84,0,1,-147,43,0,-2,75,125,-2,4,-18,58,0,0,-10,21,0,-1,28,43,1,1,-38,-84,-1,0,-19,-40,-4,12,-12,23,0,-13,-37,21,0,1,-37,-42,0,-27,-65,-2,-21,42,0,-1,-38,-41,0,0,-53,20,0,0,-10,-20,0,0,-65,22,0,0,21,35,0,0,73,58,0,0,32,22,4,1,52,63,0,-2,51,41,0,107,161,126,-49,161,-113,105,0,0,-68,47,0,-6,-37,83,-1,0,37,-70,1,0,31,19,4,8,10,-7,22,86,0,-4,14,13,0,-15,13,104,-5,9,12,25,-10,19,2,21,-13,0,42,-131,145,-68,63,-7,4,-4,-9,-34,11,2,20,41,-14,-1,35,-92,-1,-7,-25,-24,7,0,19,-11,-17,-14,4,-1,14,14,-1,-8,32,-27,8,-16,-24,-25,-3,-44,17,-3,12,9,18,-14,6,13,24,38,-13,41,0,-1,38,-42,-1,-2,37,-43,-1,0,37,-126,-1,-1,75,-19,0,0,35,-68,-12,-3,28,-19,11,-17,-17,0,-10,-13,-1,-94,-72,-69,0,0,13,14,0,-1,101,-32,-2,0,-41,-50,1,10,23,-12,0,0,13,-47,3,0,28,-53,2,8,0,1,52,25,0,7,-9,1,-39,128,-6,13,6,0,12,22,7,3,17,18,12,0,6,-33,8,32,4,-6,115,42,7,-2,37,23,2,0,-9,32,5,29,50,0,19,-76,-4,-21,20,-2,21,-28,0,1,-39,-53,0,1,-34,-98,2,-2,-38,-13,1,0,-37,21,-1,0,-36,-146,11,-6,62,-24,0,0,109,-126,0,1,-37,21,0,0,-36,-20,-1,1,-36,-50,0,-23,34,-31,-1,-1,19,18,0,-6,24,-12,-1,0,15,-22,2,0,17,-43,0,1,-54,41,-1,-1,-54,-55,1,0,-56,44,0,-2,53,42,2,1,-14,41,-1,2,-57,56,-1,31,-54,-8,-37,-39,0,-2,55,-250,1,10,-161,36,-23,-34,0,1,-37,40,1,0,26,26,-26,57,1,42,21,-1,-40,-41,1,0,-19,-28,1,0,14,-15,3,-39,0,1,-18,-41,-1,1,-45,32,0,0,11,15,0,1,-24,-49,-1,1,-12,102,0,0,-27,17,-9,1,72,31,1,0,13,11,0,0,-10,24,-1,7,16,82,-26,7,-24,-75,0,1,7,-32,7,-14,-11,-1,-44,-40,0,1,-36,-120,0,2,-71,-81,4,-1,32,60,0,-1,35,-104,1,-6,-108,15,-110,37,0,0,-18,-76,-2]],[[-824055,297325,162,0,3,68,-164,0]]]},{"geoid":"1200410","name":"Alafaya","full":"Alafaya CDP","lsad":"CDP","cdp":true,"polygons":[[[-812442,285394,9,-43,33,-43,0,-83,20,-93,-20,-79,7,-16,43,-39,63,-165,43,-25,124,1,15,13,1,16,-15,15,0,98,340,7,0,5,82,-7,85,2,0,71,11,12,14,-13,4,-69,66,0,44,11,40,-16,66,-6,34,43,-13,4,0,49,-24,26,9,53,42,45,43,83,11,70,33,47,13,5,-5,31,-68,32,-25,48,-28,26,-23,-5,-29,21,-8,-7,-47,10,-21,27,-2,43,-67,54,-397,1,-301,34,2,-150,-9,-25,-17,1,-39,-21,-142,1]]]},{"geoid":"1200625","name":"Alford","full":"Alford town","lsad":"town","polygons":[[[-854036,306871,41,16,63,10,65,-1,2,148,-168,1]]]},{"geoid":"1200800","name":"Allentown","full":"Allentown CDP","lsad":"CDP","cdp":true,"polygons":[[[-871446,308185,13,-14,-2,-94,9,-5,-11,-285,296,-5,-3,-92,-15,-32,-58,-28,-3,-137,111,3,-3,-151,725,-11,11,7,-37,32,15,-1,42,34,-32,1,1,36,128,-4,4,217,130,-4,4,-14,13,1,15,-35,4,32,28,32,-9,13,-2,-8,-60,29,-52,65,-17,3,-25,35,-16,2,4,19,-37,2,-16,18,9,6,-56,5,-2,8,-23,13,8,18,-20,-8,-133,18,-18,-21,-38,16,-24,-2,-18,22,-18,11,-23,-1,-22,33,-53,24,-23,21,1,16,15,13,-4,7,14,4,-15,31,19,10,-3,8,23,23,16,-1,12,25,-7,-1,7,42,10,10,-26,64,-15,12,-1,28,-12,16,1,33,-31,0,-9,-141,-39,-1,14,-14,-32,-18,-36,-34,-74,-3,-2,-75,-167,3,0,34,-30,6,-34,37,-10,28,-8,-13,-34,-13,-43,20,-34,-4,-14,-14,-36,26,-20,42,-97,-2]]]},{"geoid":"1200950","name":"Altamonte Springs","full":"Altamonte Springs city","lsad":"city","polygons":[[[-814436,286402,471,0,0,36,-115,-2,-8,9,0,28,-63,-4,1,77,41,1,5,44,23,1,5,26,10,-10,121,-5,0,-37,8,-2,-14,-27,12,-27,-6,-23,42,0,0,-49,-18,-9,5,-27,42,0,-6,71,59,0,0,-35,62,0,0,-34,43,0,0,35,8,26,10,0,0,-26,41,1,6,-36,-5,41,51,16,28,-9,8,123,35,1,-3,36,5,0,1,-36,15,0,-1,37,10,1,1,-37,11,0,-1,46,19,10,8,-19,23,0,5,10,-15,14,-80,-1,1,14,-45,5,0,21,22,0,0,8,-20,0,-1,77,-20,0,-11,13,-52,-2,1,-9,-22,0,2,-36,-17,4,0,14,-33,0,28,9,-3,18,-16,5,-17,-5,0,-18,-9,-10,8,-18,-81,1,0,36,-10,0,0,-18,-11,0,0,18,-20,0,-1,-27,-17,-8,-23,17,-61,-1,0,-13,-21,0,7,95,36,20,21,23,-22,-34,21,1,-1,-37,20,0,6,19,5,-5,0,77,-11,6,-48,-27,-42,2,-2,-35,-31,-1,-1,36,-30,3,10,-8,-7,-31,-91,1,13,33,-44,-16,-12,-17,-42,0,-1,-36,-41,0,0,-37,-22,0,1,-36,62,0,0,-54,-6,-20,-35,6,-1,-78,-41,0,0,-18,20,0,0,-18,22,-1,-158,-130]]]},{"geoid":"1201000","name":"Altha","full":"Altha town","lsad":"town","polygons":[[[-851361,305639,211,-1,5,143,-214,3]]]},{"geoid":"1201050","name":"Altoona","full":"Altoona CDP","lsad":"CDP","cdp":true,"polygons":[[[-816542,289676,22,-1,-1,13,34,-10,-31,-75,58,4,17,10,17,41,18,10,-22,16,-10,29,-28,0,10,36,-80,-4,-7,-44]]]},{"geoid":"1201100","name":"Alturas","full":"Alturas CDP","lsad":"CDP","cdp":true,"polygons":[[[-817611,278209,134,-1,11,-14,21,-7,1,-343,363,-3,6,-22,31,-31,11,-55,247,0,0,-29,9,-8,144,1,48,14,82,-8,4,20,138,154,1,210,-24,54,-59,670,5,20,-22,40,12,14,-9,10,7,11,-35,24,-21,0,-84,100,-266,77,-142,28,11,-111,-82,1,0,-19,-41,1,0,44,-81,0,9,37,1,73,82,-7,0,59,-41,1,0,23,41,6,-21,30,-90,0,-130,-64,17,-27,2,-26,-23,-33,-35,-14,-36,-33,-4,-16,22,-61,11,0,10,-28,13,-13,26,0,-6,-31,-47,-48,3,-20,26,-49,2,-20,-161,1,-1,-289,-91,-1]]]},{"geoid":"12Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"GA","state":"Georgia","fips":"13","features":[{"geoid":"1300184","name":"Abbeville","full":"Abbeville city","lsad":"city","polygons":[[[-833227,319879,28,-43,58,-41,50,-13,55,0,43,11,33,17,40,43,19,76,-6,36,-23,48,-29,4,18,6,-46,31,-83,16,-66,-11,-53,-30,-23,-29,-23,-56]]]},{"geoid":"1300408","name":"Acworth","full":"Acworth city","lsad":"city","polygons":[[[-847229,340563,20,12,39,0,16,-19,-16,-5,0,-22,18,0,21,35,70,-22,27,-17,18,-22,-2,-17,12,4,-5,-48,29,0,-1,-25,23,7,8,-19,13,0,-28,-7,0,-25,45,6,-1,12,29,-18,-27,1,1,-18,16,-15,-1,23,29,-14,-6,-20,32,-11,-1,-10,36,25,5,15,122,-23,0,-20,81,-10,8,14,-1,-35,77,-1,23,22,28,-5,1,7,9,-1,0,-8,36,-7,1,47,14,0,4,7,-9,11,-30,-2,1,19,-18,7,4,92,-26,0,0,-36,-25,0,0,18,-44,-9,-21,12,-25,-31,45,0,-9,11,13,3,18,-24,-23,4,1,-30,-22,0,0,16,-19,-5,2,12,-24,3,39,43,-42,38,37,10,25,28,26,0,0,-35,67,-2,2,64,-7,0,0,12,19,-6,1,8,13,-11,17,-2,1,52,9,7,-22,15,-74,1,65,3,0,6,30,-5,-4,-6,6,-1,0,10,27,-1,10,-17,11,-1,0,18,29,2,0,5,-2,25,-25,11,1,13,19,-9,7,20,89,-3,1,37,-54,1,-2,-30,-23,-2,-13,3,0,11,-12,11,-30,11,15,8,-3,30,-52,0,0,-16,20,-17,-53,9,19,25,-103,-4,-33,6,0,-15,-45,5,-1,10,-69,2,0,-24,-21,-4,-6,27,-195,3,5,-11,-17,-7,-13,19,-18,-16,5,-7,-31,14,5,-9,-4,-33,37,7,11,-17,-22,1,3,-13,-69,3,-8,-19,-17,-12,7,-22,17,-3,15,-21,29,-10,7,-16,14,16,21,-3,2,-25,-204,13,-14,19,3,20,-35,4,-21,-14,-23,-35]]]},{"geoid":"1300436","name":"Adairsville","full":"Adairsville city","lsad":"city","polygons":[[[-849707,343628,47,-1,5,-40,-5,-7,45,0,1,-56,42,7,25,13,17,32,-3,121,29,0,3,-23,31,0,17,35,37,-7,-23,-60,37,-39,5,-54,6,32,-6,16,68,-2,31,-13,13,-26,0,-29,28,1,0,-21,49,0,-2,13,20,12,-30,21,-26,1,-4,14,-26,6,-9,20,47,2,5,-8,38,15,12,-4,7,42,10,-11,19,11,0,11,35,0,0,-37,10,0,2,37,12,0,1,-37,17,-3,19,7,1,-70,82,4,-13,-44,-18,11,-43,-1,0,-64,31,-1,12,-37,211,-2,1,-43,90,7,-15,25,-161,154,-93,65,-76,74,-28,45,-1,24,47,-1,-8,-6,1,-48,13,-7,0,19,14,5,0,74,-33,-26,-17,20,40,31,45,17,3,-8,43,0,-5,17,-24,1,19,7,9,-8,24,0,2,112,-56,-2,-7,-29,-14,4,-29,-62,1,27,-8,7,-35,2,0,73,-141,-3,1,-65,-103,-7,3,74,-40,1,1,-13,-20,1,1,-61,-75,3,29,-56,30,0,1,-11,-13,-7,-45,4,-10,9,14,3,-5,18,-16,3,-22,-25,-59,12,-19,-39,-2,-57,-74,1,-15,12,0,38,21,-5,0,21,-31,7,0,-28,-7,-11,-15,0,-6,-34,41,0,2,-49,-16,-3,-5,-26,-27,-21,-6,-23,-10,-7,-21,4]]]},{"geoid":"1300576","name":"Adel","full":"Adel city","lsad":"city","polygons":[[[-834602,311319,38,1,46,37,26,-22,-3,-62,11,-15,40,-6,-9,-4,-3,-18,30,-3,4,10,36,-5,-33,-30,22,-16,-5,-9,97,-78,2,-25,49,-6,-31,52,9,6,69,-128,10,53,1,-69,40,-77,37,2,-2,-66,46,-91,105,-174,-100,285,11,4,-12,40,163,61,-44,24,13,34,-27,20,-3,-34,-73,3,0,24,-76,0,-8,17,-11,1,14,6,-8,21,44,-2,2,36,-5,15,-50,16,-6,49,-11,23,72,7,9,10,-67,86,43,6,-14,54,20,7,-13,9,9,9,-30,8,18,25,-7,36,-54,0,-1,18,22,16,16,23,11,-17,19,6,25,59,35,-1,3,53,65,52,0,19,-163,1,0,-28,24,-3,-2,-11,-29,5,-18,29,-22,1,-1,-33,9,-5,-9,1,-2,-36,18,2,-15,-14,-48,-9,-17,-29,-20,-9,25,0,-1,-16,-44,-7,100,3,-1,-43,-88,7,-14,-11,7,-18,-48,1,-3,12,-12,-13,-32,9,-32,-2,-20,3,-15,43,-10,3,15,-43,-7,-1,-2,-22,-141,-2,24,-12,-5,-51]]]},{"geoid":"1300660","name":"Adrian","full":"Adrian city","lsad":"city","polygons":[[[-826068,325259,10,-16,54,28,43,-41,33,-11,39,-1,44,14,38,35,10,27,-1,33,-14,29,-33,31,-36,11,-51,-1,-51,-23,-26,-39,-4,-20,-64,2]]]},{"geoid":"1300828","name":"Ailey","full":"Ailey city","lsad":"city","polygons":[[[-825766,321761,58,5,6,-19,14,4,-7,18,9,2,14,-21,80,8,-1,36,30,10,-42,16,23,25,5,37,-10,26,-40,31,8,15,40,20,-43,43,-13,4,-163,-33,-36,-140]]]},{"geoid":"1300996","name":"Alamo","full":"Alamo town","lsad":"town","polygons":[[[-827942,321452,20,1,8,-27,32,-43,43,-22,68,-4,43,12,30,20,22,30,12,34,-3,36,-16,33,90,22,-38,24,-37,-11,-27,-21,-60,30,-55,7,-64,-24,-33,-35,-30,20,-52,-48]]]},{"geoid":"1301024","name":"Alapaha","full":"Alapaha town","lsad":"town","polygons":[[[-832320,313757,48,-6,-3,-17,18,23,103,2,2,148,-169,-1]]]},{"geoid":"1301052","name":"Albany","full":"Albany city","lsad":"city","polygons":[[[-842729,315398,591,3,1,59,125,6,-49,-43,2,-26,30,-73,29,1,-36,-41,-55,0,3,-59,171,-2,114,153,33,21,106,4,-7,-87,117,-3,1,81,57,1,1,-52,39,0,1,20,67,0,-7,18,33,14,-8,-44,45,0,2,-12,92,0,7,168,45,-24,23,8,22,145,34,-19,69,-77,86,4,-3,78,218,-17,-2,14,26,-1,0,17,-28,0,3,165,-56,0,2,75,36,0,0,20,-17,2,-1,111,53,42,21,-16,0,11,32,-26,74,17,-21,5,-22,23,-1,22,-42,71,-40,-8,-4,-20,-25,-17,-95,-40,-20,-1,-56,38,-31,47,-55,32,-13,-2,18,-2,54,-39,-65,38,-3,-14,12,-28,-10,-8,22,-23,-1,-18,-19,-7,-20,11,-28,-6,-53,-36,-54,-13,-16,12,8,18,-3,11,-49,13,-59,2,-61,-49,-27,-34,-35,-15,-44,73,-10,12,-16,2,-5,16,-18,5,-29,26,-12,-11,25,-18,-38,-10,-36,39,-10,-2,8,-18,-15,2,4,16,-35,8,-21,15,-17,0,-15,22,-14,1,7,13,-11,8,-11,-21,-12,-3,9,3,8,20,16,3,12,-16,-5,18,-51,27,-874,-3,1,-274,214,-5,0,32,40,-1,4,-18,-23,-61,-1,-40,183,0,-2,-83,-26,-87,-77,1,1,18,-218,16,5,135,-132,0,3,59,-88,0,-3,-47,16,-11,-11,-1,0,-79,72,0,-8,-39,-62,-52,-8,-165]]]},{"geoid":"1301248","name":"Aldora","full":"Aldora town","lsad":"town","polygons":[[Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"GU","state":"Guam","fips":"66","features":[{"geoid":"6600100","name":"Adacao","full":"Adacao CDP","lsad":"CDP","cdp":true,"polygons":[[[1448328,134840,167,0,76,76,-2,80,-83,-20,-48,11,-92,-8,-18,-133]]]},{"geoid":"6600850","name":"Afame","full":"Afame CDP","lsad":"CDP","cdp":true,"polygons":[[[1447609,134564,-11,-21,20,-1,27,-22,12,1,9,44,-5,35,-53,56,-27,-20,-18,10]]]},{"geoid":"6604000","name":"Agana Heights","full":"Agana Heights CDP","lsad":"CDP","cdp":true,"polygons":[[[1447417,134685,5,-30,-14,-33,-21,-8,-3,-20,20,-34,116,11,2,102,-8,30,-41,17,-94,0,-56,34]]]},{"geoid":"6607600","name":"Anao","full":"Anao CDP","lsad":"CDP","cdp":true,"polygons":[[[1448709,134861,60,36,45,13,23,-3,30,15,53,61,-7,11,-1,51,6,18,42,7,11,22,45,32,42,8,20,16,29,8,15,-5,31,11,50,27,32,6,32,25,45,109,10,10,1,50,54,91,-212,88,-35,-129,-28,-16,-12,-38,-20,-22,-46,-86,-70,-38,-184,-241,-60,-36,-2,-39,-18,-18]]]},{"geoid":"6607900","name":"Andersen AFB","full":"Andersen AFB CDP","lsad":"CDP","cdp":true,"polygons":[[[1448992,135634,385,-154,25,46,-18,83,19,72,38,21,30,28,-53,35,-40,-17,-14,29,-178,-78,-63,13,-129,-68]]]},{"geoid":"6609500","name":"Apotgan","full":"Apotgan CDP","lsad":"CDP","cdp":true,"polygons":[[[1447705,134811,27,9,70,-2,54,26,-16,31,-23,101,-119,4,3,-28,44,-10,7,-33,-16,-41,-38,-51]]]},{"geoid":"6609850","name":"Apra Harbor","full":"Apra Harbor CDP","lsad":"CDP","cdp":true,"polygons":[[[1446183,134458,17,-19,8,-24,34,-38,87,-33,56,-51,19,-62,-6,-21,24,-21,56,-11,10,-24,34,1,35,-9,28,-21,28,-42,-1,-38,16,-9,6,-25,110,-2,8,-50,29,27,25,7,5,-24,27,26,30,-12,17,59,-6,10,-49,7,-8,11,-20,-2,-44,38,7,28,19,30,-10,31,-17,22,20,25,-14,40,-93,82,-2,94,-428,90,-59,-70]]]},{"geoid":"6612450","name":"Asan","full":"Asan CDP","lsad":"CDP","cdp":true,"polygons":[[[1447105,134690,22,9,13,-11,17,13,21,-3,49,29,10,19,-3,15,-5,8,-58,-35,-39,3,4,-9,-34,-8]]]},{"geoid":"6615800","name":"Astumbo","full":"Astumbo CDP","lsad":"CDP","cdp":true,"polygons":[[[1448342,135417,201,-2,6,16,1,144,-143,0,-45,-79,-29,-74]]]},{"geoid":"6617000","name":"Barrigada","full":"Barrigada CDP","lsad":"CDP","cdp":true,"polygons":[[[1447896,134576,9,-14,25,-8,11,22,50,5,3,-10,82,0,-2,122,-77,11,-77,26,6,-21,-22,-64,9,-14,-12,-27]]]},{"geoid":"6618300","name":"Barrigada Heights","full":"Barrigada Heights CDP","lsad":"CDP","cdp":true,"polygons":[[[1448182,134843,146,-3,18,157,-95,-5,-16,20,-33,-27,19,-38,-72,-34,18,-48,-29,-31]]]},{"geoid":"6624500","name":"Chaguian","full":"Chaguian CDP","lsad":"CDP","cdp":true,"polygons":[[[1448718,135858,16,-87,25,-15,3,-203,144,-1,20,-31,19,-6,49,129,-30,88,-72,93,-108,29,-56,-2]]]},{"geoid":"6625450","name":"Chalan Pago","full":"Chalan Pago CDP","lsad":"CDP","cdp":true,"polygons":[[[1447623,134328,26,-29,8,-34,34,0,-7,-14,11,-9,39,-10,17,5,-4,-10,18,1,2,-11,15,2,-3,-17,28,7,12,21,20,-14,20,26,69,23,-2,114,-30,20,0,8,-39,2,-7,62,-21,-21,-39,-4,-24,12,-69,-2,-18,-21,-1,-19,-27,-5,-26,-23,5,-19]]]},{"geoid":"6627400","name":"Dededo","full":"Dededo CDP","lsad":"CDP","cdp":true,"polygons":[[[1448348,135155,57,-13,32,1,21,94,24,44,-23,2,0,7,-44,13,-105,1,-7,11,-21,-14,-1,-14,-26,-2,-3,-20,-18,-29]]]},{"geoid":"6629350","name":"Finegayan Station","full":"Finegayan Station CDP","lsad":"CDP","cdp":true,"polygons":[[[1448330,135654,-4,-14,61,26,50,-34,61,116,89,109,46,28,39,2,-37,41,-29,55,-238,-2,-8,-69,-15,-38,-35,-53,8,-35,-11,-23,-20,-1,-52,-46]],[[1448113,135512,212,-111,48,115,-179,117,-22,-50,-52,-36,2,-20]]]},{"geoid":"6634650","name":"Hågat","full":"Hågat CDP","lsad":"CDP","cdp":true,"polygons":[[[1446524,133728,25,-35,138,1,0,36,10,17,-7,37,5,28,-35,100,35,12,-18,14,2,34,-18,9,-19,27,-8,3,-40,-118,-35,-31,-40,-80]]]},{"geoid":"6634750","name":"Hagåtña","full":"Hagåtña CDP","lsad":"CDP","cdp":true,"polygons":[[[1447286,134790,32,-10,-7,-19,16,-12,3,10,52,3,12,-10,58,-2,21,-30,41,-17,8,-30,19,2,22,-29,18,-10,33,30,-18,27,3,15,-15,36,6,24,38,3,48,29,-65,-19,-65,-4,-5,32,-10,1,-23,-33,-70,-1,-51,15,-74,-5,-20,23,-7,-9]]]},{"geoid":"6635000","name":"Harmon Industrial Park","full":"Harmon Industrial Park CDP","lsad":"CDP","cdp":true,"polygons":[[[1447942,134947,40,-31,22,1,77,41,78,30,42,-1,-3,35,15,29,-16,43,-190,-69,-53,-60]]]},{"geoid":"6635500","name":"Inalåhan","full":"Inalåhan CDP","lsad":"CDP","cdp":true,"polygons":[[[1447221,132754,55,-60,-1,-15,52,2,-13,-23,61,-25,36,-1,10,10,-2,19,-38,9,-6,12,55,11,72,34,0,11,-28,28,2,19,23,6,35,-35,10,0,46,38,2,12,-10,26,-41,41,-21,8,-122,16,-21,-31,-2,-77,-19,-3,-8,13,-62,12,-24,-2,-20,19,-16,-65]]]},{"geoid":"6635525","name":"Humåtak","full":"Humåtak CDP","lsad":"CDP","cdp":true,"polygons":[[[1446576,132902,16,-34,32,-19,-2,-12,8,20,11,-1,74,82,-30,38,-6,-6,-13,10,8,18,23,16,-18,1,-40,-17,-56,3,44,-12,2,-13,-54,-47]]]},{"geoid":"6636600","name":"Ipan","full":"Ipan CDP","lsad":"CDP","cdp":true,"polygons":[[[1447611,133523,25,-56,40,-54,46,4,-5,207,-14,33,-16,4,-63,-42,-13,-81]]]},{"geoid":"6641300","name":"Liguan","full":"Liguan CDP","lsad":"CDP","cdp":true,"polyLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"HI","state":"Hawaii","fips":"15","features":[{"geoid":"1500400","name":"Ahuimanu","full":"Ahuimanu CDP","lsad":"CDP","cdp":true,"polygons":[[[-1578627,214343,41,-62,80,-20,43,69,15,-30,88,-50,48,50,-10,20,-2,31,10,10,19,12,61,-45,11,10,7,46,-10,77,-137,99,-2,-14,14,-29,-48,-69,-21,-7,-7,-19,-56,-12,-33,15,-54,-22,-53,-46]]]},{"geoid":"1500550","name":"Aiea","full":"Aiea CDP","lsad":"CDP","cdp":true,"polygons":[[[-1579435,213765,51,-41,37,36,2,8,9,-21,10,-8,4,8,19,18,10,-7,38,23,-23,10,-3,5,8,-6,14,6,13,13,10,3,10,11,19,2,12,6,2,12,20,15,42,6,22,11,20,23,36,17,17,18,36,8,-22,14,-24,25,-36,14,-16,-15,-28,-1,-18,-9,-28,-3,-8,-16,-12,2,-15,-13,-15,-21,-11,1,-43,-10,-34,-16,-10,-25,-16,-15,-7,-4,-6,-9,-14,-5,-6,-13,-26,-14,-23,-1,-31,-20]]]},{"geoid":"1501085","name":"Ainaloa","full":"Ainaloa CDP","lsad":"CDP","cdp":true,"polygons":[[[-1550071,195045,204,142,133,219,-4,11,-11,17,-111,-104,-106,-79,-171,-94]]]},{"geoid":"1502200","name":"Anahola","full":"Anahola CDP","lsad":"CDP","cdp":true,"polygons":[[[-1593387,221441,123,-56,38,10,16,-15,2,-27,-7,-7,-44,6,-21,-7,-6,17,-6,-3,9,-6,-7,-18,173,-15,56,-36,40,-5,-9,40,68,41,2,58,-9,19,22,10,15,-21,-1,17,-31,53,-26,-20,-38,-4,-36,31,14,71,22,26,-37,47,-25,-28,3,-11,-98,14,13,-23,-19,-39,-96,-4,-5,-10,-45,-5,-13,-18,-23,5,0,-42]]]},{"geoid":"1502832","name":"Black Sands","full":"Black Sands CDP","lsad":"CDP","cdp":true,"polygons":[[[-1549683,194120,95,-58,45,63,14,-9,15,56,-11,24,-18,14,-15,1,-7,-21,-20,-9,-20,-24,-22,3,-18,-12,-15,0]]]},{"geoid":"1503850","name":"Captain Cook","full":"Captain Cook CDP","lsad":"CDP","cdp":true,"polygons":[[[-1559499,195023,19,-34,9,-49,23,-33,15,-63,34,-2,20,11,-21,19,41,15,111,-41,20,11,-8,12,21,16,14,-3,34,22,44,-86,46,-12,31,-25,38,-41,19,-38,36,15,0,26,-13,21,6,12,-16,17,26,-2,80,-114,127,-73,18,-23,-20,45,-67,88,-32,58,111,44,-45,110,-68,25,-20,0,41,34,61,27,46,8,23,21,78,3,71,16,89,4,56,-8,32,21,-6,39,47,142,-103,5,-53,-28,-46,-2,-83,-27,-105,-16,-51,-25,-93,-14,-77,-35,-24,-4,-18,12,-27,-6,0,16,-31,-2,-161,-47,-2,29,-33,-11,-24,12,-38,-12,-44,5,-57,-10,-2,-15,14,-26,-97,-14]]]},{"geoid":"1505900","name":"Discovery Harbour","full":"Discovery Harbour CDP","lsad":"CDP","cdp":true,"polygons":[[[-1556402,190337,135,-152,54,107,79,109,59,12,-16,77,-56,123,-47,-19,-61,-41,-44,-5,11,-20,-164,-114]]]},{"geoid":"1506290","name":"East Honolulu","full":"East Honolulu CDP","lsad":"CDP","cdp":true,"polygons":[[[-1577830,212787,21,-8,-6,-17,13,-35,34,-38,13,16,111,47,49,6,8,-18,29,-12,13,33,109,36,90,0,24,23,53,-12,45,6,30,30,67,-35,32,-34,8,-84,-22,-41,-6,-30,22,-23,106,10,72,36,-45,29,0,45,27,13,40,-40,35,68,89,49,31,46,40,1,13,22,105,57,33,47,37,8,21,59,-2,59,-7,1,-17,-21,-25,8,-64,-13,-76,44,-43,47,-60,30,-65,-3,-5,11,-22,6,-35,-14,-40,2,-20,-14,-76,-24,-52,16,-10,-12,-61,1,-21,13,-24,2,-45,55,-64,-14,-48,3,-107,29,-14,13,-35,6,-31,28,-23,7,-107,-165,-9,-55,-26,-33,-49,-19,-34,-31,-32,-178]]]},{"geoid":"1506300","name":"East Kapolei","full":"East Kapolei CDP","lsad":"CDP","cdp":true,"polygons":[[[-1580601,213663,69,-55,23,-27,16,-45,-10,-66,-32,-48,7,-30,89,37,93,85,62,19,-12,51,31,77,4,72,-13,42,-48,61,-88,-49,-93,-39,-70,-60]]]},{"geoid":"1506325","name":"Eden Roc","full":"Eden Roc CDP","lsad":"CDP","cdp":true,"polygons":[[[-1551192,195055,267,-444,219,121,-308,511,-25,23,-55,-102,-63,-71]]]},{"geoid":"1507000","name":"Eleele","full":"Eleele CDP","lsad":"CDP","cdp":true,"polygons":[[[-1595877,218988,42,-6,0,-17,26,-1,-60,42,57,-12,24,64,24,-1,23,51,-17,17,39,30,41,11,15,15,-25,3,-5,19,-21,-26,-55,-2,-58,-23,-23,-38,0,-22,-17,-47,-36,-15]]]},{"geoid":"1507450","name":"Ewa Beach","full":"Ewa Beach CDP","lsad":"CDP","cdp":true,"polygons":[[[-1580213,213071,311,69,-7,14,-124,-27,-13,56,97,104,-45,31,-64,-75,-113,-8,42,-69,-63,-67,-7,6,-25,-27]]]},{"geoid":"1507470","name":"Ewa Gentry","full":"Ewa Gentry CDP","lsad":"CDP","cdp":true,"polygons":[[[-1580482,213319,63,-3,17,-39,26,-15,27,-51,106,41,21,28,32,16,4,-5,67,13,28,-3,29,28,-38,15,-62,49,-41,65,-11,45,-40,-10,-20,4,6,-24,-96,-116,-29,-19,-54,-9]]]},{"geoid":"1507485","name":"Ewa Villages","full":"Ewa Villages CDP","lsad":"CDP","cdp":true,"polygons":[[[-1580487,213318,94,20,29,19,96,116,-16,60,-62,-19,-93,-85,-89,-37]]]},{"geoid":"1507542","name":"Fern Acres","full":"Fern Acres CDP","lsad":"CDP","cdp":true,"polygons":[[[-1551039,195266,25,-23,308,-511,194,96,-387,640,-46,-51,-28,-51,-46,-57]]]},{"geoid":"1507675","name":"Fern Forest","full":"Fern Forest CDP","lsad":"CDP","cdp":true,"polygons":[[[-1551757,194545,117,-195,419,104,271,150,25,7,-267,444,-27,-11,-44,-43,-18,-37,-17,-12,-25,-57,-90,-109,-326,-237]]]},{"geoid":"1508950","name":"Haena","full":"Haena CDP","lsad":"CDP","cdp":true,"polygons":[[[-1595758,222112,16,-11,26,-3,38,17,2,14,19,9,17,29,-1,20,22,-12,20,-42,111,12,39,17,31,-1,-21,56,-51,32,-45,-3,-55,21,-71,-61,-36,28,-76,1]]]},{"geoid":"1509260","name":"Haiku-Pauwela","full":"Haiku-Pauwela CDP","lsad":"CDP","cdp":true,"polygons":[[[-1563392,209358,12,-59,15,1,14,-1Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"IA","state":"Iowa","fips":"19","features":[{"geoid":"1900190","name":"Ackley","full":"Ackley city","lsad":"city","polygons":[[[-930660,425367,196,-4,-1,72,48,-1,0,73,11,0,-1,61,-10,0,1,13,147,42,0,18,-294,-1,-1,18,-48,0,0,-18,-48,0]]]},{"geoid":"1900235","name":"Ackworth","full":"Ackworth city","lsad":"city","polygons":[[[-934814,413642,48,22,0,-96,97,-1,2,145,-99,2,0,-37,-48,1]]]},{"geoid":"1900370","name":"Adair","full":"Adair city","lsad":"city","polygons":[[[-946578,414896,287,0,1,216,-288,1,0,-72]]]},{"geoid":"1900505","name":"Adel","full":"Adel city","lsad":"city","polygons":[[[-940525,416022,48,0,0,-19,157,-3,0,-15,12,2,1,16,177,0,2,-143,52,0,0,-34,48,0,0,35,40,1,-35,61,-34,39,-6,42,-13,26,27,0,40,-14,12,-12,19,1,0,20,-40,14,-36,0,0,10,-29,0,1,33,48,-1,0,13,-30,3,-20,11,0,14,-37,21,39,-1,0,-14,30,-27,72,-3,30,-9,5,-13,28,0,9,9,-1,23,19,3,0,-35,97,0,0,36,97,1,0,-37,96,0,0,67,95,3,-1,42,-142,-3,0,-17,48,1,0,-22,-99,-1,3,39,-49,0,0,-20,-35,5,-35,-6,-30,-16,-46,1,0,45,-11,24,11,3,-96,0,-1,-33,35,-3,0,-11,-164,-15,-8,-10,5,18,36,0,0,54,-57,0,-52,24,-20,-6,-38,22,-25,42,0,-47,-145,1,-1,-161,-51,-16,0,20,8,0,-12,11,0,-32,-48,-12]]]},{"geoid":"1900595","name":"Afton","full":"Afton city","lsad":"city","polygons":[[[-942047,410202,190,1,0,144,-143,0,-28,26,6,-26,-25,0]]]},{"geoid":"1900640","name":"Agency","full":"Agency city","lsad":"city","polygons":[[[-923144,409915,143,0,0,109,-144,1]]]},{"geoid":"1900730","name":"Ainsworth","full":"Ainsworth city","lsad":"city","polygons":[[[-915616,412865,143,-1,0,72,-142,6]]]},{"geoid":"1900775","name":"Akron","full":"Akron city","lsad":"city","polygons":[[[-965682,428157,169,2,-12,19,21,-1,7,16,-37,0,-24,32,87,2,-1,144,-36,2,-13,-12,-19,-1,-22,7,-24,28,-20,-1,-22,-31,-3,-52,-25,-7,-11,13,0,-93,22,1]]]},{"geoid":"1900865","name":"Albert City","full":"Albert City city","lsad":"city","polygons":[[[-949532,427707,49,0,0,61,36,0,-5,11,18,0,0,113,-28,0,-5,-39,-15,18,-21,53,-30,0]]]},{"geoid":"1900910","name":"Albia","full":"Albia city","lsad":"city","polygons":[[[-928231,410245,25,-12,39,30,-8,-21,8,-19,48,-16,0,-32,-23,0,0,-17,-24,0,0,-37,29,0,3,-14,15,0,1,-23,-48,0,0,-27,68,0,-36,-46,64,1,0,37,-21,24,1,48,115,0,-1,33,70,1,0,75,71,1,-1,73,-48,0,-1,73,-64,0,14,73,-94,-1,1,-36,-94,-1,1,-36,-96,0,3,-105]]]},{"geoid":"1900955","name":"Albion","full":"Albion city","lsad":"city","polygons":[[[-929958,421065,145,3,0,117,-146,-2]]]},{"geoid":"1901000","name":"Alburnett","full":"Alburnett city","lsad":"city","polygons":[[[-916287,421495,47,0,-1,-37,17,0,-61,-65,98,-8,-9,37,58,0,3,145,-150,-4]]]},{"geoid":"1901045","name":"Alden","full":"Alden city","lsad":"city","polygons":[[[-934263,424928,34,1,1,15,32,21,18,37,267,27,1,-31,101,-1,-1,38,112,-2,0,27,15,9,36,0,-5,184,-146,0,0,-14,-13,5,1,-36,-19,6,-7,-39,24,-17,-16,-16,19,0,-1,-101,-454,-42]]]},{"geoid":"1901090","name":"Alexander","full":"Alexander city","lsad":"city","polygons":[[[-934987,427894,401,-3,0,304,-401,2]]]},{"geoid":"1901135","name":"Algona","full":"Algona city","lsad":"city","polygons":[[[-942767,430795,0,-59,91,0,13,-8,0,13,26,-9,0,12,-26,0,0,79,7,6,84,-1,0,-12,49,0,0,-15,-49,-1,0,-21,59,-1,0,50,36,-7,10,7,1,-87,18,0,-22,-5,4,-37,-19,-31,-46,-26,-20,-1,5,-8,80,-1,0,6,19,-6,-8,-15,41,-11,7,10,58,-19,38,0,9,-28,31,-1,0,-13,30,-1,0,18,13,1,-25,24,129,-2,1,72,48,-1,0,8,34,4,2,85,16,8,49,2,1,55,-10,0,0,-17,-14,0,-1,34,-25,0,-1,19,-347,0,4,40,-26,0,1,-40,-74,0,0,-21,-18,0,0,11,-29,0,0,-11,-51,0,0,-6,-20,6,-79,0,0,-14,-156,0]]]},{"geoid":"1901180","name":"Alleman","full":"Alleman city","lsad":"city","polygons":[[[-936392,418131,48,0,0,-9,97,-1,0,-63,145,0,1,-73,98,0,0,49,16,0,0,17,32,1,1,224,-243,-1,1,-55,-14,19,-84,0,0,-36,-97,0]]]},{"geoid":"1901270","name":"Allerton","full":"Allerton city","lsad":"city","polygons":[[[-933795,406994,167,0,1,36,48,0,2,108,-26,0,-1,16,-189,2]]]},{"geoid":"1901315","name":"Allison","full":"Allison city","lsad":"city","polygons":[[[-928101,427375,288,0,-2,291,-285,0]]]},{"geoid":"1901495","name":"Alta","full":"Alta city","lsad":"city","polygons":[[[-953139,426658,48,-1,-1,-36,99,0,0,37,50,0,0,91,15,0,0,18,-63,-1,-1,36,-147,1]]]},{"geoid":"1901540","name":"Alta Vista","full":"Alta Vista city","lsad":"city","polygons":[[[-924269,431912,199,0,-1,109,-197,1]]]},{"geoid":"1901585","name":"Alton","full":"Alton city","lsad":"city","polygons":[[[-960184,429894,10,-13,-11,-9,-34,0,-1,-47,45,1,1,-73,199,0,-3,220,-66,1,8,22,-38,-15,0,-7,-73,0,0,8,24,4,0,46,-49,0,20,-58,-20,0,-1,-35,-99,6,-1,-21,-13,-25]]]},{"geoid":"1901630","name":"Altoona","full":"Altoona city","lsad":"city","polygons":[[[-935224,416604,14,-2,-13,-16,24,0,50,-72,35,-35,82,-147,31,-36,70,0,47,84,47,47,-1,-59,74,0,0,-18,19,0,3,-91,-48,0,-1,-72,48,1,0,-109,48,6,0,-6,150,0,-2,72,-48,0,0,37,144,0,0,109,96,0,0,127,-14,0,0,17,-34,0,-7,36,-42,1,0,235,-121,-21,-41,-34,-32,0,0,12,-142,-47,0,70,-48,0,0,36,-12,0,12,7,-2,101,-97,1,0,119,-96,-1,-1,-124,-55,0,2,22,-43,-28,1,-95,-96,0]]]},{"geoid":"1901675","name":"Alvord","full":"Alvord city"Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"ID","state":"Idaho","fips":"16","features":[{"geoid":"1600100","name":"Aberdeen","full":"Aberdeen city","lsad":"city","polygons":[[[-1128487,429369,199,1,0,32,29,1,15,17,-14,20,-15,0,13,-16,-28,-12,1,102,-199,0]]]},{"geoid":"1600280","name":"Acequia","full":"Acequia city","lsad":"city","polygons":[[[-1136040,426634,142,-1,4,109,-146,0,0,-98]]]},{"geoid":"1601000","name":"Albion","full":"Albion city","lsad":"city","polygons":[[[-1135888,424119,39,0,0,-73,34,0,8,-17,23,0,-1,-19,38,0,9,22,-46,0,0,14,33,0,0,35,-28,6,5,22,29,4,0,20,24,12,-28,-5,0,16,-138,0]]]},{"geoid":"1601900","name":"American Falls","full":"American Falls city","lsad":"city","polygons":[[[-1128741,427736,12,-6,138,-1,-10,-23,18,-11,38,34,52,1,0,19,49,-2,-2,17,-49,0,93,93,-9,27,17,8,22,-4,1,16,27,12,-8,10,-66,-33,-5,16,-22,0,0,38,47,0,-4,17,-44,0,-12,20,-24,-11,-10,-25,-26,2,-9,-16,-37,11,-7,-34,-37,-80,-15,-13,-110,-36,0,-23,-10,-13]]]},{"geoid":"1601990","name":"Ammon","full":"Ammon city","lsad":"city","polygons":[[[-1119839,434461,257,0,0,-8,-25,-1,-13,-19,-20,-3,0,-8,18,1,-6,-35,38,1,0,31,20,0,0,-17,-15,0,0,-14,22,-1,34,35,-9,16,4,22,14,0,-3,-17,22,-15,47,-1,-5,-30,17,4,2,38,-11,21,-40,0,0,39,46,6,-37,27,1,44,-27,-10,-2,40,21,30,-5,26,-35,1,-15,9,0,55,98,5,0,-10,13,0,1,-15,-14,-4,0,-33,15,-1,23,38,31,0,-10,13,40,-4,0,-10,34,4,22,-6,0,-13,59,7,0,-8,44,-4,-9,18,10,9,-12,1,1,27,-78,-8,0,33,48,19,46,1,0,-8,50,7,0,-37,25,0,5,-72,-45,0,-1,6,-8,-6,14,-13,-9,-24,2,-36,95,1,1,71,44,-13,0,50,-10,14,38,2,3,13,-13,7,-78,0,16,10,10,62,-37,16,-34,-5,-53,-27,-98,-5,5,-14,-31,-1,-21,27,21,2,0,35,-9,7,-94,-3,0,10,-51,0,0,-45,-21,0,1,60,-54,0,25,12,0,60,-7,13,-58,0,0,-13,12,0,0,-60,-97,1,0,6,-49,-6,0,66,-9,6,7,78,53,0,0,72,-58,-6,0,-10,-17,0,10,17,-19,0,0,-8,-29,-9,-32,0,-21,9,0,8,28,0,4,10,-18,6,0,55,-45,1,-1,-70,29,-2,0,-8,-29,-3,1,-62,96,0,-20,-31,-30,-11,-35,-34,-11,0,-1,-96]]]},{"geoid":"1602935","name":"Arbon Valley","full":"Arbon Valley CDP","lsad":"CDP","cdp":true,"polygons":[[[-1126632,428981,24,-20,23,0,32,-41,57,-33,52,-5,26,-38,12,-3,-3,-25,25,-14,29,-2,0,-9,37,-11,-4,-58,-42,-42,-8,-23,-22,5,-37,-11,-22,-12,-15,-20,-2,-20,12,-16,1,-36,-21,-40,26,-15,-12,-14,8,-59,39,-16,22,-20,14,-32,15,-7,121,1,0,128,88,-1,23,-22,-2,-109,171,53,57,1,123,-25,124,-12,104,14,22,15,12,-2,11,14,18,-29,23,5,48,-24,27,-2,45,16,-6,906,-14,7,-85,4,-4,57,-15,12,-1162,3],[-1126317,429027,172,-1,0,196,42,-1,0,12,26,0,0,39,55,0,1,-29,24,0,0,-18,247,0,-1,52,34,1,-1,17,21,0,0,20,95,-1,0,-107,-95,0,-1,-40,44,21,2,-158,-541,-125,0,12,-50,1,0,36,-76,1]]]},{"geoid":"1603160","name":"Arco","full":"Arco city","lsad":"city","polygons":[[[-1133112,436310,39,0,-9,-5,0,-30,14,-1,0,-36,28,0,0,-9,-22,-1,0,-60,58,0,-5,9,44,14,3,119,50,0,0,36,-50,0,0,36,50,0,0,36,-117,0,-29,21,-14,-4,14,-11,-15,-5,0,-29,-31,0,-7,-8]]]},{"geoid":"1603340","name":"Arimo","full":"Arimo city","lsad":"city","polygons":[[[-1121781,425642,16,-26,-1,-73,25,0,49,-36,25,36,73,-1,0,17,-78,0,-56,129,-17,1,-11,24,-14,0,5,-37,-18,-1]]]},{"geoid":"1603610","name":"Ashton","full":"Ashton city","lsad":"city","polygons":[[[-1114571,440700,12,0,4,-22,148,0,0,35,49,0,0,37,-101,9,1,28,-52,0,0,25,-49,0,-6,-93]]]},{"geoid":"1603700","name":"Athol","full":"Athol city","lsad":"city","polygons":[[[-1167202,479475,27,2,-1,-71,80,-1,-1,-72,54,0,2,72,51,1,1,36,23,0,-6,36,78,1,18,25,0,8,-85,0,-23,36,-4,-30,-133,-4,18,55,-13,36,-27,20,-5,-74,-55,0]]]},{"geoid":"1604105","name":"Avimor","full":"Avimor CDP","lsad":"CDP","cdp":true,"polygons":[[[-1162650,437634,117,8,7,14,-13,0,0,23,-26,15,32,13,-43,29,-42,-6,-1,-9,-28,5,-5,11,-10,-56]]]},{"geoid":"1604420","name":"Bancroft","full":"Bancroft city","lsad":"city","polygons":[[[-1118918,427145,92,4,18,12,1,-43,36,0,0,25,49,0,-1,74,-36,0,-1,53,-11,-18,-147,0]]]},{"geoid":"1604600","name":"Banks","full":"Banks CDP","lsad":"CDP","cdp":true,"polygons":[[[-1161415,440791,31,-76,-20,-8,-3,-14,24,-51,2,-22,49,-18,14,-18,47,-7,46,56,18,50,12,14,6,36,-27,50,5,29,15,14,45,16,-5,1,35,47,-24,17,-12,31,-26,20,-31,10,-12,12,-43,10,1,-63,-61,-39,-27,-35,-10,-27,-36,-16]]]},{"geoid":"1605230","name":"Basalt","full":"Basalt city","lsad":"city","polygons":[[[-1121731,433115,99,0,1,-53,-21,-19,34,0,-3,19,-7,0,-2,53,30,0,1,73,-76,9,-22,-25,-3,-29]]]},{"geoid":"1606220","name":"Bellevue","full":"Bellevue city","lsad":"city","polygons":[[[-1142721,434717,50,-36,0,-56,25,-1,48,-106,42,11,9,-22,31,2,-20,24,14,4,-21,14,-28,47,82,20,0,-24,16,0,0,31,34,6,-11,23,-23,6,0,36,21,0,27,53,22,11,29,32,0,12,16,7,0,16,19,16,13,33,47,70,-12,4,-19,-18,-52,-81,-62,-70,0,-13,-14,0,-44,-46,-9,21,-80,-10,-22,24,16,-34,-46,-11,-82,85,-19,-4,11,-24,-13,-22]]]},{"geoid":"1606670","name":"Bennington","full":"Bennington CDP","lsad":"CDP","cdp":true,"polygons":[[[-1113556,424005,13,-17,4,-22,-5,-38,6,-40,30,-54,36,-47,40,-19,6,-30,10,-4,-3,-18,15,-25,17,-11,-6,-15,19,-7,21,7,54,-39,28,4,25,-10,52,5,77,35,16,-4,11,-17,70,14,60,31,28,33,24,-3,26,26,-20,98,-46,26,-64,19,-62,-3,1,129,-470,2]]]},{"geoid":"1607840","name":"Blackfoot","fLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"IL","state":"Illinois","fips":"17","features":[{"geoid":"1700113","name":"Abingdon","full":"Abingdon city","lsad":"city","polygons":[[[-904141,407981,94,1,0,-37,-95,1,-1,-31,42,16,54,0,0,13,120,1,-8,18,-17,0,1,23,48,1,1,28,42,0,1,37,-48,-1,0,74,-35,8,24,17,-1,12,-30,0,-1,-37,-36,0,0,7,-28,4,0,-10,-104,-1,-2,-33,38,0,0,10,31,2,-5,-18,-42,3,0,-27,-16,0,0,-21,-32,0]]]},{"geoid":"1700178","name":"Adair","full":"Adair CDP","lsad":"CDP","cdp":true,"polygons":[[[-905059,404137,97,-4,-7,37,12,0,16,-27,27,-21,2,120,-106,0,25,-11,-1,-19,-23,-29,-41,0,-1,-10]]]},{"geoid":"1700191","name":"Adams","full":"Adams CDP","lsad":"CDP","cdp":true,"polygons":[[[-912135,398602,283,-3,2,192,-51,-2,-7,11,-25,-1,-12,-11,-17,27,-22,-9,-1,21,-15,-5,-8,9,-29,-14,-93,41]]]},{"geoid":"1700230","name":"Addieville","full":"Addieville village","lsad":"village","polygons":[[[-894951,383842,180,-5,-3,144,-146,4,0,12,-37,-2]]]},{"geoid":"1700243","name":"Addison","full":"Addison village","lsad":"village","polygons":[[[-880518,419283,37,5,4,-6,5,7,0,-14,13,1,-1,-13,-28,0,0,12,-28,-1,-5,-38,97,2,-1,-38,-26,4,0,-18,27,1,9,7,-7,6,99,-26,-1,-40,-12,0,-2,-17,-11,0,-1,-7,26,1,0,-6,-61,-2,-3,-24,63,1,0,-10,30,0,19,12,-1,34,26,2,-1,33,48,-12,-15,16,89,2,-2,37,49,1,4,-95,99,-26,-11,-5,0,-19,61,1,-1,21,15,0,0,20,46,-3,0,6,36,-11,-2,43,49,1,1,-23,14,1,1,-27,35,-5,-2,55,24,0,-23,59,45,0,3,-58,17,-2,-5,-10,13,0,-1,106,-19,3,-14,-32,-45,0,-4,7,-36,-8,1,6,18,1,-6,12,19,-5,23,12,-13,4,0,13,-46,30,9,21,85,-49,0,16,-43,19,41,1,2,-14,26,-9,2,-10,-4,92,-18,0,-4,47,-40,4,-1,32,40,-13,20,24,20,0,8,13,5,-17,25,0,17,31,-70,-3,-42,-11,2,9,-70,-2,11,47,-121,-3,0,-67,-263,123,-75,-31,44,23,0,12,-60,22,-36,-10,-17,-37,18,0,0,-20,-30,-8,-71,30,-29,2,-12,-13,1,14,-91,14,10,-30,-16,-5,17,-5,1,-25,-14,-3,41,2,1,-7,-35,-1,-7,-21,41,1,-1,-82,50,2,-1,-45,-51,7,-14,-19,-34,0,-2,-9]]]},{"geoid":"1700295","name":"Adeline","full":"Adeline village","lsad":"village","polygons":[[[-894969,421375,41,0,-1,-17,31,3,29,14,0,55,-28,16,-72,-3]]]},{"geoid":"1700516","name":"Albany","full":"Albany village","lsad":"village","polygons":[[[-902346,417799,272,-2,0,73,49,1,21,38,-48,-1,0,33,-22,-5,0,14,-46,-6,-128,-54,-50,-39]]]},{"geoid":"1700555","name":"Albers","full":"Albers village","lsad":"village","polygons":[[[-896400,385320,92,1,10,28,3,55,77,25,7,-15,28,0,-1,-19,39,19,-1,-18,39,0,0,-12,-15,0,-1,-68,25,8,5,68,-6,23,23,1,0,11,37,4,12,11,0,26,-23,0,23,16,0,20,-116,2,-20,16,-52,-1,-1,-17,-34,-1,6,-41,40,9,0,-11,-11,-1,-1,-29,-46,1,-12,-9,-11,11,-9,-16,-15,5,0,-22,-22,-7,22,0,1,-36,-92,-2]]]},{"geoid":"1700568","name":"Albion","full":"Albion city","lsad":"city","polygons":[[[-880793,383758,38,4,-1,-51,63,0,0,-37,19,7,-2,41,12,-10,84,0,-60,-21,0,-70,30,18,79,3,0,-37,47,1,6,63,-92,3,7,40,32,-7,0,8,49,1,2,56,22,0,-18,15,10,2,12,-13,0,17,109,6,-1,-80,57,1,1,79,-23,0,-1,26,-45,-10,0,-9,-125,0,0,58,-32,0,0,18,-11,0,1,-18,-24,0,22,36,16,0,-15,9,6,17,-7,-6,-46,0,1,-56,-48,0,0,-15,-44,0,0,-82,-32,5,-4,53,-55,0,0,39,-46,0,-2,-86]]]},{"geoid":"1700594","name":"Alden","full":"Alden CDP","lsad":"CDP","cdp":true,"polygons":[[[-885232,424586,23,-5,0,-30,35,4,8,22,31,1,-2,18,-26,-5,-7,32,-44,-11,1,-25]]]},{"geoid":"1700646","name":"Aledo","full":"Aledo city","lsad":"city","polygons":[[[-907619,411929,74,-1,-2,-19,-15,1,-10,-18,-25,0,-1,-36,170,-4,2,73,96,-2,2,37,48,-1,-1,-37,48,-1,1,52,49,-1,1,21,-49,1,0,18,-70,2,0,22,-24,1,-1,-21,-80,8,-7,6,1,41,-11,0,2,73,-49,1,0,-18,-23,0,0,-18,-21,1,0,25,-11,-23,-42,1,0,-19,-25,0,1,-31,-25,0,0,-60]]]},{"geoid":"1700659","name":"Alexander","full":"Alexander CDP","lsad":"CDP","cdp":true,"polygons":[[[-900488,397241,1,-88,71,-12,49,1,0,36,144,2,-2,71,-123,1,0,58,-70,0,-3,-58,-96,-11]]]},{"geoid":"1700672","name":"Alexis","full":"Alexis village","lsad":"village","polygons":[[[-905633,410611,23,0,-6,-35,109,-5,2,59,32,1,1,32,-33,0,1,8,36,-1,-14,13,-120,-3,-29,-34]]]},{"geoid":"1700685","name":"Algonquin","full":"Algonquin village","lsad":"village","polygons":[[[-883836,421612,48,0,0,-36,78,0,17,-6,-3,-43,24,7,-22,6,101,0,0,18,49,0,-1,-88,41,0,0,-18,73,-6,0,-12,122,0,0,-22,-10,-15,-19,1,2,-32,-20,0,-3,32,-97,2,1,-60,12,-15,14,7,12,-7,111,-1,-1,36,98,-2,-1,13,12,-14,86,0,-1,109,-42,-1,-8,36,175,6,23,11,-1,17,35,-6,1,10,57,-6,51,4,-1,-71,-25,-9,16,-15,21,6,15,-21,23,0,-19,1,-1,20,20,1,0,18,98,1,0,18,99,2,1,160,-44,0,-1,38,-11,0,7,88,-82,-5,-33,18,-31,-22,-10,17,-37,-24,-45,7,-1,56,13,9,59,4,-1,23,25,0,0,-12,43,0,16,16,4,13,-36,13,-2,15,-50,5,-24,12,0,-18,-191,0,15,-45,127,0,0,-27,-75,0,0,-36,-24,0,-1,-36,-15,0,-18,-14,11,-23,-9,-12,-28,14,4,24,-17,-9,-5,7,-14,-23,-12,17,-17,0,-1,-17,-24,0,0,42,-36,3,-145,-9,-1,-18,-12,0,0,18,-415,0,-12,-17,-44,-1,-13,19,-24,-1,0,-72,-25,0]]]},{"geoid":"1700737","name":"Alhambra","full":"Alhambra village","lsad":"village","polygons":[[[-897498,388847,188,-1,-1,-37,46,0,0,37,22,-1,7,73,-261,1]]]},{"geoid":"1700815","name":"Allendale","full":"Allendale village","lsad":"village","polygons":[[[-877159,385239,108,-1,0,34,17,21,-18,19,-108,1]]]Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"IN","state":"Indiana","fips":"18","features":[{"geoid":"1800140","name":"Aberdeen","full":"Aberdeen CDP","lsad":"CDP","cdp":true,"polygons":[[[-871287,414346,241,0,1,52,23,12,-5,22,-22,7,-28,43,-65,30,0,-21,-144,0]]]},{"geoid":"1800154","name":"Abington","full":"Abington CDP","lsad":"CDP","cdp":true,"polygons":[[[-849720,397320,39,6,-14,-58,77,0,11,18,-8,12,28,57,-14,19,-22,-14,-66,0,-18,8]]]},{"geoid":"1800352","name":"Adams","full":"Adams CDP","lsad":"CDP","cdp":true,"polygons":[[[-855646,393799,0,-24,18,0,-9,7,16,14,22,3,0,17,48,-1,0,22,-48,3,0,29,-46,-13,-16,-57]]]},{"geoid":"1800532","name":"Adams Lake","full":"Adams Lake CDP","lsad":"CDP","cdp":true,"polygons":[[[-853425,415480,93,0,17,-14,0,12,70,2,0,28,49,6,19,30,-26,42,-23,18,-36,3,-6,-11,-39,-2,-53,-24,-17,1,0,-18,-48,-1]]]},{"geoid":"1800640","name":"Advance","full":"Advance town","lsad":"town","polygons":[[[-866293,399939,24,0,0,-36,53,-1,0,-18,17,0,0,17,71,1,5,54,16,37,-20,-7,0,24,-141,1,-1,-54,-24,0]]]},{"geoid":"1800748","name":"Akron","full":"Akron town","lsad":"town","polygons":[[[-860330,410361,192,-38,-1,46,-40,5,0,11,20,0,0,35,-75,-2,-23,13,-1,18,-25,0,0,-24,-47,-1]]]},{"geoid":"1800784","name":"Alamo","full":"Alamo town","lsad":"town","polygons":[[[-870577,399817,49,0,2,34,-52,0]]]},{"geoid":"1800802","name":"Albany","full":"Albany town","lsad":"town","polygons":[[[-852562,403004,17,-8,0,-10,42,0,0,-26,224,4,37,9,0,24,42,0,14,-9,0,14,40,-1,-1,35,-40,8,-2,112,-48,0,-1,55,-94,-1,0,-68,47,0,0,-9,-47,2,0,-34,-47,0,-15,-17,-27,-1,0,-19,-47,0,0,-32,-53,0,0,30,-41,0]]]},{"geoid":"1800820","name":"Albion","full":"Albion town","lsad":"town","polygons":[[[-854379,413956,33,0,1,-37,26,-2,-2,-34,80,2,0,-12,26,1,-4,-28,32,0,-1,-66,24,0,1,101,33,0,0,9,44,-2,-2,14,82,-5,0,21,47,1,3,40,-168,0,-9,16,-19,-1,-2,59,53,0,0,73,-137,-1,1,6,-32,0,0,-21,17,0,-1,-42,-33,0,0,-18,34,0,0,-22,-34,0,0,-37,-48,0,-1,24,-45,11]]]},{"geoid":"1800910","name":"Alexandria","full":"Alexandria city","lsad":"city","polygons":[[[-856912,402666,5,-19,-18,-17,22,-8,0,-18,14,-10,18,0,0,20,16,-3,0,-90,50,1,-2,-146,93,1,4,-37,43,0,-15,37,67,0,-1,37,-48,-1,0,51,-50,4,11,1,0,17,38,0,0,11,-37,0,11,27,25,0,-1,35,-17,1,0,21,-30,7,0,10,4,12,14,-5,11,11,-12,6,10,10,20,0,28,54,-28,0,21,12,-16,5,6,39,-31,1,-8,35,-14,0,5,12,-22,1,0,-8,-21,-1,1,22,-19,0,0,-23,-26,1,0,-6,29,1,0,-19,-47,-1,0,18,-47,-1,0,-27,47,0,0,-15,-21,0,0,-30,-40,-1,0,-8,15,-4,-15,-4,14,-5,-107,-1,0,-13,-29,-1]]]},{"geoid":"1800946","name":"Alford","full":"Alford CDP","lsad":"CDP","cdp":true,"polygons":[[[-872493,384877,94,0,8,83,-31,-9,-81,0]]]},{"geoid":"1800964","name":"Alfordsville","full":"Alfordsville town","lsad":"town","polygons":[[[-869490,385581,16,-8,8,6,6,42,-28,13,-18,-29]]]},{"geoid":"1801270","name":"Alton","full":"Alton town","lsad":"town","polygons":[[[-864265,381231,92,-68,37,42,-61,43,-23,-16,-21,18]]]},{"geoid":"1801288","name":"Altona","full":"Altona town","lsad":"town","polygons":[[[-851596,413513,44,-4,-3,-17,49,0,1,12,39,-7,-2,11,13,0,2,8,0,17,-48,-1,0,19,-96,-10]]]},{"geoid":"1801342","name":"Ambia","full":"Ambia town","lsad":"town","polygons":[[[-875193,404862,62,-1,-1,61,-70,0]]]},{"geoid":"1801360","name":"Amboy","full":"Amboy town","lsad":"town","polygons":[[[-859322,405978,18,0,12,-21,22,3,1,18,52,-1,0,31,19,5,-15,-1,0,25,-58,27,-16,-14,-6,35,-27,0,-1,-37,29,4,0,-10,-34,-30]]]},{"geoid":"1801396","name":"Americus","full":"Americus CDP","lsad":"CDP","cdp":true,"polygons":[[[-867681,405260,41,-40,52,26,10,-15,31,20,-6,8,25,1,0,53,-145,-49]]]},{"geoid":"1801432","name":"Amity","full":"Amity CDP","lsad":"CDP","cdp":true,"polygons":[[[-860099,394316,-12,-31,7,-10,-4,-27,14,-14,29,-4,18,-19,-1,-22,44,2,-1,-32,54,3,-59,101,14,2,1,43,27,40,-118,-4,-10,9,-33,-1]]]},{"geoid":"1801450","name":"Amo","full":"Amo town","lsad":"town","polygons":[[[-866192,396842,57,-5,0,-29,82,1,8,68,-43,3,0,28,-17,6,-11,29,22,7,0,37,-61,0,0,-37,-35,1]]]},{"geoid":"1801468","name":"Anderson","full":"Anderson city","lsad":"city","d":5,"polygons":[[[-8576313,4001956,336,376,290,236,279,173,353,171,345,118,1518,426,-63,-144,590,-262,319,395,561,15,40,244,282,86,23,233,325,87,0,573,474,2,-17,-86,560,49,-1,47,2780,17,-2,-208,-472,2,0,-107,467,-9,9,40,236,0,1,-130,804,3,101,84,-13,-164,46,-150,614,3,-301,563,334,6,-4,-117,203,1,-25,-448,231,-1,0,-108,-230,0,2,-526,444,-8,-1,-97,514,4,-4,313,186,1,-3,426,-187,-1,1,650,247,2,2,-92,358,0,80,-22,63,22,1,98,255,3,0,3659,186,0,145,210,240,146,515,207,277,170,-838,-366,-523,-69,1,33,416,47,357,99,-126,174,194,90,-250,263,-588,-116,-2,937,543,10,0,-190,530,1,218,232,-749,2,-542,-42,0,1124,386,-4,0,-75,206,-64,-21,-157,143,-253,1187,7,0,-581,252,-60,-252,-189,0,-92,248,-1,-3,-175,537,366,-93,159,329,2,438,293,1,67,-384,-3,-99,80,0,659,-2178,15,253,335,-952,-5,1,1459,418,0,3,370,156,-1,0,63,189,0,0,366,-479,0,-180,-142,0,-286,-2314,9,191,215,-21,389,-101,99,111,202,244,0,-1,1415,-130,65,-245,4,16,-229,-518,-10,16,-100,94,-20,-65,-36,-124,-4,1,-79,76,-1,1,-34,136,-1,3,-70,-215,4,8,-348Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"KS","state":"Kansas","fips":"20","features":[{"geoid":"2000100","name":"Abbyville","full":"Abbyville city","lsad":"city","polygons":[[[-982087,379671,68,-1,46,9,0,75,-16,1,0,-25,-69,2,-14,10,-14,-21]]]},{"geoid":"2000125","name":"Abilene","full":"Abilene city","lsad":"city","polygons":[[[-972631,389328,25,0,-1,-31,47,1,-1,-73,140,0,0,-36,-35,0,0,-37,12,0,0,9,23,1,0,-62,135,36,0,-5,32,0,-1,-8,-23,-1,-5,-33,8,-10,34,16,0,21,55,1,0,-37,21,-7,-3,-27,47,-3,0,37,28,0,0,10,47,0,0,62,25,0,-7,52,30,0,0,13,-22,0,-8,81,-18,0,-1,85,-46,0,-24,-12,0,37,70,15,0,57,-94,0,1,-36,-26,0,0,-53,-67,-13,1,-56,-29,-60,-160,-1,0,-9,-47,0,0,64,47,0,0,-18,11,10,29,-10,7,18,0,55,-117,-2,0,-34,-25,0,0,33,-69,-18,-21,-20,1,10,-26,-4]],[[-972421,389007,42,-7,17,-36,35,-1,0,117,-11,0,11,43,-49,-13,0,-31,-45,0]]]},{"geoid":"2000225","name":"Ada","full":"Ada CDP","lsad":"CDP","cdp":true,"polygons":[[[-979029,391647,25,-18,17,-38,15,-7,14,-27,-9,-25,4,-27,37,-4,0,-12,55,-11,41,0,90,-18,4,298,-227,-4,-52,-76,-1,-26]]]},{"geoid":"2000325","name":"Admire","full":"Admire city","lsad":"city","polygons":[[[-961072,386367,104,1,-1,85,-103,-2]]]},{"geoid":"2000475","name":"Agenda","full":"Agenda city","lsad":"city","polygons":[[[-974344,396988,17,0,-4,45,34,-1,1,85,-48,0]]]},{"geoid":"2000550","name":"Agra","full":"Agra city","lsad":"city","polygons":[[[-991257,397605,46,-9,0,-31,48,0,0,39,27,-1,0,34,-60,15,0,-19,-15,0,0,18,-31,1,0,-19,-15,1]]]},{"geoid":"2000825","name":"Albert","full":"Albert city","lsad":"city","polygons":[[[-990146,384494,67,0,2,90,-69,1]]]},{"geoid":"2000950","name":"Alden","full":"Alden city","lsad":"city","polygons":[[[-983153,382437,24,-8,0,-82,7,0,1,66,41,9,12,22,-21,29,-10,-11,-68,10]]]},{"geoid":"2001050","name":"Alexander","full":"Alexander city","lsad":"city","polygons":[[[-995577,384658,92,0,0,24,12,1,-12,15,-1,33,-91,0]]]},{"geoid":"2001275","name":"Allen","full":"Allen city","lsad":"city","polygons":[[[-961748,386516,103,0,-1,72,-100,0]]]},{"geoid":"2001350","name":"Alma","full":"Alma city","lsad":"city","polygons":[[[-962979,390170,37,-1,2,-23,7,0,-1,-36,32,-4,-1,-26,15,5,28,-10,49,-1,1,15,-24,20,0,14,17,0,-16,96,-54,-7,0,8,-23,0,-1,-16,-23,0,-9,-22]]]},{"geoid":"2001425","name":"Almena","full":"Almena city","lsad":"city","polygons":[[[-997209,398925,39,-5,9,-62,141,-1,1,112,-95,0,-30,-22,-65,1]]]},{"geoid":"2001550","name":"Altamont","full":"Altamont city","lsad":"city","polygons":[[[-953131,371813,59,1,1,-30,100,0,0,27,21,0,0,-27,43,0,1,72,9,10,16,0,-2,27,22,-1,0,37,47,-1,0,19,-34,0,9,119,74,0,1,9,-92,-1,-5,-127,-22,0,0,19,-63,-1,-3,59,-6,0,-1,-23,-52,0,2,-36,-46,3,-1,-14,-21,0,-1,-24,32,0,1,-51,-25,0,0,-48,-65,-2]]]},{"geoid":"2001575","name":"Alta Vista","full":"Alta Vista city","lsad":"city","polygons":[[[-964945,388614,35,-18,-13,-16,0,-29,48,-1,0,73,46,0,1,37,-32,0,12,35,-49,1,-15,-19]]]},{"geoid":"2001600","name":"Alton","full":"Alton city","lsad":"city","polygons":[[[-989526,394622,61,0,0,25,26,0,0,51,-15,0,1,36,-71,-2]]]},{"geoid":"2001625","name":"Altoona","full":"Altoona city","lsad":"city","polygons":[[[-956650,375227,-6,-72,73,-1,2,26,-16,0,0,34,13,0,0,13,19,0,-3,72,-16,0,-1,57,-35,2,10,-11,-3,-13,-35,0,-13,-106]]]},{"geoid":"2001675","name":"Americus","full":"Americus city","lsad":"city","polygons":[[[-962715,384999,120,-3,1,-30,43,-8,0,22,-23,1,0,14,46,-1,0,73,24,-1,2,36,-24,1,2,37,-187,3,-5,-70]]]},{"geoid":"2001725","name":"Ames","full":"Ames CDP","lsad":"CDP","cdp":true,"polygons":[[[-974630,395665,247,1,1,40,12,3,-258,7]]]},{"geoid":"2001775","name":"Andale","full":"Andale city","lsad":"city","polygons":[[[-976406,377974,73,-58,-22,-5,1,-35,126,2,1,-18,55,0,0,74,-75,-1,-17,24,-31,-1,0,10,-38,-1]]]},{"geoid":"2001800","name":"Andover","full":"Andover city","lsad":"city","polygons":[[[-971530,376722,40,0,-1,-73,-38,0,-1,-146,174,0,1,-199,-14,11,-2,22,-9,0,0,23,-66,-2,0,-72,184,1,0,72,92,0,-1,145,-179,0,-2,144,44,0,0,-36,23,4,1,32,68,0,0,-36,45,0,1,37,-137,1,0,72,92,0,0,60,16,11,7,-8,0,-56,22,0,1,84,-24,0,1,54,24,0,0,73,8,-1,-9,7,0,131,92,-29,0,170,-38,-25,-54,-18,-5,-35,-26,0,0,-9,-14,0,-1,27,-45,0,0,37,-45,0,-1,37,-10,0,-1,24,-35,-5,0,17,92,0,-1,112,-91,0,0,-33,19,0,1,-11,-20,0,0,-19,22,0,0,-24,-22,0,0,12,-45,0,-1,36,-46,1,0,37,-85,0,-1,-356,39,18,1,45,49,1,-3,-25,47,19,0,-6,-133,-62,0,-218]]]},{"geoid":"2001975","name":"Anthony","full":"Anthony city","lsad":"city","polygons":[[[-980438,371521,21,0,0,-8,24,3,1,-80,12,0,1,13,192,6,0,36,-23,0,0,23,49,10,1,45,-22,0,-4,-19,-24,0,1,118,-92,-1,-1,-54,-30,-18,-34,0,11,35,-30,0,-9,-10,0,47,-45,-1]],[[-980575,371702,90,0,1,56,45,5,18,48,-24,0,-3,-17,-36,0,0,44,-26,0,1,45,-12,0,1,54,11,0,0,18,-64,0,0,-16,11,0,10,-23,-10,-34,-12,0,-1,-17,22,-7,25,-70,-14,-42,-34,0]],[[-980878,371588,31,-6,0,-21,28,-1,16,-28,-1,-15,46,0,0,199,-49,0,4,-125,-70,11]],[[-980482,371230,14,0,1,22,39,0,0,-21,7,0,28,71,2,74,-91,-1]]]},{"geoid":"2002175","name":"Arcadia","full":"Arcadia city","lsad":"city","polygons":[[[-946305,376366,130,1,0,73,-24,0,-6,7,0,30,-6,-10,-29,1,-2Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"KY","state":"Kentucky","fips":"21","features":[{"geoid":"2100298","name":"Adairville","full":"Adairville city","lsad":"city","polygons":[[[-868652,366667,19,-3,-4,-56,41,-4,58,14,28,-3,-5,19,26,2,1,129,-13,1,-3,29,-24,27,-45,22,-14,-11,14,-6,-47,-42,13,-37,-37,24,4,-87,-9,0]]]},{"geoid":"2100514","name":"Ages","full":"Ages CDP","lsad":"CDP","cdp":true,"polygons":[[[-832498,368530,156,-43,23,12,-35,26,-40,14,-2,15,-26,1,39,31,7,13,-2,31,-25,34,-14,-18,-30,-3,-18,-15,-16,-41,-29,-2]]]},{"geoid":"2100694","name":"Albany","full":"Albany city","lsad":"city","polygons":[[[-851490,366795,273,0,-1,218,-269,1,-2,-36]]]},{"geoid":"2100802","name":"Alexandria","full":"Alexandria city","lsad":"city","polygons":[[[-844205,389670,9,-20,44,28,-6,6,21,30,38,-17,23,10,2,-15,-11,-7,19,-20,59,39,25,0,19,-27,-57,-20,-19,20,-10,-5,16,-27,-7,-3,7,-15,-7,-35,10,-13,29,0,-41,-27,19,-15,30,18,14,-43,-17,-7,-9,-32,48,28,21,-3,-3,-54,23,4,23,-78,-36,-8,16,-27,-5,-13,17,-45,-37,-9,-1,7,-10,-2,-2,-23,13,6,6,-14,54,21,3,-8,40,4,-15,61,60,13,-23,30,-28,-6,24,21,-12,24,7,3,-13,16,-17,-4,-13,35,-42,-3,-6,47,88,-10,33,4,-2,-22,90,-146,-38,-17,17,-50,63,3,9,-16,24,1,-1,17,13,1,6,16,-18,73,-44,-5,-3,10,-38,-16,-74,128,0,20,32,21,11,-18,-26,-8,78,-67,-17,49,27,9,-3,22,-8,5,56,19,24,-69,6,-1,30,19,-26,41,24,6,-6,15,63,16,-4,9,100,-13,2,-8,31,5,4,-17,12,10,-18,29,-19,13,-24,1,14,15,-20,19,-8,-13,10,-5,-14,-12,-24,9,-13,-16,-35,-10,-7,19,-114,-26,-26,40,31,21,-6,17,-34,26,-11,-7,4,19,-23,19,25,16,28,38,-20,8,-6,21,-31,-7,-2,15,-24,27,-5,32,-16,-17,-16,-3,-45,9,1,23,-38,-11,-119,70,-53,46,-7,17,-46,-36,-8,5,5,18,-14,-4,10,-22,10,0,-9,-15,-38,-29,21,-73,46,4,-31,-7,7,-12,-43,0,41,-33,-21,-16,2,-21,-11,-8,-12,10,5,12,-15,24,-16,-2,-22,25,-4,-28,-32,-24,43,-25,-53,-35]]]},{"geoid":"2100946","name":"Allen","full":"Allen city","lsad":"city","polygons":[[[-827353,376159,25,-22,0,-32,53,-33,21,0,-5,53,11,19,22,12,14,-12,-6,20,-25,-12,-16,-21,-65,32,-6,-7]]]},{"geoid":"2101000","name":"Allensville","full":"Allensville CDP","lsad":"CDP","cdp":true,"polygons":[[[-870779,367096,76,-13,14,-17,43,-4,11,-8,4,35,31,-1,2,161,-49,18,-19,-35,-57,29,-23,-13,-27,-57,-4,-57]]]},{"geoid":"2101504","name":"Anchorage","full":"Anchorage city","lsad":"city","polygons":[[[-855552,382637,32,-54,17,1,8,-17,10,3,11,-24,35,10,16,-39,85,21,3,-7,68,34,15,18,-5,21,20,-11,-1,16,-16,6,-13,41,84,122,-16,38,17,0,6,7,-36,16,-10,23,-245,-69,11,-23,-40,-18,5,-13,-14,-4,8,-19,-17,1,-9,-21,8,-3,-9,-28,-31,7]]]},{"geoid":"2101648","name":"Annville","full":"Annville CDP","lsad":"CDP","cdp":true,"polygons":[[[-839974,373445,9,-63,14,-14,40,-15,4,-23,11,-4,-16,-52,35,-87,13,-16,5,-25,-10,-5,-5,-22,7,-19,67,-31,46,-3,73,5,39,31,-9,-32,7,-8,-13,-98,30,-1,28,16,21,2,45,28,10,30,18,20,57,42,34,19,18,1,72,94,27,-7,-1,42,49,64,-133,-12,43,79,-51,20,-8,16,14,18,-30,27,-37,-2,-26,19,-4,28,-24,3,-40,-33,-33,-45,5,-17,-108,-20,-85,1,-50,31,-47,1,-65,44,-66,2]]]},{"geoid":"2101720","name":"Anthoston","full":"Anthoston CDP","lsad":"CDP","cdp":true,"polygons":[[[-875394,377511,88,-28,19,33,66,-29,-16,49,-49,69,-27,-4,-53,26,-24,-19,-26,19]]]},{"geoid":"2101972","name":"Arjay","full":"Arjay CDP","lsad":"CDP","cdp":true,"polygons":[[[-836503,367984,77,37,38,-14,8,42,33,-8,25,21,-4,31,-38,33,-96,-10,-19,-70,-18,2,-36,-34]]]},{"geoid":"2102044","name":"Arlington","full":"Arlington city","lsad":"city","polygons":[[[-890189,367861,87,11,4,-12,26,2,0,42,13,33,-99,14,0,-29,-56,6]]]},{"geoid":"2102188","name":"Artemus","full":"Artemus CDP","lsad":"CDP","cdp":true,"polygons":[[[-838562,368371,47,-20,61,-97,20,-17,31,-9,63,28,-6,43,43,64,18,12,-10,28,-41,36,-45,12,-8,13,-30,-24,-3,-19,-32,-11,-44,5,-7,24,-39,-23]]]},{"geoid":"2102368","name":"Ashland","full":"Ashland city","lsad":"city","polygons":[[[-826818,384392,35,-16,154,-18,248,71,18,-2,4,-26,19,-43,62,5,65,25,15,-38,19,-6,12,22,-24,30,44,16,10,-33,58,24,16,20,-26,171,-54,101,-86,62,-162,61,-160,87,-48,36,-38,44,-34,-40,31,-18,-23,11,-5,-5,6,-41,46,-46,-5,-9,56,-23,-34,-24,-62,-10,-42,-38,-14,6,-7,-13,18,-3,-12,-89,-6,-7,-25,2,-2,-12,18,-2,-61,-76,-24,-107]]]},{"geoid":"2102638","name":"Auburn","full":"Auburn city","lsad":"city","polygons":[[[-867368,368688,30,2,-6,-39,77,-13,9,2,8,57,55,5,-8,-41,8,-14,-38,-6,-1,-23,-19,0,-2,19,-16,-2,3,-17,-13,-1,1,17,-10,-17,-20,0,2,-31,101,11,10,-5,0,-29,184,-1,-4,139,93,0,149,54,31,-43,51,14,-7,59,-130,-40,-60,-31,-44,-8,-314,-4,-6,10,-40,7,-19,13,-64,-9]]]},{"geoid":"2102656","name":"Audubon Park","full":"Audubon Park city","lsad":"city","polygons":[[[-857340,382013,37,-18,13,15,69,24,30,23,-39,52,-78,-36,10,-15,-55,-24]]]},{"geoid":"2102674","name":"Augusta","full":"Augusta city","lsad":"city","polygons":[[[-840199,387730,72,-68,130,25,7,-34,34,9,-10,-14,3,-25,22,2,-11,-30,46,-9,10,24,-1,21,27,12,-16,32,30,-8,-22,23,7,15,-42,1,-29,11,-12,20,44,7,13,10,-5,-21,-24,-3,12,-17,30,4,-2,9,49,15,25,19,22,-6,28,10,2,10,-25,6,-16,-9,-8,13,-61,-9,-10,15,-36,-23,-43,5,-6,45,-96,-15,-143,-43]]]},{"geoid":"2102764","name":"AuxiLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"LA","state":"Louisiana","fips":"22","features":[{"geoid":"2200100","name":"Abbeville","full":"Abbeville city","lsad":"city","polygons":[[[-921653,299769,49,-7,1,11,119,-17,-2,-10,28,-4,-4,-9,-42,7,-16,-19,91,-13,-82,-38,-31,9,-52,-18,-18,-27,-6,-25,56,-8,5,13,60,-9,-3,-12,30,-5,3,13,65,-10,2,7,31,-5,-4,-24,52,0,0,53,100,0,10,9,0,24,47,-6,-1,31,95,-10,0,25,58,-12,0,29,37,-8,0,-18,9,0,4,15,15,-2,1,-13,27,1,0,7,51,-13,-7,-21,8,-2,8,20,74,-19,-26,56,-1,57,-19,1,-27,58,-9,3,-22,-12,23,-49,-36,0,0,-15,-15,-13,-63,0,-1,44,-45,-1,-1,49,8,0,0,7,-44,52,-28,5,-4,-15,-38,6,3,14,-77,-3,126,-21,-20,-24,-97,14,-11,-13,-1,-5,103,-10,-12,-33,-156,17,6,9,-30,5,-11,-9,-53,9,4,24,22,44,-18,2,19,29,-39,6,7,11,-57,11,-48,-62,-32,5,2,8,-6,-8,-23,3,-10,-14,55,-14,-1,-8,-57,8,0,-14,58,-12,-56,9,-18,-13,26,-73,26,-24,-95,15,7,27,-15,-1,-3,-16,-27,3]]]},{"geoid":"2200240","name":"Abita Springs","full":"Abita Springs town","lsad":"town","polygons":[[[-900488,304632,36,-3,0,-8,12,-2,0,-20,17,0,-7,-3,7,-17,16,-1,0,21,189,-2,0,-33,66,-3,-1,-31,43,0,-1,36,-16,7,-1,52,-24,15,4,157,12,2,-15,65,4,54,12,6,-12,9,0,35,-86,1,0,-35,-128,-1,0,36,-24,0,9,-11,1,-25,-72,-1,-1,11,-10,-112,9,-1,-2,-158,-38,0]]]},{"geoid":"2200415","name":"Addis","full":"Addis town","lsad":"town","polygons":[[[-912902,303529,168,29,14,-32,-132,-29,13,-48,151,47,7,-22,30,12,38,-89,10,4,2,34,23,59,-13,64,111,20,16,80,29,55,-96,37,14,19,-5,9,-167,66,-52,19,-14,-31,-47,17,-18,-27,36,-43,42,-81,-90,14,-7,-15,-9,2,-11,-29,133,-13,6,-19,-123,1,-11,-25,90,2,18,-43,-163,-20]]]},{"geoid":"2200835","name":"Albany","full":"Albany town","lsad":"town","polygons":[[[-905921,304932,98,-1,6,-41,19,-53,4,-29,-19,-20,-64,-18,51,3,28,-20,1,-13,17,-1,7,-64,-7,72,26,26,58,11,-52,0,-42,24,6,5,-28,69,32,4,-4,23,-17,0,-2,23,39,-9,-7,22,-16,7,7,19,-10,21,36,83,-18,13,-12,30,-140,0]]]},{"geoid":"2200975","name":"Alexandria","full":"Alexandria city","lsad":"city","polygons":[[[-925643,313489,3,-63,6,-18,19,12,23,-21,17,9,64,-76,22,-3,3,15,18,-3,10,64,47,-7,-6,-44,32,-26,24,14,2,12,-41,8,6,38,55,70,68,-10,54,-24,8,-12,-6,-37,-34,4,-1,-5,36,-5,3,14,11,-10,37,30,188,-73,-5,-11,16,-9,7,13,40,-16,-17,-22,14,-7,11,25,48,-19,31,-21,-31,-51,61,-7,-8,-38,4,-1,-5,-6,-16,-8,-64,84,-22,12,-13,-20,15,-8,11,19,39,-44,-24,-11,-19,4,6,-12,-58,-23,-7,20,-11,-15,3,-26,18,-17,23,-32,-28,-13,4,-11,31,17,19,-26,-61,-32,0,-9,8,-14,-138,-47,-25,-3,-12,23,-26,-7,-6,15,-18,6,-7,-3,15,-33,-58,2,8,34,16,-1,3,26,-4,17,-55,-12,11,61,-25,4,5,43,-140,7,-25,-3,7,-44,-6,-15,-4,-36,-13,-35,-14,-25,0,-17,25,-1,8,20,15,11,1,-10,16,-23,70,-4,-1,-23,-5,-9,16,-5,7,37,12,0,-6,-35,15,35,100,-2,-3,-15,33,-1,-1,-29,34,-6,-1,-30,-32,-22,26,-11,42,19,21,-1,15,-9,-24,-17,35,-45,15,13,29,14,-24,-31,22,-5,-37,-39,-15,2,-23,10,10,-7,-17,-22,-19,0,-9,-14,10,-41,35,27,24,-2,-9,-35,23,-6,7,14,17,-3,-23,-14,0,-10,-15,-29,-37,7,1,-21,10,-13,18,-7,4,-7,36,53,27,-18,62,-16,-47,-74,91,-42,75,112,25,-7,6,0,7,11,42,-3,13,-12,-3,-15,-15,-18,-2,-19,-45,-63,44,-14,94,120,7,-5,34,40,43,-8,-6,-14,6,-4,-91,-257,34,28,-14,10,42,118,0,-11,54,5,-1,-14,66,24,8,10,39,-26,20,25,-14,11,29,28,25,-25,-24,-35,15,-4,23,20,-2,-23,-18,-10,-16,-1,-48,-24,-26,-9,-12,-20,20,-27,17,-10,34,-8,70,4,16,-6,-29,134,26,-13,20,10,-10,33,35,15,-35,37,48,37,-12,14,29,22,13,-11,-29,-25,12,-13,74,54,-25,21,182,119,15,76,14,42,-3,12,-22,16,-52,-2,-73,15,-81,36,-94,67,-80,64,-100,65,-33,76,2,43,-20,49,-7,37,-12,4,-34,27,-55,13,-52,-13,-39,-31,-7,-15,-26,-29,-61,0,-13,-19,-56,14,-50,32,-58,71,-20,18,18,32,-17,7,-16,-32,-105,21,8,24,-57,10,-6,-15,-54,-1,-26,11,-134,16,-36,15,17,28,120,-45,49,68,-22,5,-56,-23,-41,-5,-75,32,-25,-37,4,-13,-16,-8,-26,-43,-35,9,-71,29,16,38,-43,-74],[-925165,313454,11,9,39,-2,-6,-22,12,21,23,-3,-8,-10,2,-21,21,28,41,-14,25,-27,27,-40,24,-24,22,-14,83,-29,-7,-8,-323,128]]]},{"geoid":"2201780","name":"Ama","full":"Ama CDP","lsad":"CDP","cdp":true,"polygons":[[[-903232,299364,43,-143,434,181,-40,278,-81,-33,-75,-42,-169,-170,-80,-59,-23,-9]]]},{"geoid":"2201815","name":"Amelia","full":"Amelia CDP","lsad":"CDP","cdp":true,"polygons":[[[-911208,296583,68,-105,-62,-33,20,-45,53,-15,39,13,38,32,-1,25,51,109,16,206,-3,112,8,25,29,36,-1,20,-9,6,-32,-10,-84,-43,0,-36,-31,-20,16,-3,7,-37,25,-5,-13,-128,-16,-16,-117,-56]]]},{"geoid":"2201885","name":"Amite City","full":"Amite City town","lsad":"town","polygons":[[[-905356,307263,35,0,-9,-31,1,-45,114,3,10,24,0,34,33,-1,-1,-94,169,0,1,114,19,0,9,21,-3,19,-12,3,10,22,16,-3,-1,14,18,0,1,14,-59,5,0,84,42,0,-6,92,-123,3,-4,-96,-42,0,-3,9,-33,-9,1,-54,-159,0,2,-92,-14,1,0,-13,-13,0]]]},{"geoid":"2201920","name":"Anacoco","full":"Anacoco village","lsad":"village","polygons":[[[-933572,312404,156,1,1,-79,81,1,2,172,40,-1,-3,81,-80,1,-2,114,-43,1,0,70,-121,-2,-2,-291,-28,0]]]},{"geoid":"2202165","name":"Angie","full":"Angie village","lsad":"village","polygons":[[[-898318,309543,234,2,-1,60,36,120,-199,-2,-16,-53,-33,-64,4,-31]]]},{"geoid":"2202550","name":"Arabi","full":"Arabi CDP","lsad":"CDP","cdp":true,"polygons":[[[-899975Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"MA","state":"Massachusetts","fips":"25","features":[{"geoid":"2500135","name":"Abington","full":"Abington CDP","lsad":"CDP","cdp":true,"polygons":[[[-709986,421116,195,25,3,-7,-20,-22,1,-19,26,-15,7,-22,-5,-8,28,-86,-7,-67,4,-20,287,71,308,55,-156,164,-93,349,-614,-241]]]},{"geoid":"2500530","name":"Acushnet Center","full":"Acushnet Center CDP","lsad":"CDP","cdp":true,"polygons":[[[-709190,416818,16,-8,13,-46,33,-17,15,16,63,-5,81,16,76,83,-45,-7,-26,55,-21,21,-49,-3,8,14,-43,5,-43,23,-30,-3,-30,-64,5,-12,-23,-32]]]},{"geoid":"2500590","name":"Adams","full":"Adams CDP","lsad":"CDP","cdp":true,"polygons":[[[-731346,426220,17,-21,87,-36,7,-13,38,-10,7,17,21,8,-9,17,23,4,86,-12,10,-12,32,-3,-4,76,-13,34,18,103,-7,13,-90,12,0,20,-31,9,-47,-52,-25,1,-8,33,10,19,-25,9,-11,14,-49,-71,-59,-155]]]},{"geoid":"2500840","name":"Agawam Town","full":"Agawam Town city","lsad":"city","polygons":[[[-727146,420366,187,2,528,-44,351,-16,0,82,16,88,59,100,87,118,82,85,9,35,-14,54,-44,62,-33,-12,-41,19,-29,-7,-19,-69,-89,23,-39,-11,-74,2,-81,34,-21,41,16,21,-13,29,-25,4,-53,-18,-49,6,-56,-4,-83,-22,-31,-42,-9,-31,6,-27,-7,-20,-24,-1,-24,19,-21,47,-19,20,-29,16,-35,56,-47,2,-8,9,-11,54,-116,-11,-107,-238,-6,-86,-19,-90,0,-90,-29,-57,-21,-109]]]},{"geoid":"2501185","name":"Amesbury","full":"Amesbury city","lsad":"city","polygons":[[[-710046,428632,248,-183,106,-224,77,-26,157,8,55,18,64,55,24,42,63,63,44,25,51,-3,19,-44,20,-18,35,-9,41,3,44,135,-148,392,-162,-20,-357,-156,-309,-47]]]},{"geoid":"2501370","name":"Amherst Town","full":"Amherst Town city","lsad":"city","polygons":[[[-725468,424001,152,14,-39,-361,-10,-3,7,-51,-51,-404,29,5,28,-158,40,-7,32,-21,33,17,33,-10,147,42,60,-12,16,11,55,-40,58,24,47,6,42,17,147,11,-131,687,-126,570,-543,-66,-16,-171]]]},{"geoid":"2501430","name":"Andover","full":"Andover CDP","lsad":"CDP","cdp":true,"polygons":[[[-711665,426605,28,-49,22,-1,101,-78,-12,-16,15,1,7,-25,-27,-19,10,-7,-48,-30,4,-25,25,-1,20,-19,16,-3,22,17,22,-10,10,4,11,45,20,-40,31,37,48,8,25,30,29,74,64,51,34,61,-87,117,-62,-19,-46,2,-20,-25,-26,-3,-2,-8,-19,10,-14,-12,-8,13,5,13,-14,-2,-14,28,-12,-3,-27,-8,-51,-63,-74,-41]]]},{"geoid":"2501640","name":"Arlington","full":"Arlington CDP","lsad":"CDP","cdp":true,"polygons":[[[-712026,424148,83,-14,-10,18,10,1,106,-39,93,-20,105,-37,64,-33,139,-50,32,24,41,13,12,14,6,33,21,32,0,62,-60,3,-45,40,1,24,-32,18,-8,16,-31,105,-324,5,-176,-186]]]},{"geoid":"2502515","name":"Athol","full":"Athol CDP","lsad":"CDP","cdp":true,"polygons":[[[-722671,426008,58,-249,41,-2,17,23,66,36,19,0,9,-8,1,-19,14,-20,19,-63,-12,-27,9,-38,45,0,66,34,130,-7,5,112,42,-1,10,55,27,-1,7,-37,23,1,6,17,14,4,8,-26,13,-5,22,31,-84,48,94,85,6,29,32,14,23,21,21,34,26,13,21,76,-3,29,69,64,-47,1,-106,-20,-2,-19,21,-36,2,-57,-17,-17,-57,-12,-44,6,-45,-22,-20,-32,2,-18,18,-26,-25,-23,-26,-7,-18,4,45,27,-7,55,-40,1,-17,78,-1,52,-87,-4,-16,-17,-21,-5,-69,6,-16,-9,-147,-21,14,-63,-30,-2,-25,-14,-12,-26,-22,-8,-32,7]]]},{"geoid":"2502690","name":"Attleboro","full":"Attleboro city","lsad":"city","polygons":[[[-713817,418932,810,105,782,85,143,-33,-511,653,-94,131,-673,-465,-457,-260,0,-210]]]},{"geoid":"2503040","name":"Ayer","full":"Ayer CDP","lsad":"CDP","cdp":true,"polygons":[[[-716041,425577,50,7,2,-17,38,10,42,-29,36,-13,115,-16,1,-8,112,63,-66,-11,-65,13,50,95,-5,35,-135,7,-29,-36,-27,-14,-33,6,-52,-39,5,-32,-20,-4]]]},{"geoid":"2503355","name":"Baldwinville","full":"Baldwinville CDP","lsad":"CDP","cdp":true,"polygons":[[[-720927,426116,12,-25,-9,-56,14,-26,6,-43,55,-33,-11,-7,18,-10,15,-36,-15,-17,14,-18,-10,-20,87,-5,1,72,22,7,-11,72,-36,58,3,9,15,4,19,18,3,-16,16,-19,55,-30,19,-35,20,4,10,-5,3,-17,30,-12,28,4,-146,117,40,-11,2,18,107,31,-194,153,1,-20,-25,-53,-25,40,-25,-14,8,-19,-66,0,-22,-27,-2,-16,-16,3]]]},{"geoid":"2503690","name":"Barnstable Town","full":"Barnstable Town city","lsad":"city","polygons":[[[-704646,416326,81,24,5,-7,29,6,41,-137,-14,-45,-22,-7,-84,-96,-40,-97,64,-80,56,-24,26,13,2,14,36,12,13,16,27,73,54,62,55,4,49,-10,183,26,79,-9,214,50,93,45,52,78,-2,30,45,44,88,36,135,16,82,-17,83,-41,50,-51,49,20,110,21,5,30,42,19,54,8,93,-1,68,-22,37,-49,33,17,46,-14,13,24,-130,161,150,454,-11,129,-21,25,-25,-4,-10,15,20,30,-42,12,-95,-29,-163,8,-63,-23,-59,18,-133,-6,-76,16,-18,-24,21,-33,-14,-17,-135,-25,-153,11,-56,26,20,37,-17,31,-195,96,-34,-9,-97,45,-8,19,-627,-630,76,-71,45,-66,-51,-78,-15,-8,6,-30,-18,5,-41,-17,-78,-4,-13,-28]],[[-703890,417291,49,19,-12,29,25,8,97,-17,98,0,144,-15,29,6,52,-13,83,10,133,-29,159,-14,70,-22,31,0,11,35,19,7,20,-3,27,-40,37,-28,74,11,5,8,-13,15,-79,32,-52,30,-73,24,-880,54,-96,-100]]]},{"geoid":"2503705","name":"Barre","full":"Barre CDP","lsad":"CDP","cdp":true,"polygons":[[[-721209,424203,24,-26,46,-25,12,6,26,-5,13,13,19,-10,23,-39,27,-7,8,-13,40,-18,13,13,14,29,-7,22,-10,-2,16,76,-93,151,-96,8,-14,-14,21,-54,-14,3,14,-26,-1,-41,-32,-10,-16,18,-62,3]]]},{"geoid":"2504790","name":"Belchertown","full":"Belchertown CDP","lsad":"CDP","cdp":true,"polygons":[[[-7243Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"MD","state":"Maryland","fips":"24","features":[{"geoid":"2400125","name":"Aberdeen","full":"Aberdeen city","lsad":"city","polygons":[[[-762039,395343,26,-10,7,12,56,-22,12,13,16,-2,-39,-33,29,-16,43,-6,6,-33,-57,-4,-41,-35,94,-18,-14,-76,99,4,-41,-49,16,-22,-156,-100,5,-5,-51,-33,23,-11,-31,-20,15,-10,20,8,-10,12,7,9,28,-10,57,22,-13,-31,56,8,-28,-13,76,-38,115,110,57,70,12,4,51,-30,29,58,40,-12,17,-18,2,10,14,-17,19,8,17,33,-26,31,52,41,-15,4,1,27,22,13,24,-3,15,7,-18,33,-72,-44,8,-9,-1,-25,-8,17,-56,39,27,22,67,32,5,-8,16,8,8,15,136,65,-67,-11,-19,75,-29,-7,5,-19,-24,1,20,-18,5,-34,-39,-7,-14,-15,31,-25,-139,-66,-47,32,1,66,-11,34,-43,49,-33,4,-3,-15,-7,18,-32,22,-45,-60,-75,-44,8,40,-8,14,-21,0,-2,11,-39,-4,-6,5,57,41,7,-6,51,12,1,20,-36,5,-16,-8,6,20,46,-7,-16,61,-71,7,0,-12,-26,-1,9,13,-18,9,-11,-11,-4,-29,11,0,0,-31,-21,-8,-18,6,-19,-31,7,-4,-8,1,-64,-51]]]},{"geoid":"2400175","name":"Aberdeen Proving Ground","full":"Aberdeen Proving Ground CDP","lsad":"CDP","cdp":true,"polygons":[[[-761750,394906,201,-72,-27,-27,-45,-19,52,-25,19,-42,-48,-20,-21,-30,154,-64,-70,-29,-14,-14,-11,-34,-42,-31,13,-16,14,1,31,-26,22,-37,25,-16,35,-2,46,10,13,-9,64,0,117,-37,11,8,13,-13,28,26,9,-20,-14,-17,12,-4,54,23,31,-7,12,7,-22,26,20,4,29,-6,-8,-18,10,-16,15,0,3,41,16,31,26,8,17,56,16,102,-5,157,-30,-3,-4,9,-64,27,-74,74,-33,7,8,-33,-38,-48,-2,-15,-14,-6,9,-8,-14,6,11,31,14,3,-11,13,-33,2,-25,17,-30,37,-52,15,-7,25,19,24,-17,11,26,31,-20,23,-130,21,-38,-13,-31,30,-36,11,-29,-58,-51,30,20,-17,-62,-61,-23,9,-4,-5]]]},{"geoid":"2400200","name":"Abingdon","full":"Abingdon CDP","lsad":"CDP","cdp":true,"polygons":[[[-762990,394563,23,-30,10,-8,18,4,30,-12,23,4,12,-5,9,-47,10,0,171,101,79,18,78,38,21,21,-69,65,-28,16,4,22,-21,39,-1,17,-80,-38,-83,-63,-212,-90]]]},{"geoid":"2400225","name":"Accident","full":"Accident town","lsad":"town","polygons":[[[-793262,396241,31,-12,-31,-42,45,-25,38,54,55,57,-41,61,-60,-19,-35,-30,13,-25]]]},{"geoid":"2400250","name":"Accokeek","full":"Accokeek CDP","lsad":"CDP","cdp":true,"polygons":[[[-770579,386397,101,-235,18,26,-2,14,62,58,16,40,97,37,17,13,7,36,39,35,13,43,10,12,91,44,58,7,37,20,29,0,73,24,19,-7,126,23,44,-2,20,20,47,8,72,-24,119,0,70,-43,41,6,49,-11,31,8,87,-14,20,-10,33,4,1,21,-20,44,4,9,-16,30,-82,1,-27,11,-14,42,-26,15,-34,0,-43,79,28,17,148,56,12,31,-2,41,-47,33,-10,17,4,23,25,35,43,24,-17,11,-119,21,-35,0,-25,-12,-6,16,-68,-21,-17,7,-10,-19,-12,-3,-39,24,-32,-9,-28,6,-61,-23,-55,11,6,-23,-43,-10,-18,-17,-4,-25,-25,-12,-56,14,-53,-40,-31,22,-18,-10,-9,8,-75,-10,-250,17,-143,55,-161,-17,-191,-78]]]},{"geoid":"2400350","name":"Adamstown","full":"Adamstown CDP","lsad":"CDP","cdp":true,"polygons":[[[-774865,393034,93,-6,-1,-45,92,1,-15,44,59,1,7,21,79,0,11,60,-16,8,-4,11,-15,-3,1,6,-107,-5,0,18,-12,0,2,19,-50,-38,-28,9,-8,-9,17,-15,-76,-57]]]},{"geoid":"2400400","name":"Adelphi","full":"Adelphi CDP","lsad":"CDP","cdp":true,"polygons":[[[-769798,389993,44,-65,34,-4,37,-26,-45,-57,126,11,16,-20,32,9,32,-4,5,-13,-22,1,1,-8,-10,0,6,-29,117,-30,16,11,30,-5,0,6,-96,41,-11,28,-14,7,-57,8,-10,25,0,35,-42,34,-15,41,-35,39,18,-2,29,23,28,-5,44,68,6,-3,35,112,-143,-31,-75,-4,-119,-163]]],"label":[-76.97112205128205,38.9991]},{"geoid":"2400712","name":"Algonquin","full":"Algonquin CDP","lsad":"CDP","cdp":true,"polygons":[[[-761121,385753,33,-4,-5,33,-23,3,-2,10,8,6,49,-8,-42,14,9,14,64,-12,75,-31,19,-25,47,35,-14,10,-17,-6,-27,20,48,34,41,-30,35,31,-42,12,-24,43,6,25,-18,2,-115,-54,-116,-42]]]},{"geoid":"2400800","name":"Allen","full":"Allen CDP","lsad":"CDP","cdp":true,"polygons":[[[-756965,382883,24,-5,-15,-49,33,-15,33,18,28,35,-10,32,57,31,0,7,-31,-7,-17,35,-17,-11,-33,14,-21,-35,-18,-5]]]},{"geoid":"2401450","name":"Andrews AFB","full":"Andrews AFB CDP","lsad":"CDP","cdp":true,"polygons":[[[-768997,387958,27,-86,51,-34,91,-1,60,-13,122,-1,3,19,30,11,1,6,0,7,-32,18,74,8,3,67,49,22,-20,32,22,55,27,-14,-10,140,8,11,-77,92,-111,-1,-45,-8,-55,-24,-145,-95,-46,-75,-27,-20,-35,-8,16,-20,-21,-27]]]},{"geoid":"2401600","name":"Annapolis","full":"Annapolis city","lsad":"city","polygons":[[[-765397,389775,19,-12,10,-28,14,15,-4,-56,19,-1,-29,-26,35,-17,-8,-9,2,-13,12,0,12,-28,60,58,21,-15,-31,-23,38,-27,-15,-18,20,-6,24,29,26,8,1,-42,34,-22,9,77,25,-18,34,-46,-62,1,-7,-22,10,-12,7,-69,60,-13,6,10,-1,-26,26,2,6,56,58,-17,32,24,12,-18,19,19,21,-11,-13,-13,9,-13,23,10,50,55,53,13,36,19,-13,0,-1,12,-26,3,-7,-25,-14,-11,-22,6,2,11,27,-4,7,14,-24,4,16,6,2,34,22,14,26,-2,-20,61,7,53,-56,45,-40,-3,-21,12,-17,40,-27,5,-35,23,-21,-22,-51,47,15,28,23,19,86,21,-89,88,-57,-44,-27,-48,-23,-8,-15,-15,-60,-9,-30,-13,-45,6,-75,-23,34,-14,-25,6,-66,-58,-8,4,-17,-26]]]},{"geoid":"2401635","name":"Annapolis Neck","full":"Annapolis Neck CDP","lsad":"CDP","cdp":true,"polygons":[[[-765443,389473,381,-261,90,43,77,19,60,-38,27,-34,25,-12,1,-25,24,-20,63,-30,1,-39,91,-5,15,81,-31,88,-13,8,0,37,-51,20,-5,-7,-9,5,27,43,30,-39,15,-3,28,35,94,72,-75,73,-53,2,-82,79,-16,47,-26,2,-22,-14,-2,-34,-16,-6,24,-4,-7,-14,-27,4Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"ME","state":"Maine","fips":"23","features":[{"geoid":"2300695","name":"Alfred","full":"Alfred CDP","lsad":"CDP","cdp":true,"polygons":[[[-707522,434843,71,-22,39,-3,19,-23,-29,-1,2,-18,17,-19,22,-8,5,-19,40,-50,5,-33,73,-36,29,0,-2,-18,28,-19,46,2,43,18,19,34,36,9,31,18,9,-7,28,31,-8,35,4,17,14,-10,-5,22,-18,-5,-9,28,18,16,-3,37,9,19,-37,31,-1,11,-17,11,-4,20,-27,-7,-3,-15,-28,8,-79,55,-12,-27,-46,18,-12,-6,16,-14,-48,-33,-65,20,-54,-51,-31,-9,-39,11]]]},{"geoid":"2301360","name":"Anson","full":"Anson CDP","lsad":"CDP","cdp":true,"polygons":[[[-699083,447854,194,24,-4,25,50,42,-42,26,0,19,21,20,-2,20,-53,80,5,16,-28,20,-23,-2,-14,9,-14,-41]]]},{"geoid":"2301675","name":"Ashland","full":"Ashland CDP","lsad":"CDP","cdp":true,"polygons":[[[-684224,466071,72,-3,28,-6,20,-14,264,2,-16,30,-9,48,-22,32,-56,13,-19,27,140,1,-46,69,231,3,7,14,-7,11,7,52,-24,13,-1,31,-41,54,-29,14,-17,-25,-55,-39,-50,-50,-75,-1,0,47,-211,-2,-7,-22,-32,-26,-13,-24,38,-16,-44,-84,-17,-77,-23,-32]]]},{"geoid":"2302060","name":"Auburn","full":"Auburn city","lsad":"city","polygons":[[[-703142,440926,-13,-5,4,-30,19,-16,-4,-17,17,-15,7,-24,34,-23,54,-8,19,-21,53,-27,20,-50,-1,-40,45,-2,-260,-274,617,-450,239,-183,46,45,48,-28,80,36,409,416,-44,13,-33,22,-55,87,-35,120,-52,37,-66,75,-30,57,-49,24,-9,50,6,85,-15,23,-48,45,-82,51,-18,19,-4,21,19,63,-9,51,16,27,44,35,9,52,36,25,27,32,22,53,54,55,16,61,-49,60,-39,36,-10,22,82,114,6,25,22,34,-74,69,-54,33,-775,205,-31,-54,16,-6,-19,-52,-5,-45,-47,-89,-34,-43,62,-43,42,-42,28,-15,-35,-34,2,-31,-33,-35,0,-21,-53,-55,16,-58,21,-21,-20,-20,-24,-7,23,-15,17,14,7,-38,-16,-18,14,-10,-31,-30,9,-35,-26,-61,9,-8,-33,-36,11,-10,-34,-38,16,-20,-32,-33,-65,24,-17,-40]]]},{"geoid":"2302100","name":"Augusta","full":"Augusta city","lsad":"city","polygons":[[[-698339,443467,22,-4,23,8,9,-6,-53,-144,32,-5,-5,-17,66,-13,-18,-38,-34,5,-27,-66,54,-9,-1,-38,79,-14,5,-13,98,-16,-17,-54,101,-16,-12,-34,221,-37,-4,-5,1062,-173,223,-28,258,868,-1928,299,-36,-110,-15,0,-97,-300]]]},{"geoid":"2302795","name":"Bangor","full":"Bangor city","lsad":"city","polygons":[[[-688364,447775,446,59,106,-51,49,42,43,90,38,46,41,29,82,36,96,65,45,8,178,93,53,12,-37,154,-34,-4,-50,196,99,87,-205,152,-30,13,-1146,-153]]]},{"geoid":"2302830","name":"Bar Harbor","full":"Bar Harbor CDP","lsad":"CDP","cdp":true,"polygons":[[[-682496,444113,36,-10,-3,-9,78,-28,55,-65,47,-33,-4,-41,-14,-25,34,-36,-10,-15,-30,-11,-32,-89,15,27,16,8,23,-3,32,-25,18,-31,14,-1,9,13,-4,20,9,9,17,1,37,-35,112,-51,10,-36,-3,-34,28,-22,24,9,32,39,92,14,13,38,-76,71,-16,-4,-7,18,10,22,-31,-7,-18,10,-5,18,22,-3,8,17,-11,31,-66,60,-55,0,-65,-19,-14,33,-120,74,-17,-10,4,16,-13,14,-80,62,-92,47,-21,-11]]]},{"geoid":"2303355","name":"Bath","full":"Bath city","lsad":"city","polygons":[[[-698747,439536,177,-89,-24,-79,-16,-7,5,-13,-5,-22,-15,-10,123,-61,84,-3,82,-192,22,-14,-46,-49,-27,-74,-31,-48,132,12,-6,-46,-15,-20,8,-17,-27,-50,12,-10,-9,-19,14,-11,-6,-16,-21,-17,19,-15,65,9,20,18,-14,40,3,22,22,17,74,23,42,31,1,141,22,151,-6,64,8,75,-15,56,0,137,-84,79,-87,19,-16,10,-13,21,48,104,-18,42,-1,58,-128,73,-117,-49,-118,-37,-19,-17,-10,-93,-28,-59]]]},{"geoid":"2303950","name":"Belfast","full":"Belfast city","lsad":"city","polygons":[[[-690606,443674,539,232,72,54,34,-29,59,20,27,-19,31,37,29,19,-130,234,-39,34,60,30,54,-30,148,0,57,22,86,7,-83,290,-29,-3,-24,93,-30,-3,-23,88,-12,-1,-35,124,33,16,-30,31,-1371,-622]]]},{"geoid":"2304685","name":"Berwick","full":"Berwick CDP","lsad":"CDP","cdp":true,"polygons":[[[-708828,432732,11,-7,74,-6,17,-17,-1,-16,24,-23,71,-12,18,-20,18,-58,14,-10,31,-11,31,16,88,-25,-3,32,17,31,-64,39,-37,11,3,36,-36,43,-89,78,4,-75,-103,38,-77,76,-19,-4,26,-74,-17,11,-12,-6]]]},{"geoid":"2304790","name":"Bethel","full":"Bethel CDP","lsad":"CDP","cdp":true,"polygons":[[[-707988,444064,36,-42,-23,1,17,-11,9,-31,75,-76,161,67,39,-31,-41,58,22,14,-51,41,-30,10,0,28,-47,35,-20,4,-1,10,-56,-1,-65,24,-22,-8,-14,-20,6,-31,-45,-9]]]},{"geoid":"2304860","name":"Biddeford","full":"Biddeford city","lsad":"city","polygons":[[[-705653,434943,1290,-611,308,-135,101,28,24,-4,1,-31,26,-58,-21,-1,-2,-17,-28,-7,-20,-20,5,-17,-22,-57,-9,-5,-6,-52,14,-15,13,1,69,75,17,42,84,55,3,19,-64,14,38,43,62,17,4,69,61,65,85,50,123,29,59,-19,50,34,14,32,46,-3,-20,51,53,36,22,34,-100,-13,-202,6,-35,-13,-25,-44,-39,2,-48,28,-54,61,-87,10,-62,16,-76,99,-79,9,-29,20,2,25,-62,7,-42,32,-117,15,-9,16,1,28,-16,12,-80,26,-57,4,-29,11,-6,10,14,17,-1,12,-15,14,-112,-9,-48,9,-54,31,-19,-1,-62,-35,-180,-8,-34,7,-16,10,-48,62,-48,23,-39,74,-50,22,-22,19,-29,57,6,15,49,39,43,67,49,28,9,45,-27,5,-431,-443]]]},{"geoid":"2304965","name":"Bingham","full":"Bingham CDP","lsad":"CDP","cdp":true,"polygons":[[[-698892,450592,-11,-19,24,-29,74,-53,50,-19,22,-18,29,-68,36,-21,-6,19,14,-4,11,41,-11,10,-1,25,28,27,19,55,1,47,-13,13,6,20,59,30,11,40,51,31,-73,-5,-393,-64]]]},{"geoid":"2305350","name":"Blaine","full":"Blaine CDP","lsad":"CDP","cdp":true,"polygons":[[[-678985,465024,100,1,-13,-14,4,-54,209,1Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"MI","state":"Michigan","fips":"26","features":[{"geoid":"2600380","name":"Addison","full":"Addison village","lsad":"village","polygons":[[[-843587,419790,192,-1,-1,147,-194,-1]]]},{"geoid":"2600440","name":"Adrian","full":"Adrian city","lsad":"city","polygons":[[[-840891,418983,100,0,0,-19,-13,1,-5,9,-16,-15,-2,-37,8,1,0,-24,17,1,0,-13,-23,0,1,-43,146,18,-1,27,-14,0,0,13,24,1,1,-13,25,0,1,-18,18,7,0,12,91,2,1,-33,-23,-3,1,-38,121,-1,1,-19,-49,3,1,-27,16,0,1,-21,18,-5,181,6,22,35,-40,-1,-2,33,11,0,-2,36,133,4,-1,190,44,0,-1,48,-59,8,42,18,16,18,-1,56,-66,-1,-1,21,42,0,-3,37,-27,-1,-68,-49,2,-9,19,-1,0,-9,-92,2,-2,-53,-29,0,3,15,-26,0,1,-20,-40,5,18,17,-54,46,-29,-5,-44,-27,-25,3,1,-44,-25,1,-1,36,-7,0,1,-36,-89,0,-34,-26,-48,11,-4,-44,-65,-4,-1,38,-10,22,-39,0,1,-70,-26,0,6,-33,-29,-4]]]},{"geoid":"2600480","name":"Advance","full":"Advance CDP","lsad":"CDP","cdp":true,"polygons":[[[-851060,452199,37,2,-16,-46,3,-33,200,0,-2,-74,393,-1,1,34,-182,55,-37,35,-1,21,-14,11,-87,11,-51,35,-45,56,-187,-7,-1,-77,-49,-2]]]},{"geoid":"2600620","name":"Ahmeek","full":"Ahmeek village","lsad":"village","polygons":[[[-883999,472970,22,-11,30,9,-1,36,-50,0]]]},{"geoid":"2600700","name":"Akron","full":"Akron village","lsad":"village","polygons":[[[-835243,435598,199,1,-1,137,-198,-1,-1,-73]]]},{"geoid":"2600860","name":"Alanson","full":"Alanson village","lsad":"village","polygons":[[[-847973,454355,206,-7,0,149,-205,3]]]},{"geoid":"2600900","name":"Alba","full":"Alba CDP","lsad":"CDP","cdp":true,"polygons":[[[-849869,449886,29,3,-1,-67,-9,-23,4,-52,-47,0,0,-73,209,3,194,-7,3,174,-36,33,-18,4,-18,-23,-82,-62,-15,29,-28,1,0,115,-26,10,-53,-3,-105,-27,-31,-26]]]},{"geoid":"2600980","name":"Albion","full":"Albion city","lsad":"city","polygons":[[[-847824,422520,68,-30,6,-169,199,1,-1,-14,48,0,-1,14,148,0,-7,113,34,14,-1,17,-34,-11,-2,127,-15,3,15,6,-13,15,-37,8,-70,0,0,31,-77,-13,-103,6,-93,18,1,-43,23,0,0,-36,-23,-1,-48,16,-1,-17,-17,0]]]},{"geoid":"2601060","name":"Alden","full":"Alden CDP","lsad":"CDP","cdp":true,"polygons":[[[-852810,448740,88,0,58,10,-2,62,-40,17,-16,17,-1,39,-27,-1,5,-14,-16,-47,-14,-9,-5,-28]]]},{"geoid":"2601180","name":"Algonac","full":"Algonac city","lsad":"city","polygons":[[[-825511,426198,68,8,-14,-55,-46,-48,68,-41,30,2,32,11,67,76,123,92,35,86,-220,-17,-3,-69,-144,-10]]]},{"geoid":"2601260","name":"Allegan","full":"Allegan city","lsad":"city","polygons":[[[-858674,425162,12,13,71,1,-6,-37,279,5,21,-11,12,13,-5,151,98,-11,61,8,0,18,-13,-1,-1,19,-98,-12,-1,11,-49,12,-1,95,-71,-3,58,54,0,20,-51,-2,-7,-27,-27,-1,0,-45,-97,0,-2,71,-48,-1,2,-72,-38,0,-11,-11,-37,7,-22,-6,-6,-33,-30,0]]]},{"geoid":"2601300","name":"Allen","full":"Allen village","lsad":"village","polygons":[[[-847777,419547,62,11,4,-9,36,-2,0,17,44,0,22,14,0,14,-48,-6,1,34,-32,16,0,-55,-89,-28]]]},{"geoid":"2601340","name":"Allendale","full":"Allendale CDP","lsad":"CDP","cdp":true,"polygons":[[[-860242,429719,453,3,7,-146,592,2,1,-36,251,0,0,-36,50,0,-1,36,54,7,0,30,74,0,-8,143,20,117,-11,22,-202,179,-241,-23,-124,49,-131,71,-98,16,-254,-37,-191,-59,-33,3,-73,45,-158,134]]]},{"geoid":"2601380","name":"Allen Park","full":"Allen Park city","lsad":"city","polygons":[[[-832298,422275,215,5,15,-9,22,-43,41,6,-1,48,-14,43,-2,134,-6,-2,59,103,122,146,-61,-4,-105,45,171,202,-48,2,-106,59,-11,-5,-34,-45,-14,-44,-161,-191,-38,-23,-65,-3]]]},{"geoid":"2601540","name":"Alma","full":"Alma city","lsad":"city","polygons":[[[-846877,433827,-1,-36,-8,0,13,-14,6,14,60,-1,-4,-63,31,7,17,-10,0,-81,48,0,0,-72,49,-1,0,14,17,-13,34,-1,-1,-58,14,-6,37,-4,0,94,-24,1,-42,46,266,-2,0,73,99,0,1,217,-203,3,0,12,-20,0,0,12,20,0,0,30,-14,0,4,13,-153,6,-19,-11,1,-25,-118,-2,0,-71,-50,-8,0,-18,50,0,0,-12,-124,1,-1,-10,25,0,0,-12,-30,0]]]},{"geoid":"2601660","name":"Almont","full":"Almont village","lsad":"village","polygons":[[[-830544,429325,13,1,35,-32,-12,-1,9,-9,-13,9,-12,-14,-32,-3,9,-146,201,8,4,-26,102,5,-10,50,-43,-4,-1,52,-59,-3,-8,31,-65,-4,-3,48,-44,-2,15,36,-2,34,-97,-4]]]},{"geoid":"2601740","name":"Alpena","full":"Alpena city","lsad":"city","polygons":[[[-834766,450652,51,1,7,-181,225,-1,-15,-6,4,-42,15,26,58,62,86,69,33,3,56,34,39,-14,22,12,4,56,13,1,24,-17,27,2,16,23,-2,11,15,5,34,-21,63,31,34,-8,2,-7,35,0,11,20,-3,25,21,12,5,18,36,5,-150,-1,-3,136,-106,0,3,-68,-309,-2,-1,74,55,1,0,37,47,0,0,74,-46,2,1,29,-55,3,-1,-19,-10,0,1,19,-77,3,-4,-20,-27,4,7,17,-64,-3,-27,-4,-1,-47,31,-20,32,-1,-6,-16,25,-15,-26,-3,-7,-58,10,-11,-14,-2,2,-9,27,1,1,-36,-175,-1,2,-168,-51,2]]]},{"geoid":"2601800","name":"Alpha","full":"Alpha village","lsad":"village","polygons":[[[-883879,460325,154,2,2,182,51,1,1,71,-51,0,-1,-36,-105,-1,1,-144,-52,0]]]},{"geoid":"2601960","name":"Amasa","full":"Amasa CDP","lsad":"CDP","cdp":true,"polygons":[[[-884923,462175,642,3,-50,8,-15,13,-6,264,12,35,-72,-11,-53,3,7,30,-14,-4,-53,-42,-8,-61,13,-5,-11,-16,-75,-8,-36,-23,-14,-40,-263,-1]]]},{"geoid":"2603000","name":"Ann Arbor","full":"Ann Arbor city","lsad":"city","polygons":[[[-837992,42Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"MN","state":"Minnesota","fips":"27","features":[{"geoid":"2700172","name":"Ada","full":"Ada city","lsad":"city","polygons":[[[-965325,472915,43,0,0,9,279,1,0,36,11,0,3,47,-15,0,0,26,-107,0,-18,36,-56,-1,-10,36,-23,0,0,-36,-16,0,0,-34,-91,-1,1,-73]]]},{"geoid":"2700190","name":"Adams","full":"Adams city","lsad":"city","polygons":[[[-927289,435581,199,2,-1,143,-200,0]]]},{"geoid":"2700262","name":"Adrian","full":"Adrian city","lsad":"city","polygons":[[[-959431,436393,0,-86,32,0,-1,-14,-31,-1,0,-58,143,2,-10,20,20,16,48,-1,-11,9,0,78,100,-10,-1,38,-52,21,1,-53,-48,26,-78,9,0,19,23,2,-1,26,-28,3,-6,13,-3,-36,-87,-1,1,6,-33,-14]]]},{"geoid":"2700316","name":"Afton","full":"Afton city","lsad":"city","polygons":[[[-928624,448619,933,1,54,101,3,21,-105,158,-10,28,3,53,15,33,135,65,20,33,20,74,-85,-1,9,-45,-5,-18,-100,-69,-20,4,0,73,-11,21,2,158,-49,2,2,179,-814,2]]]},{"geoid":"2700460","name":"Aitkin","full":"Aitkin city","lsad":"city","polygons":[[[-937343,465289,11,-11,149,27,-1,-45,82,1,0,-19,-33,0,-12,-15,-12,18,-5,-18,-12,-2,24,-1,1,-15,15,0,11,15,0,-37,-22,1,0,-17,-30,0,0,-20,-106,0,1,-37,52,0,1,-37,54,0,-1,37,53,0,-1,28,54,0,0,-25,25,-4,-21,-20,13,-52,194,-1,0,35,-106,2,1,36,-54,2,-1,16,-17,18,11,17,-17,33,21,16,54,7,0,48,23,0,0,-11,24,0,13,38,1,-37,45,0,1,67,-107,-7,0,14,53,8,-2,40,-35,0,0,22,36,0,1,-35,36,0,-1,34,112,3,15,35,-164,0,-3,9,-11,-4,-34,14,12,-27,-17,-14,3,-20,-14,3,-11,-18,-23,1,3,-15,-114,-1,-9,56,-36,-22,-16,-1,0,-48,-54,17,1,-24,-51,0,-1,-14,-53,0]]]},{"geoid":"2700496","name":"Akeley","full":"Akeley city","lsad":"city","polygons":[[[-947428,469917,264,-2,-1,215,-52,2,0,8,-48,-31,0,-10,-52,6,-52,-62,-43,-25,-18,6]]]},{"geoid":"2700622","name":"Albany","full":"Albany city","lsad":"city","polygons":[[[-945939,456313,116,-28,-11,-11,17,0,0,-17,17,0,-4,-28,21,0,0,24,15,0,30,-21,6,10,52,-4,-1,-20,52,0,0,-73,104,1,0,53,83,-14,0,34,-32,0,0,58,-119,9,32,18,1,40,-32,0,-35,47,-2,43,-128,-2,0,-36,-27,0,-5,-37,-38,0,-58,-24,0,-21,-41,4]]]},{"geoid":"2700676","name":"Alberta","full":"Alberta city","lsad":"city","polygons":[[[-960557,455715,66,-1,6,-15,28,4,0,66,18,17,-119,0]]]},{"geoid":"2700694","name":"Albert Lea","full":"Albert Lea city","lsad":"city","polygons":[[[-934186,436571,45,0,4,-74,26,0,-1,-20,106,-4,12,-21,-12,-14,31,-10,-11,-24,-102,0,0,-58,23,-15,78,-21,0,19,22,0,0,-18,28,0,0,8,38,-5,6,17,181,2,-9,-25,19,0,9,-44,-13,1,20,-14,0,-12,23,0,0,-15,77,1,0,-37,-18,0,1,-37,94,0,8,25,25,0,8,-23,26,-13,38,7,46,43,-30,0,0,37,-92,1,25,-21,-21,0,-3,-11,-17,32,-46,49,54,0,0,20,35,-1,0,-8,20,0,1,-18,21,0,0,11,10,-7,1,-18,16,-1,0,10,79,-19,18,-21,1,-62,-12,-5,0,-20,12,-3,0,-16,60,0,-1,18,43,1,96,-34,1,-45,51,0,1,-17,50,0,-1,36,-50,0,0,-17,-49,0,-1,47,-94,31,-47,1,-2,123,-58,1,0,32,-101,1,1,60,-22,13,-29,0,0,125,25,-4,4,18,49,5,1,-17,20,-5,0,20,42,0,7,-27,51,0,-1,27,20,0,15,34,42,1,0,19,35,18,0,-34,-13,0,1,-37,51,0,0,67,22,5,0,-22,26,-1,1,25,-50,0,-1,71,-99,0,-3,-42,-34,75,13,23,-7,17,-29,0,-2,71,-14,0,0,21,-38,3,6,-47,-26,0,0,-17,31,0,-4,-30,-171,2,12,70,18,0,-2,41,-145,24,0,120,31,32,-101,0,0,-16,38,-1,24,-8,-1,-11,-23,0,-10,-21,7,-9,25,0,1,-65,-295,23,1,-120,9,0,0,-9,43,0,-3,-73,-47,20,-2,56,-16,8,-34,-20,-6,-44,-40,0,-7,-10,-21,-4,24,0,0,-23,-42,0,22,-17,-11,0,13,-5,1,-15,18,0,-1,-33,-23,33,-21,1,1,-21,-48,-1,20,-12,-29,0,1,-18,-99,-1],[-933488,436658,99,0,0,71,100,0,-5,-12,-28,0,-20,-14,4,-116,-38,-17,4,16,-35,0,0,-20,-56,-2,3,22,-34,0]]]},{"geoid":"2700730","name":"Albertville","full":"Albertville city","lsad":"city","polygons":[[[-936849,452209,328,-1,1,27,25,8,155,0,2,137,-124,1,0,27,36,0,-4,117,-408,-2,-11,-303]]]},{"geoid":"2700838","name":"Alden","full":"Alden city","lsad":"city","polygons":[[[-935834,436623,199,0,-2,145,-197,0,0,-35]]]},{"geoid":"2700892","name":"Aldrich","full":"Aldrich city","lsad":"city","polygons":[[[-949466,463689,105,-1,0,44,52,-8,0,73,-156,-1,1,-73]]]},{"geoid":"2700928","name":"Alexandria","full":"Alexandria city","lsad":"city","polygons":[[[-954343,458256,23,-6,24,46,26,11,48,5,33,-4,31,-11,17,16,82,-2,0,-33,27,8,-1,25,103,1,0,64,19,17,32,0,0,-9,97,3,0,29,114,-33,1,74,197,0,16,13,-16,21,1,19,19,31,7,61,-24,11,-13,20,-2,16,-13,23,15,41,32,23,42,70,39,18,29,3,36,29,34,6,-3,6,-30,-1,-36,11,-15,19,-14,0,9,12,14,42,28,44,23,11,-17,5,-23,41,-7,36,12,19,28,10,10,11,-12,10,19,25,-9,3,-20,-25,-18,-16,-20,-7,-40,5,-14,19,-19,8,-38,-2,-67,23,-22,-3,-17,10,0,31,13,20,20,18,29,17,-49,-6,-28,11,-17,-24,-28,-13,-48,-12,-48,4,-23,-11,-24,16,21,24,19,38,25,20,28,11,28,1,17,-6,2,14,12,-2,-11,-13,26,-19,-9,42,-52,-6,5,3,-5,3,-46,-4,-13,-18,-11,-5,-25,0,-50,12,27,-17,4,-20,-17,-22,-46,-20,24,-20,13,-17,-2,-20,-9,-13,-31,-16,-18,-3,-10,-11,9,-34,-34,-7,-17,-12,-1,-36,-37,-5,-9,21,-33,-13,2,-23,-37,8,-19,-24,48,-19,74,5,9,-21,-55,1,38,-15,-1,-7,-36,0,-1,-35,-66,0,0,73,-37,1,0,-14,-58,0,25,-7,0,-12,-16,-5,48,-1,-1,-35,-106,0,2,-25,10,-11,94,-1,-1,-15,16,0,-1,-21,37,0,-1,-37,14,0,0,37,18,0,0,6,46,3,0,-9,25,0,1,-72,28,-1,-2,-18,-52,-1,0,-18,-57,-1,-48,-42,-10,11,-37,21,-1,-60,-31,0,-1,Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"MO","state":"Missouri","fips":"29","features":[{"geoid":"2900244","name":"Adrian","full":"Adrian city","lsad":"city","polygons":[[[-943628,383946,20,0,0,-13,78,2,-3,-59,42,0,0,32,101,0,2,-109,102,-1,0,107,73,-1,0,36,-203,3,0,81,-22,45,-9,58,-27,-12,0,-24,-12,0,0,-40,-44,0,-1,-24,-93,-9,-2,-54]]]},{"geoid":"2900262","name":"Advance","full":"Advance city","lsad":"city","polygons":[[[-899277,370944,93,49,1,-19,91,-9,0,13,24,0,0,18,-66,0,0,22,43,-4,20,9,24,-8,0,16,92,-1,0,19,22,0,0,37,-67,0,-3,18,-41,0,0,15,-48,1,0,-32,-91,-1,-5,-36,-88,0]]]},{"geoid":"2900280","name":"Affton","full":"Affton CDP","lsad":"CDP","cdp":true,"polygons":[[[-903578,385629,63,-14,96,-54,-10,-74,-46,-15,33,-66,74,34,38,-7,-5,-34,-42,-34,-35,-14,12,-13,42,-17,112,-23,26,-11,26,-38,79,79,-43,32,-29,2,2,39,49,-4,47,2,1,10,53,-4,34,21,-19,29,-23,16,-55,-1,-9,19,-4,71,87,30,-64,52,-251,28,0,-27,-33,3,4,23,-32,4,-3,-15,-103,2,-1,-15,-38,0,-6,10,-40,-6]]]},{"geoid":"2900298","name":"Agency","full":"Agency village","lsad":"village","polygons":[[[-947877,396897,19,0,-1,-72,-16,-1,2,-71,59,0,1,65,38,0,7,-13,-1,-51,188,-2,-5,-290,139,-1,-1,-55,48,0,0,10,29,8,-14,6,-1,14,25,10,-38,25,0,26,-42,1,0,27,43,0,3,38,25,9,18,18,-22,40,2,27,30,12,-8,31,-18,12,0,25,-73,5,0,-23,-53,0,0,-48,-38,0,5,49,-5,17,-26,25,3,54,-74,1,0,71,-49,1,0,-33,-36,-1,-8,-15,-3,48,-43,2,-2,74,-108,-3]]],"label":[-94.74201290322581,39.66935]},{"geoid":"2900424","name":"Airport Drive","full":"Airport Drive village","lsad":"village","polygons":[[[-945295,371287,228,-6,13,289,-93,3,-6,-94,0,8,-37,6,0,14,-50,0,-2,-76,-46,2]]]},{"geoid":"2900496","name":"Alba","full":"Alba city","lsad":"city","polygons":[[[-944238,372350,28,-9,8,-22,67,0,-1,102,-83,1,-1,-61]]]},{"geoid":"2900514","name":"Albany","full":"Albany city","lsad":"city","polygons":[[[-943515,402488,51,1,0,-108,49,2,0,-37,156,1,-1,34,49,1,3,63,11,11,38,-2,1,110,-47,1,1,12,-113,-1,0,11,-19,-1,0,16,-76,-7,0,-19,-104,0]]]},{"geoid":"2900568","name":"Aldrich","full":"Aldrich village","lsad":"village","polygons":[[[-935545,375475,15,-20,41,3,11,10,2,45,-78,-1]]]},{"geoid":"2900604","name":"Alexandria","full":"Alexandria city","lsad":"city","polygons":[[[-914652,403549,16,-10,42,8,54,25,18,18,-31,70,-26,-18,-70,1]]]},{"geoid":"2900712","name":"Allendale","full":"Allendale village","lsad":"village","polygons":[[[-942961,404799,146,1,-1,108,-140,0]]]},{"geoid":"2900748","name":"Allenville","full":"Allenville village","lsad":"village","polygons":[[[-897574,372188,55,-1,-11,16,11,34,26,25,-45,-18,-9,4,-20,-19,-27,12,-9,-40]]]},{"geoid":"2900802","name":"Alma","full":"Alma city","lsad":"city","polygons":[[[-935513,390911,56,-2,25,25,-17,26,4,58,-66,3]]]},{"geoid":"2900910","name":"Altamont","full":"Altamont village","lsad":"village","polygons":[[[-940924,398826,13,34,110,-1,-17,64,-106,-13,-5,-26]]]},{"geoid":"2900928","name":"Altenburg","full":"Altenburg city","lsad":"city","polygons":[[[-896081,376264,132,2,-1,-53,32,0,0,13,14,0,-2,41,8,-11,90,1,-1,45,139,0,68,87,-37,16,-33,-66,-140,-1,0,27,-44,-1,2,-26,-96,-1,0,-36,-36,0,-8,16,-22,0,0,-19,-26,0,-1,37,-22,0,0,-25,18,-1,-3,-8,-22,0,-10,-13]]]},{"geoid":"2900964","name":"Alton","full":"Alton city","lsad":"city","polygons":[[[-914104,366950,21,0,1,-13,10,0,0,-39,-17,1,-1,-20,42,-1,-16,-9,-38,-48,70,-1,7,16,26,-10,30,20,14,25,34,-29,56,-23,121,-1,2,71,-105,7,-42,20,-21,19,-8,34,-32,1,1,30,15,23,-18,-11,-119,-3,1,-33,-33,-5]]]},{"geoid":"2901018","name":"Amazonia","full":"Amazonia village","lsad":"village","polygons":[[[-949000,398900,48,-34,0,-26,118,0,1,27,-22,8,-50,-1,-4,57,12,18,0,27,-16,-37,-87,-1]]]},{"geoid":"2901054","name":"Amity","full":"Amity town","lsad":"town","polygons":[[[-944386,398644,63,3,5,74,-62,-1,0,-29]]]},{"geoid":"2901072","name":"Amoret","full":"Amoret city","lsad":"city","polygons":[[[-945915,382514,81,-1,1,71,-78,3]]]},{"geoid":"2901090","name":"Amsterdam","full":"Amsterdam city","lsad":"city","polygons":[[[-945940,383420,97,-2,7,148,-104,2]]]},{"geoid":"2901198","name":"Anderson","full":"Anderson city","lsad":"city","polygons":[[[-944805,366475,122,-12,26,8,39,-2,-2,-11,46,-3,3,-45,21,0,6,16,17,16,37,1,23,33,19,10,50,-2,-13,-9,17,-37,-33,0,0,-15,9,-19,61,-12,6,20,-16,27,27,-2,-13,22,0,17,13,7,56,-57,47,-105,42,-62,-3,-16,35,-33,11,4,-19,74,-40,1,-23,34,-39,92,-91,98,15,-5,22,14,17,-7,21,15,17,-13,1,-28,64,-4,3,19,-55,5,-28,23,-8,67,-8,14,-43,0,-3,-32,-43,1,2,91,-15,0,3,28,-27,1,2,-41,-6,-12,-174,5,-4,-48,-26,3,23,-55,48,0,-2,-16,21,-2,-2,-21,15,-9,1,-23,-84,-6,-1,-6,-47,2,-18,-8,-117,11]]]},{"geoid":"2901252","name":"Annada","full":"Annada village","lsad":"village","polygons":[[[-908313,392614,30,0,2,-15,32,0,-29,35,-19,13,-16,1]]]},{"geoid":"2901270","name":"Annapolis","full":"Annapolis city","lsad":"city","polygons":[[[-907043,373566,16,-3,16,12,71,-8,19,6,14,12,-1,19,46,-11,0,25,-90,0,0,16,-30,20,-25,1,-53,-50]]]},{"geoid":"2901288","name":"Anniston","full":"Anniston town","lsad":"town","polygons":[[[-893334,368196,95,0,-1,37,48,0,0,54,-102,0,0,-18,-37Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"MP","state":"Commonwealth of the Northern Mariana Islands","fips":"69","features":[{"geoid":"6900300","name":"Achugao","full":"Achugao village","lsad":"village","polygons":[[[1457618,152421,21,-30,77,50,-33,36,-70,-33]]]},{"geoid":"6900400","name":"Afatung","full":"Afatung village","lsad":"village","polygons":[[[1452061,141198,51,-1,10,28,37,30,4,18,18,-2,14,15,9,0,21,28,1,32,16,39,-74,4,-5,29,-13,2,-20,-1,0,-16,-29,-8,-41,13,-13,-5,10,0,16,-25,24,-3,1,-55,-56,-94]]]},{"geoid":"6900450","name":"Afetnas","full":"Afetnas village","lsad":"village","polygons":[[[1456949,151221,16,-14,9,34,69,22,-69,73,-32,-78]]]},{"geoid":"6900500","name":"Agatasi (Payapai)","full":"Agatasi (Payapai) village","lsad":"village","polygons":[[[1452093,141163,32,-10,26,13,19,22,18,13,17,44,10,15,25,16,10,-1,41,22,18,16,-1,10,-14,11,-4,9,7,49,-4,-8,-51,1,-5,-19,-11,-20,-1,-32,-14,-13,-7,-15,-9,0,-14,-15,-18,2,-4,-18,-37,-30,-3,-18,-7,-10,-11,-35,-5,2]]]},{"geoid":"6900600","name":"Agingan","full":"Agingan village","lsad":"village","polygons":[[[1456905,151195,62,-16,83,-56,21,-22,1,-32,7,-8,36,60,-74,53,-19,43,-45,-15,-28,19,-10,25,-3,-17,-35,-27]]]},{"geoid":"6901100","name":"Agrihan","full":"Agrihan village","lsad":"village","polygons":[[[1456391,187716,-11,-61,38,-72,-11,-44,21,-27,23,-6,28,-58,33,-42,5,-37,30,-30,42,-14,38,-35,48,-26,26,11,8,47,55,55,19,7,16,-8,48,11,13,-10,46,31,22,53,0,20,-13,17,9,24,0,45,33,30,30,0,8,27,-17,105,3,78,-17,29,-4,24,6,34,-9,22,-31,16,-19,25,-28,-4,-59,64,-15,29,-26,20,-80,19,-27,-5,-22,11,-3,20,-35,17,-75,-21,-40,-42,-9,-53,-70,-62,3,-20,-10,-8,-5,-18,5,-35,-30,-32,-1,-42,-17,-22]]]},{"geoid":"6901150","name":"Aguijan","full":"Aguijan village","lsad":"village","polygons":[[[1455394,148418,61,-14,100,36,38,5,32,-5,25,11,92,66,10,19,17,6,20,63,-6,26,-11,18,-41,12,-35,-18,-23,0,-32,-28,-62,-14,-73,-37,-52,-11,-47,-24,-18,-28,-15,-45]]]},{"geoid":"6901170","name":"Agusan","full":"Agusan village","lsad":"village","polygons":[[[1452230,141857,57,17,42,43,-11,44,-114,-60,-5,-31]]]},{"geoid":"6901200","name":"Alaguan","full":"Alaguan village","lsad":"village","polygons":[[[1452242,141385,51,-1,8,26,26,20,19,31,30,20,-57,35,-7,-9,-11,3,-14,-44,-38,-35,1,-32]]]},{"geoid":"6901220","name":"Alamagan","full":"Alamagan village","lsad":"village","polygons":[[[1458146,176020,13,-102,25,-32,40,-22,29,-54,38,-11,102,4,32,47,63,43,17,25,12,59,-5,41,-31,69,-28,37,-26,6,-27,21,-20,41,-57,11,-87,-23,-23,-21,-6,-42,-57,-77]]]},{"geoid":"6901250","name":"American Memorial Park","full":"American Memorial Park village","lsad":"village","polygons":[[[1457162,152177,81,-52,51,44,-6,13,-33,-12,-36,-1,-11,8,-5,17,-32,-2]]]},{"geoid":"6901280","name":"Anatahan","full":"Anatahan village","lsad":"village","polygons":[[[1456327,163632,18,-27,-14,-83,5,-21,21,-3,11,-18,21,-82,8,-7,43,-4,18,-20,14,-42,17,0,51,27,16,-3,14,9,32,-3,26,-28,30,24,28,0,30,-11,19,10,32,-1,13,-9,27,-1,76,1,66,10,16,-13,60,-2,39,19,79,23,32,46,12,6,13,58,38,25,-11,81,-113,81,-21,-1,-58,24,-237,-19,-162,26,-27,-8,-30,8,-54,-9,-41,11,-34,-17,-23,-2,-41,11,-26,-5,-33,-28]]]},{"geoid":"6901300","name":"Annex F","full":"Annex F village","lsad":"village","polygons":[[[1451515,141379,-17,4,0,22,-9,10,-20,-4,-10,-21]]]},{"geoid":"6901350","name":"Apanon","full":"Apanon village","lsad":"village","polygons":[[[1451699,141106,58,5,32,36,52,15,60,-15,50,5,0,9,-63,2,-8,14,-6,-11,-15,13,-49,-23,-72,-21,-31,4,-28,-26]]],"label":[145.17754365079367,14.1143]},{"geoid":"6901400","name":"As Akina","full":"As Akina village","lsad":"village","polygons":[[[1457502,152266,61,-20,23,-29,55,-2,162,139,-87,87,-111,-69,-92,-72,-18,-24]]]},{"geoid":"6901450","name":"As Akoddo","full":"As Akoddo village","lsad":"village","polygons":[[[1451561,141499,40,5,28,-13,40,13,86,-5,84,39,-3,79,-36,-31,-147,-42,-55,5,-40,-25]]]},{"geoid":"6901500","name":"As Dudo","full":"As Dudo village","lsad":"village","polygons":[[[1452740,141750,15,-7,-12,-21,98,-70,2,102,28,60,-104,12,-16,-15]]]},{"geoid":"6901600","name":"As Falipe","full":"As Falipe village","lsad":"village","polygons":[[[1457292,151879,-7,-26,132,2,5,142,-90,9,-30,-32,-17,-42]]]},{"geoid":"6901650","name":"As Gonna","full":"As Gonna village","lsad":"village","polygons":[[[1457055,151163,60,-42,27,12,27,45,21,9,11,22,-11,2,5,30,-18,42,-78,-32,-1,-21,-9,-8,18,-37,-42,-11]]]},{"geoid":"6901700","name":"As Lito","full":"As Lito village","lsad":"village","polygons":[[[1457177,151283,18,-42,-5,-30,24,-1,47,79,19,8,5,55,-23,0,-23,11,-12,-7,-19,24,-6,-15,-78,-62]]]},{"geoid":"6901750","name":"As Mahetog","full":"As Mahetog village","lsad":"village","polygons":[[[1457480,152289,15,-13,57,55,87,60,-21,35,-56,-31,-77,-98]]]},{"geoid":"6901800","name":"As Matuis","full":"As Matuis village","lsad":"village","polygons":[[[1457829,152487,-20,-21,37,2,48,40,14,26,-1,6,-77,-4,-17,6,-8,-9]]]},{"geoid":"6901850","name":"As Niebes (Nieves)","full":"As Niebes (Nieves) village","lsad":"village","polygons":[[[1452516,141680,43,-1,-2,-62,63,-5,84,11,41,Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"MS","state":"Mississippi","fips":"28","features":[{"geoid":"2800100","name":"Abbeville","full":"Abbeville town","lsad":"town","polygons":[[[-895185,344886,309,6,9,286,-313,0,2,-131,29,2,-6,-21,12,2,-5,-34,-41,5]]]},{"geoid":"2800180","name":"Aberdeen","full":"Aberdeen city","lsad":"city","polygons":[[[-886002,338544,45,1,-1,-114,-20,0,3,-21,32,0,-6,-75,8,-4,-3,-75,66,-1,-1,-28,36,-54,21,-16,81,-24,-1,-13,125,0,6,-38,41,0,-1,-35,44,-5,-2,-72,31,0,72,65,45,44,5,36,150,0,-1,-62,41,-12,63,-40,58,2,-47,59,-45,105,98,13,114,-26,-6,17,-56,19,-73,5,-21,9,-18,-12,-44,-4,-5,26,17,2,-16,16,0,14,15,27,55,33,10,19,4,49,13,28,-10,31,-12,-15,7,-6,-137,3,-2,-19,-34,19,1,9,-174,3,20,-33,-16,-6,-8,-20,-9,3,-8,-25,-20,-4,-13,7,-8,26,-24,10,-2,22,7,17,-15,14,-28,-11,-7,5,1,28,-19,23,-17,-5,-7,-21,-17,2,-29,61,-43,-16,-24,4,29,30,-1,8,-20,-7,-7,6,-153,1,-1,53,-86,0,-5,-11,-41,11]]]},{"geoid":"2800300","name":"Ackerman","full":"Ackerman town","lsad":"town","polygons":[[[-891838,333003,260,1,-1,217,-87,0,5,46,-48,-32,0,-14,-130,-1]]]},{"geoid":"2800460","name":"Agricola","full":"Agricola CDP","lsad":"CDP","cdp":true,"polygons":[[[-885324,308008,147,1,2,36,35,-4,9,30,16,6,-25,14,-3,13,-22,13,34,1,-1,109,-142,-2,0,10,-30,-1,0,-190,-20,0]]]},{"geoid":"2800680","name":"Alcorn State University","full":"Alcorn State University CDP","lsad":"CDP","cdp":true,"polygons":[[[-911513,318827,1,-151,254,-13,-14,20,4,10,-37,132,-1,17,22,54,-131,13,11,11,-16,31,0,35,-63,21,-39,-175]]]},{"geoid":"2800820","name":"Algoma","full":"Algoma town","lsad":"town","polygons":[[[-890628,341553,109,0,-2,61,441,3,-7,292,-180,-1,0,114,-263,-3,6,-365,-87,0,-3,-72]]]},{"geoid":"2800940","name":"Alligator","full":"Alligator town","lsad":"town","polygons":[[[-907297,340830,132,-3,0,-28,19,0,4,19,-14,11,37,-1,2,145,-177,2]]]},{"geoid":"2801260","name":"Amory","full":"Amory city","lsad":"city","polygons":[[[-885131,339801,-1,-312,338,11,14,171,5,30,10,6,90,4,3,-45,24,-4,-16,-23,117,5,16,9,20,-10,85,0,-2,283,-130,-3,-3,51,-41,-1,-1,34,-50,-2,0,138,11,12,-22,9,-7,19,-16,-15,-36,-9,-106,-4,-73,-54,-6,11,-67,-49,-42,-52,-134,-114,-39,-50,-15,-35]]]},{"geoid":"2801500","name":"Anguilla","full":"Anguilla town","lsad":"town","polygons":[[[-908397,329651,207,4,1,143,-177,-3,40,-18,6,-13,-14,-17,-64,-16]]]},{"geoid":"2801820","name":"Arcola","full":"Arcola town","lsad":"town","polygons":[[[-908850,332698,15,1,11,-37,54,5,11,81,-35,-1,2,-16,-59,-1]]]},{"geoid":"2801940","name":"Arkabutla","full":"Arkabutla CDP","lsad":"CDP","cdp":true,"polygons":[[[-901389,347063,-2,-38,15,-33,9,0,3,-72,-42,0,-1,-67,222,-6,117,5,9,122,13,48,40,18,-2,29,14,14,-7,56,-362,-1,-5,15,-24,19,-30,0]]]},{"geoid":"2802060","name":"Arnold Line","full":"Arnold Line CDP","lsad":"CDP","cdp":true,"polygons":[[[-893985,313385,17,-2,-1,-46,65,0,-1,-17,124,13,2,-14,251,2,1,54,-302,64,-31,1,0,-10,-130,-1]]]},{"geoid":"2802100","name":"Artesia","full":"Artesia town","lsad":"town","polygons":[[[-886492,334113,46,0,0,-55,27,0,-2,11,15,0,0,-13,30,0,0,-16,13,0,0,221,-131,-3]]]},{"geoid":"2802140","name":"Ashland","full":"Ashland town","lsad":"town","polygons":[[[-891915,348257,55,-1,0,-11,209,-1,-5,170,-88,2,0,43,-121,0,-46,-188]]]},{"geoid":"2802380","name":"Austin","full":"Austin CDP","lsad":"CDP","cdp":true,"polygons":[[[-904514,346402,18,-3,50,8,-12,21,1,26,-23,0,-5,-13,-25,-14,-4,-19]]]},{"geoid":"2802700","name":"Baldwyn","full":"Baldwyn city","lsad":"city","polygons":[[[-886655,345296,-6,-374,40,-5,-11,-220,90,8,26,44,33,6,-1,28,312,0,-1,287,86,1,6,59,-96,0,1,60,-41,0,-1,109,43,0,2,79,-488,4,1,-19]]]},{"geoid":"2803580","name":"Bassfield","full":"Bassfield town","lsad":"town","polygons":[[[-897619,314776,58,1,0,37,-16,0,22,86,32,19,42,13,-1,-9,174,-3,-1,77,-83,0,0,35,-121,1,10,36,-7,0,-13,-24,-37,0,0,-48,44,-1,0,-36,35,0,0,-25,-38,-13,-31,0,-20,-12,0,-18,11,6,-23,-84,-37,0]]]},{"geoid":"2803620","name":"Batesville","full":"Batesville city","lsad":"city","polygons":[[[-899867,342998,167,44,0,-87,69,0,-8,-89,9,-63,139,-1,-1,80,192,1,19,-8,33,-68,-18,-2,3,-26,40,1,3,27,177,2,-3,50,160,0,-2,205,66,0,0,72,-34,0,-1,108,1,6,41,0,3,68,-8,76,-40,-1,-5,62,-22,-3,-2,55,-159,2,-38,73,-112,-4,3,-45,-10,-19,-48,0,0,-32,-83,-83,-48,0,-18,-77,-70,-1,-6,-32,-100,0,-1,32,-69,-18,-4,-12,-20,-1,-1,-41,-28,-1,-2,-124,-127,-1,0,-65,-36,1,-1,-37]]]},{"geoid":"2803940","name":"Baxterville","full":"Baxterville CDP","lsad":"CDP","cdp":true,"polygons":[[[-896046,310963,16,-93,42,1,10,-15,0,-63,-38,-42,-24,-47,3,-15,320,-1,-6,33,6,40,-58,32,0,51,-16,28,63,30,-272,151,4,-40,24,-35,-86,1]]]},{"geoid":"2803980","name":"Bay St. Louis","full":"Bay St. Louis city","lsad":"city","polygons":[[[-894342,303495,89,1,-23,-48,-35,-1,1,-67,10,-27,23,-47,14,-14,-8,-4,20,-28,2,-20,17,-18,41,-2,25,-15,-4,-13,24,7,12,-5,0,-16,37,-4,25,-13,5,6,36,-20,238,-42,-1,-17,71,-6,49,17,-9,-89,85,-22,-1,-16,67,-3,81,-29,152,89,74,120,2,44,-40,59,-33,12,-12,68,-17,47,-63,51,-71,6,-147,-69,-58,0,-60,-33,-29,23,-175,5,-39,22,-48,50,-21,47,4,48,35,70,17,12,1,17Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"MT","state":"Montana","fips":"30","features":[{"geoid":"3000175","name":"Absarokee","full":"Absarokee CDP","lsad":"CDP","cdp":true,"polygons":[[[-1094694,455217,141,6,63,16,16,-2,-25,-43,2,-11,-71,-64,10,-19,-7,-52,15,-28,9,-2,3,18,51,2,2,34,26,44,26,15,26,42,18,7,28,36,-1,9,81,82,70,50,-13,14,-53,-12,-36,5,-68,-24,-28,3,-14,14,-18,3,-22,-14,-86,-11,-53,-23,-32,-4,-33,-20,-28,-3]]]},{"geoid":"3000400","name":"Acton","full":"Acton CDP","lsad":"CDP","cdp":true,"polygons":[[[-1086845,459325,6,-70,105,0,0,73,-44,-13,-8,13,-53,-2]]]},{"geoid":"3000700","name":"Alberton","full":"Alberton town","lsad":"town","polygons":[[[-1144938,470037,77,-45,74,10,75,-3,40,-11,0,59,-106,1,0,18,-53,0,0,25,-107,0]]]},{"geoid":"3000850","name":"Alder","full":"Alder CDP","lsad":"CDP","cdp":true,"polygons":[[[-1121193,453412,1,-9,-33,-4,30,-10,7,-22,-30,9,-6,-9,14,-19,-10,-25,11,-2,-14,-18,8,-9,15,6,3,-18,37,2,-6,-41,19,0,-16,-21,29,-19,-35,-1,-6,-28,6,-19,68,-29,1,-25,-9,-14,9,-29,10,-1,40,-34,23,-52,-10,-3,14,-22,-10,-16,20,-15,10,-25,-1,15,22,21,0,24,-16,6,1,27,-15,-1,-8,71,133,0,-54,1,-24,18,0,23,-24,31,0,67,-42,6,59,3,-1,20,-60,1,0,22,-9,-1,-1,31,-47,63,1,44,-18,12,-30,39,-8,27,-92,-3,1,-27,11,7,16,-6,-28,-13]]]},{"geoid":"3001300","name":"Alzada","full":"Alzada CDP","lsad":"CDP","cdp":true,"polygons":[[[-1044221,450176,42,-24,14,11,45,-13,18,-30,11,16,-2,44,59,-6,17,19,-71,42,-15,20,19,20,-71,-1,-16,8,3,-44,-33,-4,6,-38,-24,1]]]},{"geoid":"3001525","name":"Amsterdam","full":"Amsterdam CDP","lsad":"CDP","cdp":true,"polygons":[[[-1113525,457277,94,23,29,-2,-6,-6,33,-24,6,-21,46,-36,17,-4,0,-23,44,1,5,34,-36,20,-8,45,15,21,5,30,27,24,-4,23,13,23,52,30,29,0,-1,23,-10,15,-5,97,36,1,0,11,-58,20,18,44,22,28,-12,9,5,31,16,13,-53,5,-5,-45,-95,-25,-41,-15,-11,-13,3,-68,-23,-20,23,5,-1,-18,14,-9,-11,-11,7,-12,-78,-21,-44,-20,8,-14,35,10,33,0,25,-8,-1,-10,-39,-28,-84,-41,26,0,4,-8,27,5,5,-18,-18,-22,1,-9,-44,-24,-34,-5,-21,-23]]]},{"geoid":"3001675","name":"Anaconda-Deer Lodge County","full":"Anaconda-Deer Lodge County","polygons":[[[-1135161,459388,121,27,85,-53,108,-253,139,-131,36,-75,-8,-43,29,-49,84,-54,-30,-42,45,-16,43,-49,-4,-18,100,-77,31,-106,-20,-55,75,-25,-2,-50,35,-13,-28,-43,39,-39,8,-82,-43,-7,3,-40,-36,-27,32,-22,-1,-39,119,-124,115,-54,-2,-19,23,-3,25,-45,63,-49,8,-36,249,-90,91,-7,15,36,-30,94,110,133,7,99,54,104,61,21,24,21,-9,20,67,26,97,-25,20,-29,130,-16,101,122,39,21,48,-3,27,-35,114,11,254,216,-50,60,21,39,141,39,62,61,38,70,153,88,49,11,117,-18,78,31,93,73,217,3,180,-31,115,12,283,-17,33,-42,43,-11,20,-39,31,-5,21,-114,247,91,81,-27,70,19,105,-6,111,31,44,73,44,20,17,32,172,80,63,-17,66,23,12,46,170,84,-35,79,86,92,120,29,86,-17,115,39,8,53,41,18,-21,77,-70,105,3,100,-64,54,27,39,-27,42,13,48,-48,55,29,62,112,43,50,75,142,-44,70,-8,97,19,79,-34,60,13,-5,23,104,86,-31,62,26,23,-15,94,45,71,72,26,56,105,751,-1,6,875,961,-1,15,48,120,47,113,77,70,93,-2,20,93,101,182,-11,8,-30,59,-48,49,38,54,10,42,-44,63,-6,5,61,168,77,5,53,-28,20,17,40,-44,84,40,34,45,97,-7,30,-49,61,-136,45,-16,26,17,43,-52,46,182,49,73,60,8,35,109,98,21,47,-4782,10,0,-435,-2477,-5,-5,-870,106,0,0,-765,-63,-29,27,-111,-56,-29,-18,-43,-106,-68,-63,-16,-22,-31,-57,-13,-63,-64,-117,-34,-72,-98,-173,46,-108,-28,-148,110,-184,-42,23,-69,-49,-69,-118,-8,-40,-99,-144,-43,-56,7,-67,-52,-164,33,-45,-64,2,-34,-56,-31,0,-30,85,-58,-36,-64,-82,-30,-88,-135,-196,87,-47,0,-40,-39,-56,6,-27,-30]]]},{"geoid":"3002050","name":"Antelope","full":"Antelope CDP","lsad":"CDP","cdp":true,"polygons":[[[-1044593,486868,97,-7,1,73,-82,0]]]},{"geoid":"3002350","name":"Argenta","full":"Argenta CDP","lsad":"CDP","cdp":true,"polygons":[[[-1128713,452794,52,0,0,-20,29,4,33,-21,19,-1,35,-20,0,19,39,-1,0,34,-178,36,-29,16]]]},{"geoid":"3002425","name":"Arlee","full":"Arlee CDP","lsad":"CDP","cdp":true,"polygons":[[[-1141285,471967,229,-323,-2,-16,144,-181,90,39,2,13,-16,19,18,-2,100,-80,14,-25,36,-28,68,0,1,103,-161,78,1,36,203,-1,166,-38,56,7,57,-12,97,-2,-70,26,8,12,-39,15,0,29,-132,0,-114,13,-74,23,2,74,-207,-2,-12,11,-91,32,-10,30,165,0,0,72,-269,1,9,-86,-48,61,-3,37,-22,-2,-10,-10,-46,8,-44,32,-6,15,-18,-3,-8,28,5,11,-48,29,5,12,-35,23]]]},{"geoid":"3002800","name":"Ashland","full":"Ashland CDP","lsad":"CDP","cdp":true,"polygons":[[[-1063446,456268,21,-23,21,-5,34,-31,-8,-82,-23,-36,-30,-17,190,-59,-5,-16,-19,-8,-89,19,-5,-22,59,-107,69,-48,-109,15,-29,-24,-3,-17,-32,-37,1,-52,-17,-2,-6,-18,0,-41,8,-10,-10,-13,51,-19,178,-35,172,2,-27,-58,12,-21,67,-20,22,34,-26,21,25,7,42,-9,1,23,40,-10,-5,19,-26,15,-6,23,54,0,21,16,45,-3,21,19,31,10,5,31,77,-3,9,134,48,-13,10,20,38,5,-8,16,10,19,-23,1,22,22,88,-19,-19,34,34,52,-3,20,20,43,7,48,-8,21,-28,26,19,1,27,22,-15,12,-6,21,-63,13,-1,9,-24,14,-29,0,-26,-16,-14,10,-17,-6,-2,10,-17,-11,-20,3,-39,-9,-8,-11,-17,13,-37,71,3,75,-9,20,-18,-10,-105,-17,-22,8,-23,-29,-10,0,-9,27,12,97,-58,1,-36,-12,-35,4,-108,-21,-105,-47,-57,-17,-108,-2,-48,-45]]]},{"geoid":"3003025","name":"Augusta","full":"Augusta CDP","lsad":"CDP","cdp":true,"polygLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"NC","state":"North Carolina","fips":"37","features":[{"geoid":"3700160","name":"Aberdeen","full":"Aberdeen town","lsad":"town","polygons":[[[-794825,351615,-1,14,11,-27,86,8,0,-9,14,0,3,-48,-19,0,-1,11,-58,-2,-1,30,-35,-17,14,-56,45,6,21,-23,-69,-29,12,-19,-45,-20,8,-13,22,0,59,-53,13,2,17,21,12,36,49,-1,8,21,48,-9,-26,-43,-19,8,2,-21,-18,2,30,-32,30,-5,26,-19,38,-8,-6,-22,16,-25,56,15,54,-9,18,27,-8,-24,39,-9,-7,-17,10,-7,12,14,-13,9,6,9,46,-20,-17,-2,-6,-9,0,10,-28,-15,11,-20,-7,-29,21,22,2,19,20,-3,15,22,73,-34,1,-32,-25,-7,0,-19,63,-9,-1,-7,-45,7,-2,-13,-37,-7,1,24,-33,-1,-4,-23,13,-7,41,-2,-1,-32,64,-4,55,-22,-14,-24,-55,25,-49,-71,-8,-43,-26,1,3,-30,21,-7,-2,-40,93,-3,16,25,58,-4,79,67,-29,13,13,84,-15,14,48,12,16,12,8,-6,28,37,-58,22,-6,-9,-16,41,-9,-6,-33,28,-29,-20,-20,13,-19,-8,-14,20,-18,9,1,13,7,-13,54,-17,-5,17,-15,0,7,22,37,-1,18,11,-12,16,21,-2,5,6,66,-19,7,15,47,3,17,28,-13,2,0,13,-82,0,-7,52,-53,5,6,10,20,-2,1,9,-85,16,32,22,1,32,18,13,26,-5,33,28,8,0,9,-17,13,3,-10,-23,43,-16,18,39,-35,21,-3,18,-40,-1,15,26,-6,62,-14,4,12,27,-17,10,-42,-6,-7,-10,42,-33,-28,-15,-17,-23,-29,11,-2,11,-9,-13,-29,14,-5,16,-22,-21,-4,9,-30,-8,15,22,-12,10,-16,1,-18,-6,2,-28,-34,0,-7,-34,-60,-14,-21,13,-149,8,-1,17,-74,-7,-50,5,-14,102,-188,-29]]]},{"geoid":"3700440","name":"Advance","full":"Advance CDP","lsad":"CDP","cdp":true,"polygons":[[[-804360,359492,74,-9,-16,-44,-29,-30,-3,-17,18,-34,1,-35,24,-18,42,-13,166,-15,26,-33,5,36,20,-5,23,6,8,14,17,2,33,-15,11,38,40,33,51,-16,10,-21,20,15,20,-1,24,13,9,20,24,7,-14,44,14,117,-11,35,-27,56,-36,26,-37,14,-52,-42,-3,-18,-55,-7,-40,-15,2,50,-12,32,-17,2,-9,17,7,17,-14,10,-23,-1,-19,-20,1,-36,-8,-12,-62,-5,-17,14,-20,-58,-12,-8,-7,38,-81,0,-5,-14,-26,-12,-17,-79]]]},{"geoid":"3700500","name":"Ahoskie","full":"Ahoskie town","lsad":"town","polygons":[[[-770087,362979,15,14,22,-14,-3,-16,11,-4,6,12,16,-8,-19,-35,18,-7,-20,-45,-29,4,7,-15,24,-17,17,-31,-14,-4,-6,-31,10,-4,39,20,21,-15,4,-18,19,-19,35,43,48,-25,-12,-57,-15,-6,23,-16,32,54,11,-5,-9,-19,17,-5,11,17,-8,4,18,-3,71,-36,-6,-8,33,-10,11,-12,-16,-8,11,-14,33,11,-9,18,15,6,6,-11,27,13,4,31,56,-19,0,11,26,1,3,-20,7,20,15,2,-47,9,5,37,-16,1,-9,-41,-97,8,-7,12,4,17,-57,43,-21,92,95,30,12,13,72,9,-54,35,8,13,16,-15,28,2,-4,16,37,12,-19,17,-28,0,-3,-18,-36,-5,-11,-11,8,-7,-12,-9,-20,11,-25,-21,-3,-20,-65,45,-106,-2,-1,17,-73,2,-50,-8,-41,5,0,76,-16,8,-26,-7,6,-51,-28,3,-9,-34]],[[-770216,362644,29,-46,143,52,-9,17,14,31,-36,11,-9,-9,-34,27,15,20,-27,3,-33,-36,-45,-22,-15,-19]]]},{"geoid":"3700640","name":"Alamance","full":"Alamance village","lsad":"village","polygons":[[[-794944,360181,28,5,-1,13,15,4,-1,29,35,12,38,1,-2,17,11,0,4,-24,19,7,-2,29,-17,-11,-1,23,-14,5,0,14,45,12,-6,16,-29,6,-2,25,-29,27,-26,10,-7,-11,15,-19,-7,-7,-77,-38,42,-4,-8,-25,-83,-45]]]},{"geoid":"3700680","name":"Albemarle","full":"Albemarle city","lsad":"city","polygons":[[[-802463,353360,34,-4,20,-31,26,3,-21,42,14,-6,23,9,30,-30,-2,-14,22,19,5,-25,-18,-1,-4,-7,-10,5,-5,-5,10,-10,46,4,20,18,-11,5,60,5,10,-11,12,7,20,-21,15,46,18,-12,9,-12,-22,-45,-16,7,-4,-53,-48,-33,-9,-20,43,-21,0,21,51,45,12,2,13,-31,40,2,2,21,-25,9,-14,27,-26,14,12,16,14,-17,30,-5,3,20,24,-16,54,11,43,-33,66,-2,45,-10,-21,28,-47,16,-15,24,-43,1,-1,-11,-27,-1,19,67,19,7,23,-38,13,4,22,-49,40,-17,18,-21,-16,24,-39,16,-33,69,35,15,45,-43,3,-11,11,14,-11,47,53,0,-2,-47,12,-36,-34,-8,30,-42,11,8,85,14,18,10,-23,24,13,38,-20,14,7,23,41,-4,27,-37,22,9,17,-29,13,10,-5,34,7,12,74,10,8,10,56,-8,-9,24,-25,-5,16,29,35,7,-79,13,-2,41,20,-1,-1,73,-32,-9,-2,65,69,19,57,-11,18,4,-3,35,33,14,-6,14,-24,-13,-5,18,-34,-10,6,-26,-43,-9,-15,-14,-22,6,-34,-14,-11,40,-39,29,-4,21,-44,0,-32,36,-11,-3,-35,22,-46,-29,0,32,-19,3,-1,-15,-78,3,29,34,-18,60,46,9,-8,24,13,13,-11,9,32,-3,-4,24,-9,10,-45,-33,1,25,-24,33,15,6,6,26,-34,-8,-12,49,-27,11,-10,25,-63,0,5,-20,-115,-9,-15,-32,-53,-64,-15,-37,45,-71,16,-40,65,-77,-35,-9,-19,20,-15,0,11,-12,-31,-22,-239,-120,-64,144,2,-35,25,-42,12,-37,-3,-11,11,-19,-19,-4,-15,-16,6,-10,-6,-28,24,-49,12,12,-7,8,40,20,9,-11,-12,-13,16,-9,6,18,31,-8,16,-20,32,22,13,-5,-3,-11,-22,-2,1,-20,-168,-43,-4,-42,-25,1]],[[-801498,352978,33,5,6,11,17,-22,24,-3,10,20,1,45,-36,2,0,10,35,27,-25,38,-31,-17,-29,16,25,32,0,44,-53,-51,9,-27,-64,-33]]]},{"geoid":"3700880","name":"Alexis","full":"Alexis CDP","lsad":"CDP","cdp":true,"polygons":[[[-811332,353967,13,2,0,-55,60,-62,274,59,5,16,-43,5,-67,49,-2,43,11,4,-33,44,-183,7,-17,-34,-10,-65]]]},{"geoid":"3701000","name":"Alliance","full":"Alliance town","lsad":"town","polygons":[[[-768317,351337,91,-10,24,15,15,0,38,61,81,38,33,-12,35,-44,44,-28,16,2,59,-19,41,111,-78,6,2,20,-64,6,2,10,-38,5,9,22,-8,27,-39,3,0,-7,-48,-5,1,-10,-55,-8,-8,20,-14,-4,15,-46,-40,-9,-80,33,45,-66,-59,-12,8,-25,28,-2,2,-11,-21,-2,1,-25,-24,4]]]},{"geoid":"3701140","name":"Altamahaw","full":"Altamahaw CDP","lsad":"CDP","cdp":true,"polygons":[[[-795133,361760,23,-25,46,-32,25,10,44,-25,-12,30,-38,45,4,24,20,-5,72,26,-44,43,3,28,25,24,-24,72,-102,84,8,-41,Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"ND","state":"North Dakota","fips":"38","features":[{"geoid":"3800100","name":"Abercrombie","full":"Abercrombie city","lsad":"city","polygons":[[[-967372,464462,13,0,0,-43,52,0,1,36,12,5,90,-4,-2,-16,28,-7,10,30,-30,3,-19,17,5,7,-41,2,-1,10,-68,0,-15,25,-22,0,0,-36,-13,1]]]},{"geoid":"3800340","name":"Adams","full":"Adams city","lsad":"city","polygons":[[[-980844,484129,214,0,3,145,-217,1]]]},{"geoid":"3800940","name":"Alamo","full":"Alamo city","lsad":"city","polygons":[[[-1034750,485756,137,0,1,145,-110,0,0,-57,-28,-15]]]},{"geoid":"3801180","name":"Alexander","full":"Alexander city","lsad":"city","polygons":[[[-1036533,478303,216,0,-2,181,-215,0]]]},{"geoid":"3801420","name":"Alice","full":"Alice city","lsad":"city","polygons":[[[-975665,467528,205,0,0,144,-206,1]]]},{"geoid":"3801700","name":"Almont","full":"Almont city","lsad":"city","polygons":[[[-1015201,467175,367,-1,-1,72,-52,0,0,73,52,0,0,72,-369,1]]]},{"geoid":"3801740","name":"Alsen","full":"Alsen city","lsad":"city","polygons":[[[-987751,486018,654,0,2,-290,214,0,0,145,218,0,0,145,216,-1,1,724,-653,1,1,-145,-655,0]]]},{"geoid":"3801860","name":"Ambrose","full":"Ambrose city","lsad":"city","polygons":[[[-1034924,489486,221,1,2,145,-222,-1]]]},{"geoid":"3801940","name":"Amenia","full":"Amenia city","lsad":"city","polygons":[[[-972400,469995,317,-3,-1,145,-316,1]]]},{"geoid":"3802060","name":"Amidon","full":"Amidon city","lsad":"city","polygons":[[[-1033279,464752,131,0,0,72,28,0,10,72,-104,0,0,-36,-52,0,0,-25]]]},{"geoid":"3802220","name":"Anamoose","full":"Anamoose city","lsad":"city","polygons":[[[-1002518,478800,53,0,0,-36,110,0,20,36,32,0,0,36,-53,0,0,36,-55,0,0,36,-53,0,-1,-36,-53,-1]]]},{"geoid":"3802380","name":"Aneta","full":"Aneta city","lsad":"city","polygons":[[[-980005,476723,215,0,0,145,-214,0]]]},{"geoid":"3802660","name":"Antler","full":"Antler city","lsad":"city","polygons":[[[-1012891,489701,110,-28,-1,68,-110,0]]]},{"geoid":"3802820","name":"Apple Valley","full":"Apple Valley CDP","lsad":"CDP","cdp":true,"polygons":[[[-1006046,468171,8,1,-7,31,19,0,35,-26,44,13,0,45,-98,-5,-6,-35]]]},{"geoid":"3802860","name":"Ardoch","full":"Ardoch city","lsad":"city","polygons":[[[-973461,482019,162,-2,0,73,-162,1]]]},{"geoid":"3803020","name":"Argusville","full":"Argusville city","lsad":"city","polygons":[[[-969642,470354,421,0,0,290,-419,4]]]},{"geoid":"3803220","name":"Arnegard","full":"Arnegard city","lsad":"city","polygons":[[[-1034703,478049,369,-1,0,73,-108,0,1,-70,-145,1,-17,22,-100,-18]]]},{"geoid":"3803300","name":"Arthur","full":"Arthur city","lsad":"city","polygons":[[[-972291,470935,115,0,0,-19,16,0,0,19,81,0,0,73,52,0,-16,9,-36,1,0,135,-212,0]]]},{"geoid":"3803540","name":"Ashley","full":"Ashley city","lsad":"city","polygons":[[[-993830,460317,42,14,-3,-60,105,0,9,66,28,7,-10,12,-1,62,-128,-1,-1,-51,-44,0]]]},{"geoid":"3803740","name":"Auburn","full":"Auburn CDP","lsad":"CDP","cdp":true,"polygons":[[[-974478,484993,218,0,1,145,-218,1]]]},{"geoid":"3804020","name":"Ayr","full":"Ayr city","lsad":"city","polygons":[[[-974940,470390,61,0,1,42,-62,0]]]},{"geoid":"3804460","name":"Balfour","full":"Balfour city","lsad":"city","polygons":[[[-1005424,479455,162,0,0,109,-161,0]]]},{"geoid":"3804580","name":"Balta","full":"Balta city","lsad":"city","polygons":[[[-1000424,481632,110,-3,0,73,-110,0]]]},{"geoid":"3804740","name":"Bantry","full":"Bantry CDP","lsad":"CDP","cdp":true,"polygons":[[[-1006250,484874,219,0,-5,69,7,16,-81,59,-140,1]]]},{"geoid":"3804940","name":"Barney","full":"Barney city","lsad":"city","polygons":[[[-970031,462674,12,0,0,-58,65,0,1,81,-77,1]]]},{"geoid":"3805220","name":"Barton","full":"Barton CDP","lsad":"CDP","cdp":true,"polygons":[[[-1001726,485028,49,-11,0,121,-28,19,-38,0,-87,-54]]]},{"geoid":"3805260","name":"Bathgate","full":"Bathgate city","lsad":"city","polygons":[[[-974789,488752,32,0,0,17,83,5,-6,68,-80,-1,-15,10,-14,-10,0,-73]]]},{"geoid":"3805420","name":"Beach","full":"Beach city","lsad":"city","polygons":[[[-1040288,469120,105,0,1,-72,211,0,0,52,14,0,0,21,281,0,0,13,-156,8,0,-18,-34,-1,0,25,146,0,-20,34,-56,0,0,-13,-66,9,8,15,-44,0,0,11,-45,1,0,-12,-28,0,0,36,-78,0,0,26,-29,2,1,81,107,-1,1,36,-109,0,-1,37,-104,0,1,-86,56,-1,5,-57,15,0,0,-13,-44,0,0,-40,-32,1,0,-21,-106,0]]]},{"geoid":"3805740","name":"Belcourt","full":"Belcourt CDP","lsad":"CDP","cdp":true,"polygons":[[[-997669,488199,439,0,2,434,-49,20,-48,-20,-341,-2,-2,-323]]]},{"geoid":"3805820","name":"Belfield","full":"Belfield city","lsad":"city","polygons":[[[-1032109,468763,104,0,-2,27,113,-13,1,-15,206,0,-4,28,-123,9,-83,18,0,89,108,1,0,17,-62,0,-1,43,-45,-11,0,59,-36,0,-15,-25,-31,1,0,-12,-39,0,16,-13,0,-53,-34,4,0,-10,-18,0,1,28,-55,1,-1,-104]]]},{"geoid":"3805980","name":"Benedict","full":"Benedict city","lsad":"city","polygons":[[[-1010897,478265,107,0,0,73,-106,0]]]},{"geoid":"3806180","name":"Bergen","full":"Bergen city","lsad":"city","polygons":[[[-1007361,480002,325,-1,-2,72,-323,1]]]},{"geoid":"3806300","name":"Berlin","full"Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"NE","state":"Nebraska","fips":"31","features":[{"geoid":"3100205","name":"Abie","full":"Abie village","lsad":"village","polygons":[[[-969509,413309,0,9,42,1,-1,42,-68,1]]]},{"geoid":"3100240","name":"Adams","full":"Adams village","lsad":"village","polygons":[[[-965253,404508,46,-1,0,36,84,0,0,-36,25,-1,1,28,15,8,67,-1,1,75,-195,2,0,-37,-43,-1]]]},{"geoid":"3100380","name":"Agnew","full":"Agnew CDP","lsad":"CDP","cdp":true,"polygons":[[[-968201,410138,50,1,0,-41,67,-1,-21,27,-45,96,-1,-50,-46,0]]]},{"geoid":"3100415","name":"Ainsworth","full":"Ainsworth city","lsad":"city","polygons":[[[-998741,425464,19,-5,0,-33,91,0,-1,-33,9,0,0,19,13,0,0,15,21,-7,12,17,19,0,1,9,69,-5,0,14,62,-2,7,56,-17,3,-1,23,-78,-2,-5,16,-71,0,-12,11,-2,-25,-49,8,-19,-8,-1,-53,-48,1,0,-11]]]},{"geoid":"3100555","name":"Albion","full":"Albion city","lsad":"city","polygons":[[[-980154,416998,19,-4,0,-33,48,0,0,-36,-48,2,-1,-20,35,-6,8,-19,0,-47,15,-72,19,0,0,36,40,-8,6,23,33,-3,7,20,63,9,11,13,-44,40,-1,47,-56,7,-89,58,-65,11]]]},{"geoid":"3100625","name":"Alda","full":"Alda village","lsad":"village","polygons":[[[-984743,408588,191,-1,0,11,-106,0,-1,99,70,35,37,1,1,26,-35,-16,-28,20,-1,-31,-128,1,0,-64]]]},{"geoid":"3100730","name":"Alexandria","full":"Alexandria village","lsad":"village","polygons":[[[-973952,402471,0,-17,26,0,0,-39,92,1,1,143,-49,0,-15,-72,-79,-6]]]},{"geoid":"3100870","name":"Allen","full":"Allen village","lsad":"village","polygons":[[[-968522,424101,73,-2,21,9,4,-14,24,-1,0,17,-18,0,3,17,47,1,-6,29,32,-25,0,27,27,0,-26,11,-36,-1,-3,24,-45,0,0,-10,-43,-1,-27,-12,11,-9,2,-33,-39,-1]]]},{"geoid":"3100905","name":"Alliance","full":"Alliance city","lsad":"city","polygons":[[[-1028887,421042,-63,-1,-1,22,-16,0,2,-22,-17,-1,-1,14,-17,-15,19,1,-4,-73,-14,-1,-5,-17,20,0,9,-65,85,-5,3,-19,-97,-156,0,-24,48,74,51,0,4,72,49,0,2,70,63,2,-1,-36,34,0,2,37,242,5,3,-47,71,1,0,9,25,1,-2,35,-65,2,-32,17,-44,40,-28,11,30,-9,42,-37,4,50,-44,-1,-7,9,4,64,39,0,-1,-21,11,0,1,21,23,0,0,30,-23,0,0,-9,-100,-2,1,20,-56,-2,0,19,-11,0,-1,15,-33,0,-1,38,-30,-1,-1,19,9,7,22,0,-1,84,-150,-2,-3,-72,-13,0,0,-13,47,2,0,-16,17,0,1,-10,-40,-1,1,-36,-44,-2,1,-16,-12,-11,-42,1,-136,169,75,1,4,74,-143,-2]]]},{"geoid":"3100975","name":"Alma","full":"Alma city","lsad":"city","polygons":[[[-993850,400997,76,-17,0,-9,39,-8,200,5,-1,69,-33,1,-4,21,-9,1,0,77,-19,-1,-1,-18,-21,0,0,19,-83,-2,-11,-95,-57,-8,0,-29]]]},{"geoid":"3101150","name":"Alvo","full":"Alvo village","lsad":"village","polygons":[[[-963937,408709,94,0,0,-18,34,18,-2,20,-31,2,-1,18,-47,-14,0,23,-6,-30]]]},{"geoid":"3101220","name":"Ames","full":"Ames CDP","lsad":"CDP","cdp":true,"polygons":[[[-966327,414465,64,-14,73,-2,-20,53,13,12,-35,2,-7,24,-23,5,-42,-27,-22,2]]]},{"geoid":"3101290","name":"Amherst","full":"Amherst village","lsad":"village","polygons":[[[-992742,408356,20,10,55,-32,23,75,-99,9]]]},{"geoid":"3101465","name":"Anoka","full":"Anoka village","lsad":"village","polygons":[[[-988358,429405,146,0,0,109,-146,0]]]},{"geoid":"3101500","name":"Anselmo","full":"Anselmo village","lsad":"village","polygons":[[[-998696,416147,93,2,1,26,14,6,0,31,-14,11,-94,-2]]]},{"geoid":"3101535","name":"Ansley","full":"Ansley village","lsad":"village","polygons":[[[-993908,412849,48,0,17,-30,-17,-43,38,0,-12,26,42,-17,-5,27,32,0,0,22,13,15,14,0,0,30,-15,0,-14,42,-45,0,0,37,-49,0,2,-37,-49,0]]]},{"geoid":"3101780","name":"Arapahoe","full":"Arapahoe city","lsad":"city","polygons":[[[-999095,403044,12,0,2,-37,73,-15,0,-32,71,-4,1,34,49,0,2,36,-10,36,-14,0,1,22,18,0,-1,16,-18,1,-22,47,-97,-7,-1,-59,-65,-4]]]},{"geoid":"3101850","name":"Arcadia","full":"Arcadia village","lsad":"village","polygons":[[[-991349,414236,48,-15,40,-37,21,-7,0,20,82,1,0,51,-31,0,0,-16,-43,72,-113,1]]]},{"geoid":"3101920","name":"Archer","full":"Archer CDP","lsad":"CDP","cdp":true,"polygons":[[[-981449,411541,29,10,61,0,-1,63,29,10,33,0,-14,33,-7,112,-136,-1]]]},{"geoid":"3101990","name":"Arlington","full":"Arlington village","lsad":"village","polygons":[[[-963697,414568,34,-24,54,-2,16,-47,16,-14,111,16,0,16,-16,16,0,56,-81,0,1,27,-45,1,-16,9,-1,-37,-49,-1,1,-15]]]},{"geoid":"3102095","name":"Arnold","full":"Arnold village","lsad":"village","polygons":[[[-1002014,414227,48,0,-13,-19,0,-54,64,-14,1,13,40,0,-2,147,-34,0,-26,9,0,29,-11,0,0,-32,-16,-7,-48,0]]]},{"geoid":"3102200","name":"Arthur","full":"Arthur village","lsad":"village","polygons":[[[-1017004,415685,143,1,1,73,-95,-1,1,-35,-49,0]]]},{"geoid":"3102305","name":"Ashland","full":"Ashland city","lsad":"city","polygons":[[[-963922,410370,69,0,0,-19,36,0,0,10,37,-6,1,15,37,-6,3,19,21,2,33,-32,0,-21,57,-2,6,-58,32,4,0,30,8,15,18,-20,4,79,-16,5,54,39,-4,4,-63,-44,1,22,-21,1,1,44,-75,0,3,36,-72,0,0,-18,-25,0,0,-18,-54,0,-18,23,-8,0,0,-11,-15,1,0,-13,-48,0]]]},{"geoid":"3102375","name":"Ashton","full":"Ashton village","lsad":"village","polygons":[[[-988040,412427,189,3,-1,32,-47,11,1,26,46,1,0,36,-45,1,-2,-26,-31,-11,-64,72,-4,-58,-43,-7]]]},{"geoid":"3102480","name":"Aten","Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"NH","state":"New Hampshire","fips":"33","features":[{"geoid":"3300980","name":"Alton","full":"Alton CDP","lsad":"CDP","cdp":true,"polygons":[[[-712335,434654,35,-7,7,-32,48,-32,-7,-34,-26,-5,21,-21,8,-22,18,-9,60,15,56,4,12,-6,-43,33,-14,31,-53,47,-30,47,-43,-24,-15,19]]]},{"geoid":"3301220","name":"Amherst","full":"Amherst CDP","lsad":"CDP","cdp":true,"polygons":[[[-716334,428575,44,1,2,17,47,1,21,-28,-1,40,18,-13,88,-12,-16,49,-7,79,-31,-32,-55,-11,-20,39,-82,-8,15,-27,-23,-6,-2,-32]]]},{"geoid":"3301620","name":"Antrim","full":"Antrim CDP","lsad":"CDP","cdp":true,"polygons":[[[-719619,430302,-12,-58,13,-32,-7,-47,320,36,-7,8,14,5,-15,7,20,11,21,-8,5,12,-8,16,-32,28,19,0,-25,12,18,34,28,27,24,-2,-3,11,-14,0,12,12,-38,9,6,43,-22,-4,4,7,-30,15,-12,19,0,7,41,3,36,29,-35,13,-45,46,-6,14,-28,17,-7,15,-21,12,-19,1,-13,-13,3,-13,-74,-4,7,-11,-5,-15,-63,13,23,-61,-41,-6,-66,3]]]},{"geoid":"3301940","name":"Ashland","full":"Ashland CDP","lsad":"CDP","cdp":true,"polygons":[[[-716440,436959,13,-30,5,-76,207,25,-28,13,30,1,7,14,0,33,-18,0,0,106,-133,-9,-139,0]]]},{"geoid":"3303620","name":"Bartlett","full":"Bartlett CDP","lsad":"CDP","cdp":true,"polygons":[[[-712990,440734,46,-38,39,-48,58,3,20,23,3,-34,157,-1,-26,19,-3,28,-22,54,3,22,41,23,-1,8,43,8,2,15,-23,-10,-32,8,-84,-16,-13,9,6,17,-10,9,-60,7,-29,-15,-21,-28,-93,-27,6,-18]]]},{"geoid":"3304660","name":"Belmont","full":"Belmont CDP","lsad":"CDP","cdp":true,"polygons":[[[-714924,434419,75,-15,-1,-17,17,-10,21,-30,12,4,5,-50,17,-4,32,21,8,20,51,4,0,76,29,0,-1,26,19,23,-12,-1,-57,30,7,23,-25,-15,-61,35,-33,-31,-17,21,-7,-30,-9,-4,-35,8,-13,-11,6,-27,-49,-28]]]},{"geoid":"3304820","name":"Bennington","full":"Bennington CDP","lsad":"CDP","cdp":true,"polygons":[[[-719256,429997,38,-29,27,2,23,14,-9,23,42,29,-4,59,-77,-28,-5,21,-57,-1]]]},{"geoid":"3305140","name":"Berlin","full":"Berlin city","lsad":"city","polygons":[[[-711620,444498,381,782,-1145,-14,-1183,-30,-409,-786]]]},{"geoid":"3305380","name":"Bethlehem","full":"Bethlehem CDP","lsad":"CDP","cdp":true,"polygons":[[[-717073,442791,44,-26,12,-19,117,-2,3,-71,24,-9,5,-12,73,53,76,23,-28,36,18,0,-14,22,-3,26,-62,57,-7,16,-68,29,-9,13,-23,-1,-4,-16,15,-13,-9,-18,-35,-2,2,-18,-99,-4,3,-62]]]},{"geoid":"3306020","name":"Blodgett Landing","full":"Blodgett Landing CDP","lsad":"CDP","cdp":true,"polygons":[[[-720432,433767,0,-34,40,-33,49,-8,-21,108,6,14,-86,-7]]]},{"geoid":"3306900","name":"Bradford","full":"Bradford CDP","lsad":"CDP","cdp":true,"polygons":[[[-719690,432682,41,2,20,-12,20,10,10,-28,15,1,50,-20,6,11,31,-17,-26,46,2,45,17,65,-344,-72]]]},{"geoid":"3307620","name":"Bristol","full":"Bristol CDP","lsad":"CDP","cdp":true,"polygons":[[[-717517,435815,4,10,22,-13,11,-20,185,76,-20,17,9,41,36,29,69,-3,35,36,33,17,-12,25,16,3,-13,49,12,20,-16,29,-130,-30,-6,13,-88,34,-6,-7,-26,9,-8,-16,-17,21,11,13,-35,2,-14,8,2,-20,-144,-39,-47,-25,0,-7]]]},{"geoid":"3308900","name":"Canaan","full":"Canaan CDP","lsad":"CDP","cdp":true,"polygons":[[[-720274,436503,32,0,1,-40,71,-3,52,-19,52,10,32,18,0,55,-52,-18,0,14,-22,25,-83,12,-22,-5,-62,19]]]},{"geoid":"3310820","name":"Center Ossipee","full":"Center Ossipee CDP","lsad":"CDP","cdp":true,"polygons":[[[-711647,437521,17,2,-2,13,40,-8,21,-19,-15,-17,13,-9,43,-7,8,-20,28,18,39,8,46,-4,10,25,63,-12,-42,50,-141,88,2,-14,-22,-10,-79,4,-19,-22,2,-17,-17,-3]]]},{"geoid":"3310900","name":"Center Sandwich","full":"Center Sandwich CDP","lsad":"CDP","cdp":true,"polygons":[[[-714470,438063,97,-55,15,-26,13,9,-19,34,17,21,33,17,17,-5,25,18,-38,16,-7,14,-27,11,-34,3,-20,12,0,16,-73,18,7,-57,-19,-14]]]},{"geoid":"3311300","name":"Charlestown","full":"Charlestown CDP","lsad":"CDP","cdp":true,"polygons":[[[-724351,432294,54,-10,51,-42,4,-18,14,26,36,31,40,24,11,-2,-16,20,-15,41,-3,35,56,59,-46,4,-71,-35,-40,14,-44,-9,-7,-31,16,-38,-26,-29,-8,-30]]]},{"geoid":"3312900","name":"Claremont","full":"Claremont city","lsad":"city","polygons":[[[-724160,433765,9,-106,17,-32,95,-46,117,-2,21,-10,-8,-19,-101,-92,-57,-81,549,-29,-31,-128,144,6,-10,57,37,-7,2,46,271,6,430,-13,-15,436,-5,486,-1269,52,-36,-137,-1,-42,-37,-191,-15,-19,-79,-57,-22,-41]]]},{"geoid":"3313700","name":"Colebrook","full":"Colebrook CDP","lsad":"CDP","cdp":true,"polygons":[[[-715165,448796,77,59,15,-1,-7,-22,4,-26,11,25,37,3,231,-33,2,23,34,25,-33,16,-87,19,30,26,-25,9,26,6,-31,9,0,12,15,9,67,0,0,53,-24,0,24,37,-5,6,67,34,-8,19,9,16,-114,1,1,-10,-84,1,2,-8,-29,-15,0,-15,12,-15,-6,-23,-41,12,-16,-4,-75,-67,-46,-29,-9,-17,34,-27,-49,-50,-31,-6,-32,-44]]]},{"geoid":"3314200","name":"Concord","full":"Concord city","lsad":"city","polygons":[[[-716502,432325,565,-807,713,271,-18,-18,-4,-30,-12,-20,8,-12,54,-38,133,-20,74,-38,39,-30,20,23,-15,3,0,9,17,12,-2,23,-27,5,9,13,-17,5,-5,11,71,7,7,-24,13,6,-1,29,-9,5,-2,20,-19,-9,-10,40,-44,-6,-7,-10,-20,1,-9,13,-28,7,29,30,55,10,39,34,-29,68,2,19,-9,1,-6,27,-27,49,-29,6,26,4,30,-21,16,-2,23,22,38,-10,5,-16,31,24,8,-14,21,17,21,1,28,20,-19,20,11,13,20,1,-7,20,-49,3,10,38,-13,4,10,25,-12,Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"NJ","state":"New Jersey","fips":"34","features":[{"geoid":"3400100","name":"Absecon","full":"Absecon city","lsad":"city","polygons":[[[-745241,394219,44,-49,73,-22,86,-13,7,12,40,-15,10,16,23,-6,-10,-19,-2,-123,6,-49,20,-38,61,-54,18,6,-3,18,-40,15,17,21,-2,49,225,142,58,45,9,86,-191,108,-53,13,-225,144,-244,-243]]]},{"geoid":"3400160","name":"Absecon Highlands","full":"Absecon Highlands CDP","lsad":"CDP","cdp":true,"polygons":[[[-744914,394409,23,-21,46,-26,53,-13,191,-108,-9,-86,6,3,61,253,-88,9,13,10,-41,27,-73,22,23,23,-111,68,-7,-6,-42,26,-20,-21,-22,-132]]]},{"geoid":"3400640","name":"Allamuchy","full":"Allamuchy CDP","lsad":"CDP","cdp":true,"polygons":[[[-748407,409190,61,10,92,-26,77,5,73,-9,29,6,52,44,33,13,98,22,47,-5,-216,201,-50,-34,-68,-83,-264,-141]]]},{"geoid":"3400700","name":"Allendale","full":"Allendale borough","lsad":"borough","polygons":[[[-741547,410217,69,1,164,-32,-4,37,53,2,4,-15,54,-9,7,41,44,45,10,148,-127,52,-9,-19,-41,17,-58,-26,-13,-26,-14,6,-18,-29,-59,19,-17,-25,5,-5,-10,-46,-19,-38,6,-25,30,-5,6,-13,-15,2,-32,-17,-23,2]]]},{"geoid":"3400730","name":"Allenhurst","full":"Allenhurst borough","lsad":"borough","polygons":[[[-740089,402334,80,6,59,-11,16,45,-146,25,-10,-52]]]},{"geoid":"3400760","name":"Allentown","full":"Allentown borough","lsad":"borough","polygons":[[[-745976,401739,18,-20,109,8,19,32,30,-24,33,25,-8,9,-47,2,47,37,-35,43,-47,-12,-130,-69]]]},{"geoid":"3400790","name":"Allenwood","full":"Allenwood CDP","lsad":"CDP","cdp":true,"polygons":[[[-741280,401187,203,183,8,-13,21,-2,15,-11,7,-23,-7,-8,24,-13,19,-22,8,-2,9,14,14,-3,-3,-41,35,13,-7,12,29,10,24,2,19,-13,19,4,-52,68,-61,155,-64,119,-31,-101,-72,-125,-26,-29,-68,-49,-23,-25,-23,-42]]]},{"geoid":"3400850","name":"Alloway","full":"Alloway CDP","lsad":"CDP","cdp":true,"polygons":[[[-753941,395704,288,-231,45,-4,35,-20,16,-21,32,-1,21,-12,26,-26,18,14,28,-20,20,-3,44,21,51,-17,26,5,44,27,61,-10,12,17,-104,33,-49,41,-51,16,-39,57,26,17,79,-10,94,16,7,39,68,55,-319,166,-23,-12,-44,-41,-87,-5,-71,-69,-255,1]]]},{"geoid":"3401030","name":"Alpha","full":"Alpha borough","lsad":"borough","polygons":[[[-751724,406430,76,59,91,31,-9,34,30,4,-5,20,24,5,42,-26,0,7,45,4,41,28,47,1,-43,24,-128,102,-88,-3,-9,-35,6,-19,-88,-13,22,-89,-40,-11,5,-20,-14,-7,4,-17,-19,-9,12,-9,-22,-18]]]},{"geoid":"3401090","name":"Alpine","full":"Alpine borough","lsad":"borough","polygons":[[[-739447,409576,48,-28,36,-40,-65,-82,70,-38,-64,-127,223,-125,56,144,70,235,112,304,25,153,-91,1,-191,86,-72,-241,-42,5,-19,-99,-56,-104]]]},{"geoid":"3401184","name":"Ampere North","full":"Ampere North CDP","lsad":"CDP","cdp":true,"polygons":[[[-741975,407773,77,-87,35,61,-39,57,-77,0]]]},{"geoid":"3401300","name":"Anderson","full":"Anderson CDP","lsad":"CDP","cdp":true,"polygons":[[[-749450,407653,111,-101,40,-32,12,1,14,25,83,45,-25,51,1,38,6,14,24,16,-79,-25,-148,-26]]]},{"geoid":"3401330","name":"Andover","full":"Andover borough","lsad":"borough","polygons":[[[-747516,409774,107,-83,8,6,76,260,-137,41,-24,-1]]]},{"geoid":"3401480","name":"Annandale","full":"Annandale CDP","lsad":"CDP","cdp":true,"polygons":[[[-749051,406545,31,-18,14,-38,23,-9,-1,-61,-29,3,-1,-25,79,-1,-3,3,47,-9,16,-10,35,1,94,33,90,19,-210,103,-20,4,-21,21,6,11,-38,-14,-84,16]]]},{"geoid":"3401825","name":"Arrowhead Lake","full":"Arrowhead Lake CDP","lsad":"CDP","cdp":true,"polygons":[[[-753269,394744,89,-9,132,9,-44,34,-26,-13,-49,-2,-19,-11,-33,10,-20,23,-36,13]]]},{"geoid":"3401900","name":"Asbury","full":"Asbury CDP","lsad":"CDP","cdp":true,"polygons":[[[-750169,406946,23,-16,20,0,29,22,24,-21,27,-2,22,9,28,32,-19,-16,-22,47,-29,18,-27,1,-30,26,25,25,-15,19,-55,8,0,13,-17,-14,5,-17,-12,-14,-11,-53]]]},{"geoid":"3401960","name":"Asbury Park","full":"Asbury Park city","lsad":"city","polygons":[[[-740273,402249,18,-16,1,-58,10,-43,53,1,151,35,33,0,48,136,-103,8,-59,-5,-62,-16,-82,-31,-4,-8]]]},{"geoid":"3401990","name":"Ashland","full":"Ashland CDP","lsad":"CDP","cdp":true,"polygons":[[[-750264,398854,21,-14,14,0,7,-13,28,-13,-3,-28,25,-17,-5,-15,12,-18,0,-22,38,-56,-2,-33,-30,-31,270,8,-102,106,26,13,12,47,-13,10,5,46,9,21,-9,49,-210,41,16,38,-44,34,-23,-18,9,-37,-30,-2,-4,-44,-17,-11,-8,-19]]]},{"geoid":"3402020","name":"Atco","full":"Atco CDP","lsad":"CDP","cdp":true,"polygons":[[[-749132,397768,391,-352,148,71,50,112,85,-48,8,-24,31,-10,21,-30,121,6,50,79,-36,201,-13,119,-29,-6,-142,12,-18,-4,-16,-15,-9,9,-24,-2,-26,-15,-18,2,-6,-6,-117,-20,-80,-32,-137,5,-2,-10,-29,6,-37,-45,-114,67,-35,-48]]]},{"geoid":"3402080","name":"Atlantic City","full":"Atlantic City city","lsad":"city","polygons":[[[-745016,393573,108,-40,25,6,60,37,56,8,125,-154,254,96,152,28,109,54,45,43,18,54,-156,147,88,47,-27,31,-1,13,22,29,-31,30,-75,25,-85,13,-12,45,-36,35,-33,54,-63,-5,-20,-24,-26,0,-40,17,-45,-4,-289,-190,2,-49,-17,-21,40,-15,3,-18,-18,-6,11,-11,1,-28,12,-19,-24,-41,-41,-34,0,-69,-72,-61]]]},{"geoid":"3402110","name":"Atlantic Highlands","full":"Atlantic Highlands borough","lsad":"boroughLine truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"NM","state":"New Mexico","fips":"35","features":[{"geoid":"3500240","name":"Abeytas","full":"Abeytas CDP","lsad":"CDP","cdp":true,"polygons":[[[-1068222,344543,79,10,19,34,72,-28,15,28,-2,35,-21,57,-23,7,9,66,-26,5,3,20,-75,6,-70,-234]]]},{"geoid":"3500310","name":"Abiquiu","full":"Abiquiu CDP","lsad":"CDP","cdp":true,"polygons":[[[-1063314,361889,57,-1,18,34,-6,18,19,12,0,23,17,19,6,40,11,-28,18,6,21,21,15,0,-1,34,55,20,-19,8,-36,-4,-15,-10,-32,15,-15,35,-39,-5,-17,-12,12,-20,-22,-24,-30,-13,-19,-21]]]},{"geoid":"3500765","name":"Acomita Lake","full":"Acomita Lake CDP","lsad":"CDP","cdp":true,"polygons":[[[-1076526,350694,87,-27,13,-19,-15,-30,187,-33,173,-53,65,1,86,22,68,5,-25,17,-51,172,-505,13,-12,-38,-46,-20,-26,-2]]]},{"geoid":"3500940","name":"Adelino","full":"Adelino CDP","lsad":"CDP","cdp":true,"polygons":[[[-1067509,347030,23,-46,27,-33,30,3,107,-19,0,-14,53,-19,78,102,30,61,33,99,-1,32,-184,2,0,-47,-58,1,-59,-4,-4,-6,-23,5,-26,-16,-28,-51]]]},{"geoid":"3501220","name":"Agua Fria","full":"Agua Fria CDP","lsad":"CDP","cdp":true,"polygons":[[[-1060360,356494,16,8,20,-46,13,5,-20,47,79,33,0,-26,14,9,15,-59,9,3,136,56,-8,31,15,-29,30,9,-3,17,10,2,5,-17,19,5,-8,31,-29,-6,-2,13,64,12,-14,0,-7,26,10,18,36,17,-1,6,-29,-14,-19,7,-10,42,17,23,-1,15,-37,1,-27,73,-28,-2,-10,-45,4,-11,-28,-1,-20,-11,-45,-52,-34,-14,0,-17,-36,1,-29,-8,-12,-10,-1,-89,-40,-13,-8,-10,-9,8]]]},{"geoid":"3501640","name":"Alamillo","full":"Alamillo CDP","lsad":"CDP","cdp":true,"polygons":[[[-1069236,342429,43,1,0,-50,43,-16,98,265,-13,4,-42,-7,-11,-11,-111,8,1,-128]]]},{"geoid":"3501710","name":"Alamo","full":"Alamo CDP","lsad":"CDP","cdp":true,"polygons":[[[-1075584,344586,-4,-7,26,-54,17,-19,25,-7,59,-78,34,2,48,-18,17,-33,-32,-15,-43,-7,-23,-16,-8,-39,12,-61,-19,-32,-25,-13,7,-25,-20,5,-5,-11,-49,7,-22,-20,5,-33,17,-9,-1,-57,20,-26,-1,-35,-16,-65,12,-62,-62,-117,65,-54,21,-62,103,40,121,26,24,-19,41,-65,137,-58,81,-8,64,-60,38,-50,82,-47,2,10,-25,57,7,17,48,47,13,37,-8,101,9,30,20,33,18,-5,41,11,8,-2,14,-28,20,-7,-4,24,-11,2,-18,39,7,37,-35,13,-11,25,6,22,-19,45,-73,67,10,41,18,-3,17,21,32,1,73,31,-12,2,28,48,-19,7,6,20,-22,10,24,5,-1,21,19,18,4,43,-13,18,16,13,-15,99,-12,37,-24,32,-4,115,20,70,-18,17,-3,16,-21,25,-14,-2,-22,17,-94,42,-7,12,-32,11,-23,33,-40,34,-27,3,-26,-11,-78,1,-86,-13,-25,7,-124,5,-54,-4,0,-22,-253,0,-2,-144,9,0,-12,-46]]]},{"geoid":"3501780","name":"Alamogordo","full":"Alamogordo city","lsad":"city","polygons":[[[-1060154,328188,83,-1,2,61,64,52,202,-2,-2,146,177,2,0,54,162,0,0,107,25,1,0,109,49,0,0,21,23,9,1,8,65,-3,-2,-12,13,-15,17,10,-32,31,1,15,-10,-4,-12,14,-15,3,-9,19,5,9,44,0,-1,-37,59,0,-20,37,8,0,0,81,80,-1,0,226,-38,35,0,17,12,11,24,0,1,146,-173,1,-7,-42,-10,-2,10,-11,-15,6,-69,-6,0,12,-82,0,0,73,20,2,0,11,23,0,0,28,-43,5,0,32,-44,-1,-11,-7,3,-26,-54,0,-2,49,9,13,-55,-14,-19,-32,-52,-1,0,-32,-144,-2,1,-72,154,1,-1,-35,22,0,1,35,10,-13,2,13,39,0,30,-58,4,-161,-24,0,0,-77,-57,1,-4,-24,-43,-10,43,0,0,-17,61,1,-7,-56,-54,0,1,-38,-85,-1,-2,-180,-88,-1,0,-32,-88,0,0,-64,-178,-75]]]},{"geoid":"3502000","name":"Albuquerque","full":"Albuquerque city","lsad":"city","polygons":[[[-1068728,351250,1447,2,0,-66,-50,-6,-9,-20,-30,-22,-77,-2,0,-14,-79,-1,-28,-14,0,-96,-62,0,-38,27,-74,-13,-8,-37,78,-13,-40,-57,23,-4,33,-23,14,-83,-16,-3,13,-35,133,60,36,-10,16,-33,-35,-8,10,-29,-20,-4,10,-31,-31,-6,1,-62,-57,-13,-4,-126,19,0,12,-69,-88,-1,-2,-143,91,0,9,-50,80,1,0,-27,170,1,7,26,-2,139,40,-5,-5,-29,52,-5,4,29,-48,5,7,30,32,-4,16,33,27,0,-4,-11,30,-2,34,39,-58,7,9,49,44,-5,5,17,-41,2,3,20,46,-3,17,10,-63,6,18,29,21,4,-9,29,-23,2,-7,23,-20,-3,8,-30,25,5,-7,-25,-13,-10,-74,-9,-8,60,7,2,4,-30,19,1,2,25,-18,5,5,13,18,6,6,44,166,-30,-4,-12,13,-6,70,78,-8,12,16,3,-16,78,29,6,0,-18,22,-1,1,22,49,-3,-1,-17,10,-2,3,13,6,-15,-8,-17,-13,2,-5,-20,-20,-2,35,-11,-31,6,-12,-38,62,-2,2,22,11,-8,5,28,-25,1,-10,19,41,-7,-20,9,10,19,-18,25,-17,-1,-5,14,15,4,11,-19,20,1,20,-60,3,13,22,-3,78,-86,7,6,29,-17,28,-88,-19,-75,-41,-54,84,1,9,-36,129,0,2,70,44,0,2,-349,-7,-18,183,6,-1,-148,-176,-1,0,-69,-141,-2,-34,-156,0,-209,-91,0,4,-99,966,4,2,638,-172,3,-5,173,-73,0,-1,10,-193,1,70,49,-20,13,30,67,341,-9,-1,28,-38,0,0,17,-349,-1,8,123,19,0,0,-73,30,0,0,72,178,1,139,-47,-7,-15,38,-3,7,63,92,0,1,73,90,0,0,18,180,0,-3,-205,43,0,0,37,88,0,-72,-54,-13,-21,483,-3,-1,147,-80,-1,-7,87,26,-11,6,-36,32,1,1,10,-22,19,45,6,0,74,44,0,-1,217,44,0,0,66,-89,5,-3,477,12,-4,55,20,-15,103,-81,-16,-33,5,-33,-13,-25,13,-321,1,-1,58,-88,0,0,92,77,-1,0,11,-33,0,-6,15,-77,0,0,43,-49,1,0,101,-179,0,2,30,-50,0,11,-29,-50,0,0,57,11,11,34,-4,0,18,-357,41,19,-21,-64,-135,-55,-60,-38,-77,22,-6,5,-46,-61,-49,37,-48,-69,2,-6,-15,79,-13,8,-22,-15,-39,-80,2,5,17,-14,2,5,16,-23,3,9,-36,-32,2,31,-11,-1,-7,83,-11,-28,-86,-38,-34,-16,3,-4,-13,-25,-15,28,-7,0,-17,-58,10,58,-20,0,-16,-66,18,-4,-11,71,-23,-12,-39,-33,6,-5,-16,-18,-3,18,22,-13,23,-55,15,56,156,-100,19,5,23,18,8,-70,9,-10,-6,-16,-39,47,-6,-16,-20,-90,10,7,17,-26,-13,-54,12,-20,-34,-1,-21,34,-33,6,-19,-113,Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"NV","state":"Nevada","fips":"32","features":[{"geoid":"3200500","name":"Alamo","full":"Alamo CDP","lsad":"CDP","cdp":true,"polygons":[[[-1151854,374202,5,-41,16,-36,-13,-35,29,-51,-23,-35,15,-9,2,-30,34,-16,-60,-5,34,-152,48,-161,-27,0,24,-13,34,2,-1,-62,34,-23,-1,-67,55,-6,1,-24,55,-2,19,-45,14,-4,-2,-22,26,-16,12,-21,-9,-52,62,2,17,-10,11,5,1,31,43,26,-53,56,-23,36,-45,99,-61,85,-18,51,0,47,20,-2,5,17,-24,10,48,-2,-5,98,14,19,-27,31,-40,-17,-186,458,-11,-1,16,-39,-28,14,-14,-14,1,-38,-21,1,-15,-29]]]},{"geoid":"3201000","name":"Amargosa Valley","full":"Amargosa Valley CDP","lsad":"CDP","cdp":true,"polygons":[[[-1166146,365550,1264,-959,659,-514,10,947,48,503,80,451,60,1,-3,286,181,-1,1,295,-179,0,-1,-115,-254,62,-13,-73,-294,-332,0,-11,-14,-5,-95,-106,-823,-1,0,-36,-90,-1,0,37,-537,0]]]},{"geoid":"3203700","name":"Austin","full":"Austin CDP","lsad":"CDP","cdp":true,"polygons":[[[-1170846,395044,-32,0,5,-25,-9,-10,55,-20,22,-36,61,-28,34,-61,57,-16,4,16,20,3,-5,17,41,-3,-17,37,22,9,-16,26,-47,37,-42,-9,-9,-13,-21,11,-14,23,1,25,-35,6,-8,40,16,11,-69,22,-67,9]]]},{"geoid":"3204100","name":"Baker","full":"Baker CDP","lsad":"CDP","cdp":true,"polygons":[[[-1141346,390113,32,-28,37,-1,1,-20,23,-18,49,6,34,14,-24,22,0,31,69,43,-35,37,-23,46,-95,1,-1,-48,-16,-18,-23,-62]]]},{"geoid":"3204900","name":"Battle Mountain","full":"Battle Mountain CDP","lsad":"CDP","cdp":true,"polygons":[[[-1169774,406109,14,-8,183,0,0,10,186,2,79,9,-19,153,3,39,48,40,12,18,-1,84,7,15,-15,25,-24,17,-13,-1,-23,21,-21,39,-37,-23,-22,-1,10,-13,-5,-28,-45,1,-54,34,-52,7,79,-145,-290,1]]]},{"geoid":"3205100","name":"Beatty","full":"Beatty CDP","lsad":"CDP","cdp":true,"polygons":[[[-1167980,368757,24,-12,152,-19,128,-45,93,-120,11,-2,-3,33,15,69,33,98,-5,30,26,46,1,77,17,3,6,32,-27,91,286,252,62,24,73,88,34,147,13,8,50,141,9,164,-33,162,-15,31,-26,11,10,29,4,70,-10,114,-16,41,-4,101,-61,-37,-12,-22,-20,-5,0,-8,-59,-18,-27,-17,-7,-26,4,-37,-21,-91,1,-50,19,-92,12,-182,-23,13,-58,10,-4,-106,8,-190,-23,-133,-150,-125,-71,-76,-27,-15,-50,-58,-63,-7,-1,-114,-35,-8,11,-7,-10,-21,9,-17,-1,-36,-22,-49,-209,-139]]],"label":[-116.72002362155388,36.94895]},{"geoid":"3205125","name":"Beaverdam","full":"Beaverdam CDP","lsad":"CDP","cdp":true,"polygons":[[[-1144560,376941,25,0,4,-145,84,0,3,199,-91,1,0,-37,-25,0]]]},{"geoid":"3205275","name":"Bennett Springs","full":"Bennett Springs CDP","lsad":"CDP","cdp":true,"polygons":[[[-1144806,376905,105,-20,140,252,57,187,70,81,-101,7,-1,-36,-92,-3,-2,-145,-184,1]]]},{"geoid":"3205700","name":"Blue Diamond","full":"Blue Diamond CDP","lsad":"CDP","cdp":true,"polygons":[[[-1154426,360559,17,-27,-23,-30,5,-41,49,-57,16,-61,34,-47,31,-95,18,-21,-4,-34,-36,-50,53,23,92,69,147,66,39,53,28,16,124,3,248,23,-12,13,-54,13,-110,55,-48,52,-103,15,-81,-9,-117,33,-95,42,-100,59,-46,37,-68,-22,1,-27,-28,-51]]]},{"geoid":"3206500","name":"Boulder City","full":"Boulder City city","lsad":"city","polygons":[[[-1151008,357205,754,0,0,-435,891,0,0,435,88,0,0,508,-178,0,0,369,-11,0,0,72,445,0,0,-72,189,0,0,-152,1078,-1,3,153,-202,0,-1,872,-37,0,0,107,-66,0,1,142,358,2,-3,287,-179,2,1,508,-358,1,0,109,-530,2,0,-292,-355,0,-1,-59,15,-1,-5,-33,12,0,-18,-82,7,-176,-122,0,-1,-145,45,0,0,-37,22,0,0,-36,-23,0,0,-18,-45,0,1,18,-445,-2,0,73,-89,1,1,73,-179,0,-3,-438,39,-1,0,-442,-534,0,-1,-435,-344,0,0,-151,-220,0]]]},{"geoid":"3208100","name":"Bunkerville","full":"Bunkerville CDP","lsad":"CDP","cdp":true,"polygons":[[[-1142179,367318,25,-12,18,1,271,91,17,-8,7,-14,-7,-13,23,-52,-1,-18,23,-21,897,390,-28,128,4,21,-11,52,5,46,-221,-31,-172,-61,-148,-106,0,7,-14,-5,-21,-21,-102,-45,-35,-46,-121,-108,-187,-95,-25,0,-54,29,-20,-8,-25,-27,-46,16,-50,-6,-13,-17,36,0,-2,-36,-45,-1]]]},{"geoid":"3208500","name":"Caliente","full":"Caliente city","lsad":"city","polygons":[[[-1145716,376552,8,-192,-4,-435,312,2,7,-72,21,33,17,59,54,96,12,10,19,-24,5,-17,-11,-23,-44,-32,-28,-77,-8,-10,1,65,-13,-44,-16,-36,15,0,-25,-39,-32,-17,-18,-19,-12,0,-37,-43,0,-29,29,0,-85,-49,30,-5,26,-19,46,0,0,38,45,0,0,137,10,6,82,2,0,47,-23,-3,-20,8,12,21,32,0,0,73,45,-1,0,37,46,-1,0,36,-46,1,1,36,136,-1,0,36,45,0,0,-108,91,0,-1,-72,911,0,0,145,-729,1,1,43,-22,1,0,28,-24,0,-1,10,-16,0,-6,14,0,12,68,1,1,-29,11,-8,79,0,0,36,91,0,0,36,546,0,-2,147,-180,0,3,865,-212,1,-41,-65,-10,-45,-21,0,-23,-36,-15,0,1,-46,-11,0,-17,-27,52,0,22,37,91,0,-2,-252,-84,0,-4,145,-90,0,0,-37,-51,0,-39,-43,0,-29,-45,0,-1,-29,-47,-31,1,-122,-92,0,1,17,45,0,0,129,46,0,1,143,-8,144,0,146,-183,1,-3,-144,8,-147,1,-145,-725,5]]]},{"geoid":"3208600","name":"Cal-Nev-Ari","full":"Cal-Nev-Ari CDP","lsad":"CDP","cdp":true,"polygons":[[[-1148891,352971,23,-12,9,-23,-1,-47,18,-56,-36,-55,135,32,-14,59,22,58,19,11,18,41,66,94,20,65,-262,-12,-22,-142]]]},{"geoid":"3208900","name":"Carlin","full":"Carlin city","lsad":"city","polygons":[[[-1161421,406956,576,-3,2,294,259,1,2,138,-738,0,-3,34,-33,0,0,-34,-67,1,1,-214]]]},{"geoid":"3209700","name":"Carson City","full":"Carson City","polygons":[[[-1200034,391127,2284Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"NY","state":"New York","fips":"36","features":[{"geoid":"3600155","name":"Accord","full":"Accord CDP","lsad":"CDP","cdp":true,"polygons":[[[-742560,417900,31,-7,109,16,-3,-29,18,-34,-25,-35,-22,-1,2,-36,33,10,45,50,77,7,37,-11,105,-7,-6,14,35,51,-2,40,27,22,-32,39,-26,-2,-17,11,2,20,-11,31,-17,4,-8,20,-21,0,1,14,30,7,-15,13,-18,-6,-4,10,7,20,18,7,-2,48,-6,0,-23,-34,4,-15,-217,-23,-17,-13,-38,-62,10,-16,30,-21,3,-27,-7,-22,-28,10,-24,-6,-3,-22,-22,-6,1,-17,-11,10]]]},{"geoid":"3600199","name":"Adams","full":"Adams village","lsad":"village","polygons":[[[-760381,438035,247,-24,8,39,37,-2,0,26,-26,-20,-8,9,4,23,42,12,-3,29,-29,3,3,24,16,23,-42,5,-23,-8,5,38,13,-1,-51,6,-6,-49,-162,11,-12,-61]]]},{"geoid":"3600232","name":"Adams Center","full":"Adams Center CDP","lsad":"CDP","cdp":true,"polygons":[[[-760152,438393,-8,-32,118,-10,6,33,19,23,104,73,34,36,48,75,27,2,24,144,4,94,-64,-8,-88,1,-26,28,-36,21,-117,-103,-20,-24,-23,-61,-47,-194,-46,-86]]]},{"geoid":"3600276","name":"Addison","full":"Addison village","lsad":"village","polygons":[[[-772480,420994,87,-1,4,-22,-25,-61,125,0,0,76,80,89,23,-4,34,35,26,13,-47,33,-2,22,-29,-2,0,20,-49,0,-14,13,-1,-10,-35,-1,0,-25,-51,1,1,-49,-71,1,-1,-35,-55,14]]]},{"geoid":"3600342","name":"Afton","full":"Afton village","lsad":"village","polygons":[[[-755354,422184,215,0,-5,216,-206,-2,-4,-99]]]},{"geoid":"3600408","name":"Airmont","full":"Airmont village","lsad":"village","polygons":[[[-741288,411126,103,1,-15,-35,-14,-1,-16,-13,-38,-61,-4,-44,360,-159,100,-9,2,20,69,106,6,21,44,41,-2,26,-62,9,-35,15,-59,46,-40,18,-245,51,-90,-4,-7,-17,-43,3]]]},{"geoid":"3600441","name":"Akron","full":"Akron village","lsad":"village","polygons":[[[-785163,430118,45,0,-1,-44,38,6,0,37,31,-1,-8,-6,1,-22,38,14,0,-19,49,18,-2,-24,45,9,5,27,121,-6,47,-97,11,-5,-54,104,32,0,-1,36,31,-6,6,8,-27,8,-9,-6,1,33,-122,6,3,115,-65,-36,1,18,-79,0,-1,15,-38,1,-6,-21,4,-17,-68,0,-4,-107,-24,-14]]]},{"geoid":"3600457","name":"Akwesasne","full":"Akwesasne CDP","lsad":"CDP","cdp":true,"polygons":[[[-747895,449746,33,-17,223,-95,-28,-32,-17,-36,43,0,47,-14,80,-7,30,-16,114,-125,47,-82,119,-90,32,7,46,-11,118,5,214,33,90,-7,787,59,192,59,42,105,68,40,-106,1,5,466,-899,7,-88,66,-27,-53,-54,-9,-56,-3,-180,36,-206,-52,-87,-77,-133,2,-126,35,-127,-66,-79,-79,-87,-24,-26,-15]]]},{"geoid":"3601000","name":"Albany","full":"Albany city","lsad":"city","polygons":[[[-738981,427074,768,-241,-73,-76,8,-68,35,-35,-25,-29,-28,-18,15,-13,72,8,-33,-33,-54,-19,-83,-9,-44,-16,-49,-39,7,0,8,-20,-4,-31,7,-10,15,-7,38,3,29,-14,34,-4,31,10,49,0,34,-10,12,6,9,22,15,13,27,2,71,-57,-10,-19,7,-43,21,-8,50,26,44,-5,7,-42,18,-2,-2,-28,48,2,13,10,79,-31,10,9,37,-3,82,-52,18,3,27,-11,-10,-43,16,7,14,-20,24,-1,67,149,18,74,46,101,48,81,109,90,76,96,-369,120,14,-32,-24,-8,4,-6,-45,-39,-53,26,19,23,-93,43,-6,-26,-13,-12,-57,26,-16,26,-296,39,-111,55,-69,51,-351,209,-240,-91,2,-9,-28,-4,-3,-14,26,-8]]]},{"geoid":"3601011","name":"Albertson","full":"Albertson CDP","lsad":"CDP","cdp":true,"polygons":[[[-736558,407657,-11,-30,57,3,40,27,64,8,-25,148,-62,3,-5,-27,-17,-18,4,-21,-13,-47,-48,-6]]]},{"geoid":"3601033","name":"Albion","full":"Albion village","lsad":"village","polygons":[[[-782103,432427,15,1,-2,-87,300,8,1,45,63,0,0,20,65,2,1,32,-24,-2,-3,77,1,15,27,3,1,15,-70,-13,-55,-1,1,27,-135,0,-17,-11,-30,0,1,18,-121,-1,-4,-116,-14,-2]]]},{"geoid":"3601088","name":"Alden","full":"Alden village","lsad":"village","polygons":[[[-785113,428866,264,-6,4,33,58,1,6,216,-317,2,2,-159,-16,-4]]]},{"geoid":"3601154","name":"Alexander","full":"Alexander village","lsad":"village","polygons":[[[-782750,429015,105,3,-2,-18,69,-10,12,10,115,-24,4,13,23,9,-102,21,10,12,12,-3,-35,14,7,8,-24,4,1,7,-47,-9,-42,1,-4,-11,-102,0]]]},{"geoid":"3601187","name":"Alexandria Bay","full":"Alexandria Bay village","lsad":"village","polygons":[[[-759338,443339,127,2,36,-19,12,-18,1,-17,43,-10,11,-16,59,23,-10,16,5,113,-32,13,48,55,-11,-4,-100,36,12,66,-20,-7,-6,-27,-73,-70,-10,-37,-33,-24,-22,-32,-22,-6,-20,-30]]]},{"geoid":"3601198","name":"Alfred","full":"Alfred village","lsad":"village","polygons":[[[-778032,422510,109,-3,-3,-69,-21,6,2,-21,123,1,10,199,32,17,-13,11,-133,-5,3,-58,-106,0,-3,-71]]]},{"geoid":"3601286","name":"Allegany","full":"Allegany village","lsad":"village","polygons":[[[-785026,420943,54,-41,-3,-13,20,-31,33,-30,95,2,-33,18,25,24,-46,-4,0,22,30,6,20,15,33,2,1,-9,29,5,-3,37,-14,5,0,-14,-44,1,-2,17,-52,1,2,-13,-18,1,-8,16,-27,-1,1,34,-15,0,-9,-15,-1,30,-21,7,-21,-2,0,-14,-25,-13,9,-16,-2,-20]]]},{"geoid":"3601440","name":"Almond","full":"Almond village","lsad":"village","polygons":[[[-777461,423111,67,-12,49,66,20,1,-10,21,24,56,-31,11,10,14,-69,20,-30,-75,-6,-62,-11,-5]]]},{"geoid":"3601517","name":"Altamont","full":"Altamont village","lsad":"village","polygons":[[[-740504,427119,67,-54,-23,-21,10,-3,14,13,37,-41,4,-12,-27,-18,17,-19,17,9,39,-4,32,-27,78,16,-4,31,33,16,-20,32,-26,20,41,38,-20,37,-29,1,-7,-22,27,-24,-6,-22,-24,7,-31,30,5,20,-69,-7,0,7,6Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"OH","state":"Ohio","fips":"39","features":[{"geoid":"3900142","name":"Aberdeen","full":"Aberdeen village","lsad":"village","polygons":[[[-837800,386849,29,-137,49,-130,29,-30,42,-23,155,-33,-2,29,-38,5,-55,25,-19,29,-4,18,12,17,-11,-3,-7,-52,-19,2,1,14,16,-1,-33,11,25,15,-5,17,-18,-2,26,13,-21,17,1,22,-21,-16,21,-18,-14,-10,-6,13,-14,-10,-8,14,16,7,-9,21,39,28,-7,29,13,9,-12,2,-10,-11,-12,8,18,25,-16,16,-16,1,22,27,-32,29,-16,0,0,31,-9,12,-27,-8,-14,14,-5,34,-45,48,-27,-9]]]},{"geoid":"3900198","name":"Ada","full":"Ada village","lsad":"village","polygons":[[[-838439,407620,16,0,0,-36,95,0,1,13,23,0,0,-13,24,0,0,14,48,1,0,-18,60,3,0,-14,-50,0,2,-22,83,0,1,146,25,-1,0,15,26,12,-51,-2,95,9,0,39,-53,0,-1,-16,-25,-1,0,17,-64,1,0,36,-142,3,0,-39,-43,-1,1,-33,40,0,1,-34,-112,-13]]]},{"geoid":"3900380","name":"Adamsville","full":"Adamsville village","lsad":"village","polygons":[[[-818845,400668,31,-5,6,45,-9,0,1,12,-13,-2,-8,-18,-6,0]]]},{"geoid":"3900436","name":"Addyston","full":"Addyston village","lsad":"village","polygons":[[[-847264,391421,79,-50,63,-65,49,19,3,20,1,-14,27,-8,-7,-13,21,0,14,-11,-8,-11,22,-5,43,-33,18,15,1,11,-40,37,11,8,-20,19,-62,29,5,7,-22,12,5,24,36,8,-2,12,-234,17,-2,-12]]]},{"geoid":"3900450","name":"Adelphi","full":"Adelphi village","lsad":"village","polygons":[[[-827507,394610,94,-5,6,79,-92,5,-1,-8]]]},{"geoid":"3900464","name":"Adena","full":"Adena village","lsad":"village","polygons":[[[-808888,402106,104,33,8,-16,46,-5,12,11,12,-3,5,18,43,3,0,11,-35,51,0,26,-18,6,-14,-6,-30,16,-35,3,32,-15,16,-19,-45,-46,-33,-5,-89,-36]]]},{"geoid":"3900541","name":"Ai","full":"Ai CDP","lsad":"CDP","cdp":true,"polygons":[[[-839469,416207,69,2,0,-18,50,1,-1,35,48,1,-2,19,30,0,-2,20,-28,15,-1,37,-36,0,-1,17,-62,8,0,9,-48,0,2,-72,-18,0]]]},{"geoid":"3901000","name":"Akron","full":"Akron city","lsad":"city","polygons":[[[-816190,411434,14,0,-1,-8,19,-14,13,-53,56,0,0,75,83,0,33,-8,0,15,38,1,-1,-16,24,1,0,-39,-15,-2,0,15,-28,-6,0,-32,43,10,0,-14,43,-1,-6,-78,-17,-5,-3,-32,-14,-1,-1,-45,-62,33,-1,50,57,7,-4,38,-14,-10,-17,1,-5,13,-18,8,-1,-51,-23,0,11,-73,-99,1,1,22,-13,0,0,-97,12,-23,37,-22,-1,-66,57,15,0,-15,39,0,10,-12,0,-56,62,-1,0,-41,-22,0,-5,-9,27,0,-10,-496,70,-1,0,-16,47,0,-8,-29,17,-4,-2,-83,-15,5,-6,-18,29,1,27,-23,0,-51,59,0,-1,-12,37,-9,0,27,26,-20,39,-13,-2,10,15,8,-36,15,3,10,38,-8,27,17,-19,8,28,11,79,-1,29,10,10,16,41,-5,-1,-15,-40,2,-7,-38,47,-1,16,26,0,26,49,-10,11,-15,22,-3,4,16,134,-10,-1,-35,-19,8,0,-23,-4,9,-16,3,-1,-19,-11,1,-1,43,-43,0,0,-44,-19,-2,3,-71,63,0,-1,-74,44,0,-6,-53,110,-2,0,27,13,29,-33,0,0,46,40,-7,0,34,25,0,1,73,-69,0,-1,30,29,1,1,25,-28,0,0,16,-43,2,28,7,4,26,140,5,-1,-14,-10,0,10,-18,0,-21,-11,-2,3,-32,12,-10,188,-1,8,41,3,-41,84,-1,16,-8,12,8,62,0,7,2,-4,104,7,3,4,120,10,0,0,-10,20,-1,0,-9,56,-1,-14,20,27,-11,70,3,6,-8,38,-1,0,-6,10,7,60,-2,2,35,7,-1,0,53,23,4,0,43,11,-8,14,18,21,-12,2,51,29,-4,4,19,28,-4,-4,-19,57,-7,1,44,-81,0,-2,-12,-29,4,-1,14,27,0,-13,14,-15,0,0,17,-36,0,-7,-7,0,22,-19,0,-1,-26,-17,0,2,21,-47,6,-21,-10,-3,-10,21,-6,-38,-32,-16,6,1,44,52,8,7,178,-283,6,1,23,33,22,29,0,0,33,-152,4,9,256,-7,0,-1,-19,-228,5,-10,24,-28,-14,-29,4,-2,25,-16,17,-29,7,-22,-8,-47,1,-18,13,-108,0,-2,116,-29,15,5,13,-11,4,0,-20,15,-12,-58,2,0,34,-11,0,-6,22,17,1,-9,0,-2,12,-34,0,-8,-66,-47,1,0,21,15,9,1,36,17,13,27,0,-4,68,65,14,27,-9,0,-23,-15,0,0,-51,14,7,1,18,47,-1,-1,-24,23,0,-7,21,18,0,1,47,-33,-1,4,74,46,1,-1,24,40,-1,5,35,-27,1,0,19,-78,2,-34,-27,-7,-44,5,-6,-73,2,-9,-24,21,-10,0,-24,-36,0,-9,-20,-9,0,-3,-54,-12,0,1,54,-15,0,-4,-34,-48,1,0,-39,10,1,-2,-24,8,-10,-44,-13,6,-10,19,-4,-46,-10,-3,8,-16,-3,6,-13,-5,-3,-16,0,-9,21,18,20,-15,11,-31,-8,-2,15,-35,18,-8,-9,-10,5,17,19,-16,5,7,19,-20,0,-5,11,-20,-11,-28,3,16,9,-15,24,93,1,0,-50,28,-7,-1,-9,22,-8,10,19,-17,19,19,0,23,36,77,1,0,59,-33,-30,-17,4,6,20,23,-7,1,27,42,7,-3,22,-83,1,0,-29,-39,0,1,43,-59,1,1,74,-52,-1,-20,-9,-56,-6,-11,5,-23,-19,-4,-15,-30,-1,1,-23,28,-44,1,-34,56,-69,-15,0,0,-46,-133,0,1,10,-25,0,0,37,-23,4,-63,-1,1,-49,-38,0,1,12,12,4,-46,3,-1,11,-33,0,1,-33,-42,0,0,10,-19,0,0,-10,-76,-3,1,8,-37,0]]]},{"geoid":"3901042","name":"Albany","full":"Albany village","lsad":"village","polygons":[[[-822098,392155,192,-10,14,151,94,-2,3,27,-75,4,2,24,-49,8,9,11,-1,25,-30,-33,-19,-61,-20,2,6,10,-36,-6,6,7,-11,-9,-31,12,2,-11,-42,2,-8,-92]]]},{"geoid":"3901154","name":"Alexandria","full":"Alexandria village","lsad":"village","polygons":[[[-826192,400921,40,-23,-3,-34,26,-6,21,10,62,-4,2,17,-38,43,-2,-37,-23,12,9,37,-21,1,-22,-16,6,23,-33,11,-2,-24,-20,-4]]]},{"geoid":"3901210","name":"Alger","full":"Alger village","lsad":"village","polygons":[[[-838494,407057,25,-1,0,-21,72,5,-4,37,-13,0,-8,91,-48,0,1,-91,-13,0,13,-14]]]},{"geoid":"3901420","name":"Alliance","full":"Alliance city","lsad":"city","polygons":[[[-811625,408923,74,0,3,-55,23,-1,0,13,42,26,-6,74,36,0,0,27,17,0,0,-23,37,1,0,-13,19,0,0,-29,10,5,0,24,29,8,0,21,22,0,1,-18,23,0,2,-41,15,0,1,-62,43,8,82,39,1,-16,16,0,0,-13,-16,0,0,-33,94,-2,0,35,5Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"OK","state":"Oklahoma","fips":"40","features":[{"geoid":"4000100","name":"Achille","full":"Achille town","lsad":"town","d":5,"polygons":[[[-9641506,3385190,115,-227,-4,-764,15,-137,99,-145,263,-92,807,0,179,-34,388,-260,-1,-418,79,-65,337,-3,1,69,1101,-16,154,-86,47,-119,8,-1606,61,-163,129,-125,111,-52,35,-2,-192,114,-123,229,-7,1606,-102,175,-116,47,-223,7,0,706,-287,2,91,187,161,173,246,172,95,86,132,185,585,1835,7,245,-50,-327,-569,-1752,-186,-236,-255,-179,-123,-114,-62,-79,-94,-195,-1000,5,10,-294,-308,215,-119,57,-140,19,-808,0,-253,89,-98,142,-20,973,-27,60,-111,120,-125,52]]]},{"geoid":"4000200","name":"Ada","full":"Ada city","lsad":"city","polygons":[[[-967574,346948,58,-2,596,-2,46,-3,3,-1305,-334,6,-2,-148,4,0,2,144,333,-6,0,292,200,-2,0,4,141,-1,1,-30,-8,-246,149,-6,32,1,-5,-152,-1,-359,-4,-13,-1,-57,-845,8,5,386,-4,0,-6,-388,854,-10,5,66,-4,5,6,103,-4,41,4,218,4,158,-109,-1,-71,4,3,108,1,271,3,42,0,68,-4,75,91,3,37,-6,50,-2,174,1,0,732,523,1,2,434,-5,876,-604,-3,-1,142,-611,3,-349,-2,-86,3,-265,1,2,-538,-4,-1,-1,-28,1,-13,3,0,2,-313,-7,-414],[-967044,348394,168,1,-35,-57,-22,-31,-11,-31,0,-22,5,-53,5,-2,-110,0,0,54],[-966929,348298,64,97,253,-2,0,-141,-86,0,0,-54,-176,1,0,15,-41,0,3,-15,-15,5,-9,49],[-966700,347534,17,0,29,-8,-7,15,0,22,15,-22,16,0,0,-15,9,0,0,15,9,1,17,-3,-15,2,0,-10,14,-5,0,-73,-16,0,0,-36,-88,0,2,87,-2,18],[-966608,348250,179,0,36,-3,48,2,87,0,86,2,-1,-327,-174,-1,0,38,-88,0,1,6,-12,-6,-121,1,0,-19,-23,1,0,17,-22,1],[-966608,348393,346,-2,-1,-138,-105,-1,-28,-3,-35,3,-177,1],[-966868,345928,-3,1016,-83,3,-563,1,-53,2,-1,143,6,291,1,126,-2,596,256,-3,1,-48,22,0,0,-18,37,0,0,71,-60,-2,-239,2,-17,12,-2,279,520,-5,0,-286,-67,1,-1,-18,-22,0,1,-19,21,0,1,-36,67,-1,-1,-70,-2,-1,1,-186,47,18,6,-32,12,0,-1,-14,-35,13,50,-24,-19,-28,19,25,26,8,-1,-31,16,0,13,-13,-6,-8,0,-20,-6,1,-1,-37,-21,1,-1,-31,29,-18,47,0,0,-20,19,-17,63,-23,51,-2,41,8,0,-21,-41,7,-42,1,0,2,-29,5,-18,6,-44,23,1,-175,89,-1,1,119,64,0,0,5,-64,0,0,11,42,1,43,-5,0,-58,-2,-37,-4,0,-13,-24,2,-27,10,-20,96,-2,0,-36,44,-1,1,37,41,6,77,30,-74,1,-2,38,-20,0,0,34,-43,0,-1,34,35,0,38,-34,4,0,52,-51,24,-16,17,7,-4,5,35,-15,0,-18,21,0,0,51,-62,0,-40,44,33,30,1,89,12,0,0,37,74,0,0,-18,23,0,0,34,-19,3,2,109,43,-1,1,10,15,9,23,0,2,11,-10,6,-22,37,114,-1,2,-517,-174,0,0,-2,176,2,-1,-62,-149,1,1,-1,146,-1,3,-5,3,1022,48,-3,463,4,5,-726,1,-400,-3,-36,3,-143,-524,-1,0,-731,-172,-1,-50,2,-37,4,-94,0,4,-76,-1,-71,-91,1,-1,-51,-20,-30,-16,-14,-14,-5,0,-49]]],"label":[-96.68715502816997,34.6581]},{"geoid":"4000250","name":"Adair","full":"Adair town","lsad":"town","polygons":[[[-952918,364236,376,1,0,133,425,0,0,9,63,0,0,10,-488,-1,-1,134,-375,0]]]},{"geoid":"4000300","name":"Adams","full":"Adams CDP","lsad":"CDP","cdp":true,"polygons":[[[-1010797,367473,92,0,-2,146,-90,0]]]},{"geoid":"4000350","name":"Adamson","full":"Adamson CDP","lsad":"CDP","cdp":true,"polygons":[[[-955523,349239,18,0,11,-32,67,-4,-1,72,-119,-1]]]},{"geoid":"4000450","name":"Addington","full":"Addington town","lsad":"town","polygons":[[[-979694,342379,45,0,4,40,45,0,0,27,-49,0,0,36,-45,0,0,-36]]]},{"geoid":"4000600","name":"Afton","full":"Afton town","lsad":"town","polygons":[[[-949846,366852,144,0,0,-18,24,0,0,17,22,0,0,13,22,0,0,-31,45,0,0,27,10,9,46,0,1,19,-23,0,1,42,9,-5,0,17,-13,-7,-13,34,96,28,202,-2,-1,125,-322,-151,-36,0,-1,28,66,-1,0,36,-157,1,0,-38,-54,0,0,-17,-36,0,1,-43,77,2,0,-46,-23,-11,-7,10]]]},{"geoid":"4000700","name":"Agra","full":"Agra town","lsad":"town","polygons":[[[-968769,358912,134,0,2,74,-102,8,-36,-8]]]},{"geoid":"4000900","name":"Akins","full":"Akins CDP","lsad":"CDP","cdp":true,"polygons":[[[-947080,354781,539,0,16,19,19,-2,19,23,11,-10,12,15,-12,17,-22,11,23,5,-3,16,41,36,-15,1,1,11,23,24,11,4,55,-17,8,23,19,5,-9,8,3,14,32,13,12,13,1,60,30,31,-13,24,4,23,19,24,56,43,-248,1,14,8,-13,6,-26,42,33,37,-19,11,-34,-24,33,35,16,41,-1,26,-111,0,0,-33,-16,-23,-24,-9,-11,-21,-27,-18,-61,-16,-22,-62,-193,0,-1,91,-42,15,-52,-86,3,-24,-15,-23,-63,-25]]]},{"geoid":"4000950","name":"Albany","full":"Albany CDP","lsad":"CDP","cdp":true,"polygons":[[[-961816,338812,71,1,0,-16,-49,-97,23,-34,128,0,-1,-85,53,-20,-34,-16,23,-11,42,25,22,-3,39,-23,28,-1,3,206,-15,12,14,36,-12,3,-1,12,14,22,9,47,-8,9,3,110,-12,24,-27,17,0,-22,-17,-15,-1,-30,-26,-28,-37,-9,-32,3,-24,-14,0,42,-66,1,-34,-74,-21,-10,-11,-40,-39,-14]]]},{"geoid":"4001050","name":"Albion","full":"Albion town","lsad":"town","polygons":[[[-951039,346587,88,0,0,74,-66,0,0,-18,-23,1]]]},{"geoid":"4001150","name":"Alderson","full":"Alderson town","lsad":"town","polygons":[[[-956968,349008,0,-14,-11,-9,21,0,0,-36,34,0,0,18,44,0,1,22,131,-28,-3,34,-41,7,0,19,-15,0,0,-10,-14,0,0,11,-37,0,0,17,-66,1,0,17,-44,1,0,14,-23,0,0,-37,-21,9,0,-15]]]},{"geoid":"4001250","name":"Alex","full":"Alex town","lsad":"town","polygons":[[[-977939,348987,352,0,-1,483,-351,-1,0,-219]]]},{"geoid":"4001350","name":"Aline","full":"Aline town","lsad":"town","polygons":[[[-984529,365048,14,17,35,-12,36,1,0,84,-84,0,-2,-32]]]Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"OR","state":"Oregon","fips":"41","features":[{"geoid":"4100275","name":"Adair Village","full":"Adair Village city","lsad":"city","polygons":[[[-1232224,446688,50,7,6,-42,-41,-7,14,-13,57,-13,41,40,18,45,-63,0,-19,18,25,80,-49,8,18,-14,-12,-17,-20,0,-19,-41]]]},{"geoid":"4100350","name":"Adams","full":"Adams city","lsad":"city","polygons":[[[-1185703,457653,14,-44,66,0,68,75,-36,2,14,17,-125,5]]]},{"geoid":"4100500","name":"Adrian","full":"Adrian city","lsad":"city","polygons":[[[-1170758,437371,80,0,22,27,0,45,-101,1]]]},{"geoid":"4101000","name":"Albany","full":"Albany city","lsad":"city","polygons":[[[-1231474,446663,45,-6,2,-150,72,-2,0,-12,-45,0,0,-24,-51,-1,13,-44,52,8,46,-12,118,-3,2,-29,23,-1,15,-24,24,-4,0,-11,-39,-21,-46,-7,-5,13,-26,-27,-26,21,-15,-5,-9,-20,18,-19,-21,-16,-3,-12,-19,-11,-25,3,-6,-6,21,-20,17,9,44,-17,20,-30,-26,-3,27,-39,-14,-16,22,-25,-7,-10,23,2,-4,-31,-78,-23,-10,-55,2,-11,86,-3,-2,-24,46,0,-1,-34,-24,-2,-5,-26,32,-1,11,-15,-1,-93,228,1,1,66,-29,0,0,80,-81,0,0,51,52,1,-1,17,103,1,26,13,39,-3,0,-28,67,-1,0,-26,-62,1,-1,-33,-68,0,0,-50,130,-1,0,57,172,0,0,41,-68,22,0,77,67,0,4,87,63,0,0,43,-13,10,48,0,0,37,-35,17,-22,-4,0,33,-13,10,13,6,40,-3,-15,-16,32,-5,0,-15,17,0,8,-34,19,-8,0,26,16,0,-9,76,-9,0,0,21,-31,0,-12,11,0,34,42,9,1,44,0,-82,50,0,7,-62,19,0,0,25,24,0,0,63,31,0,0,28,16,29,-47,-2,1,10,53,21,4,25,-12,12,7,13,-53,3,-52,19,-49,-5,-31,17,-16,0,1,-28,-36,0,-2,41,-20,0,0,11,-13,0,-12,-88,19,-44,-35,2,-4,-10,-29,-5,-23,11,-17,-15,-35,9,-46,29,-222,-67,-49,-7,-12,16,0,13,33,58,19,-8,43,33,24,3,41,26,-6,42,-7,-19,-37,4,15,3,-8,25,-60,0,6,31,-15,0,-8,-16,-40,-5,-3,-29,-39,0,-3,28,-110,52,14,91,-43,4,0,19,-53,0,0,-32,-75,0,-1,9,-75,-6,5,-47,-23,0]]]},{"geoid":"4101650","name":"Aloha","full":"Aloha CDP","lsad":"CDP","cdp":true,"polygons":[[[-1229051,455030,30,0,0,-27,-14,-1,33,-4,-13,-22,98,-13,-99,9,99,-10,-3,-67,-31,-168,26,-63,16,12,176,45,58,32,0,-81,157,-3,0,79,107,2,-7,3,-1,157,-101,11,-11,49,8,26,1,104,-45,25,-46,9,-6,-17,-95,8,13,12,26,-8,0,9,-17,5,0,18,-8,2,-109,-12,-182,1,0,-13,-26,0,-4,-98,-30,0]]]},{"geoid":"4101700","name":"Alpine","full":"Alpine CDP","lsad":"CDP","cdp":true,"polygons":[[[-1233742,443243,72,-2,0,-20,17,2,40,22,1,7,85,13,20,50,49,16,-59,15,-81,0,-1,30,-72,-12,-50,0,-12,-45,3,-24,19,-1,-32,-17]]]},{"geoid":"4101800","name":"Alsea","full":"Alsea CDP","lsad":"CDP","cdp":true,"polygons":[[[-1236001,443822,-18,-10,1,-12,45,4,34,-18,26,5,1,43,7,3,-132,-8]]]},{"geoid":"4101850","name":"Altamont","full":"Altamont CDP","lsad":"CDP","cdp":true,"polygons":[[[-1217570,421857,178,-118,66,7,10,65,40,34,21,-1,0,-20,78,-1,0,23,-24,10,52,-9,6,-37,-34,0,-1,-73,98,-4,0,61,11,9,82,15,15,38,30,19,-13,26,-22,19,143,1,0,78,-51,-31,-46,16,-20,-6,13,21,-56,16,-6,56,-12,5,-22,31,-4,32,7,0,-23,36,-45,37,-13,-13,-18,-1,0,14,-48,0,0,-19,-30,9,-31,-6,11,53,-48,1,0,-75,-200,0,12,-10,-20,5,-14,-12,5,-28,-13,-49,-32,0,13,-15,-28,-1,5,-38,23,0,2,-33,-25,0,0,-16,-11,-5,11,2,-1,-7,-20,0,0,-11,25,0,-3,-11,-22,0,0,-23,14,-7,-16,1]]]},{"geoid":"4102000","name":"Amity","full":"Amity city","lsad":"city","polygons":[[[-1232143,451145,20,-13,56,-4,11,-23,-13,-8,15,-12,38,-3,25,-47,3,92,26,27,0,20,36,3,0,16,-74,1,-7,37,-38,0,0,-15,-5,14,-22,0,-4,-32,-31,0,-20,-40]]]},{"geoid":"4102200","name":"Annex","full":"Annex CDP","lsad":"CDP","cdp":true,"polygons":[[[-1170118,442410,-5,-48,58,1,3,-102,84,-20,49,-24,4,-13,38,-13,24,3,0,44,25,-22,65,26,9,12,-13,23,15,16,0,59,41,-3,-14,51,-24,28,-110,27,-290,-1]]]},{"geoid":"4102250","name":"Antelope","full":"Antelope city","lsad":"city","polygons":[[[-1207298,449058,125,0,0,109,-125,0]]]},{"geoid":"4102800","name":"Arlington","full":"Arlington city","lsad":"city","polygons":[[[-1202116,457091,50,-2,-1,-36,206,0,0,26,-52,29,2,90,52,1,0,-16,28,-14,16,-20,19,-5,23,11,1,-21,19,-9,21,6,-9,-21,30,-12,59,-44,15,1,43,32,10,17,-2,14,-31,32,-36,18,0,103,-187,0,-20,-19,1,93,-54,-57,2,147,-204,-176]]]},{"geoid":"4103050","name":"Ashland","full":"Ashland city","lsad":"city","polygons":[[[-1227360,422126,32,-6,12,-12,2,-163,30,0,-9,-91,13,-73,346,1,-1,-20,55,1,24,-8,4,-25,69,-2,0,22,11,-2,5,-39,-16,-20,29,-17,47,0,-1,78,31,-12,-12,24,22,-14,2,-12,34,3,-9,74,30,-46,-15,0,14,-32,-9,-6,33,10,49,29,27,0,-41,54,4,5,21,-11,-1,15,-34,0,-8,8,26,1,0,59,-9,15,-29,-1,-10,9,-5,-16,-45,44,-18,-4,50,-57,-9,-6,-15,16,-7,-3,0,-35,-24,-6,-49,17,0,47,-19,9,-31,0,-1,-24,-32,0,0,-35,28,-14,-22,7,-64,34,0,53,-56,0,0,34,-74,10,0,108,-18,10,-107,0,4,15,-10,16,9,0,-56,4,0,13,-46,0,0,-48,-54,-1,-66,34,-6,-14,-21,6,2,-5]]]},{"geoid":"4103150","name":"Astoria","full":"Astoria city","lsad":"city","polygons":[[[-1238666,461877,67,-73,163,-89,52,-4,0,-11,131,17,34,-11,109,-1,1,40,27,1,-1,29,391,-5,1,175,34,-4,50,-21,10,7,32,-11,63,-67,39,-25,70,0,-24,36,11,18,-26,40,-28,7,-34,38,-21,-5,-38,75,-102,-21,13,-29,-53,8,5,34,-24,14,-118,-54,-386,-82,-244,24,-87,-42,-29,23,-64,-13]]]},{"geoid":"4103200","name":"Athena","full":"Athena city","lsad":"city","polygons":[[[-1185046,458051,56,22,17,-9,0,17,Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"PA","state":"Pennsylvania","fips":"42","features":[{"geoid":"4200100","name":"Aaronsburg","full":"Aaronsburg CDP","lsad":"CDP","cdp":true,"polygons":[[[-774577,408935,16,24,66,14,93,39,-1,8,-21,-8,-7,124,-186,-55]]]},{"geoid":"4200104","name":"Aaronsburg","full":"Aaronsburg CDP","lsad":"CDP","cdp":true,"polygons":[[[-800097,400093,35,-5,39,-58,16,10,23,-6,-1,-15,16,7,8,57,24,23,1,29,-13,17,16,21,-43,7,-152,-71]]]},{"geoid":"4200116","name":"Abbottstown","full":"Abbottstown borough","lsad":"borough","polygons":[[[-769965,398772,76,10,1,44,109,7,5,20,-27,13,-6,29,-12,18,-159,-57,-3,-22]]]},{"geoid":"4200244","name":"Ackermanville","full":"Ackermanville CDP","lsad":"CDP","cdp":true,"polygons":[[[-752281,408225,39,-8,40,23,94,21,-20,28,16,5,-15,10,4,23,-21,16,-3,54,-20,38,-33,12,-5,19,-63,28,-6,18,-40,-10,7,-15,27,-12,12,-29,-57,-18]]]},{"geoid":"4200276","name":"Acosta","full":"Acosta CDP","lsad":"CDP","cdp":true,"polygons":[[[-790682,401050,51,53,-34,2,-5,22,-34,2,3,28,-41,0,0,-25,16,-3,-17,-63]]]},{"geoid":"4200332","name":"Adamsburg","full":"Adamsburg borough","lsad":"borough","polygons":[[[-796619,403115,104,-24,52,5,16,32,-31,12,-23,-16,-20,18,-16,-12,-27,33,-21,-4,-25,6,-13,-10]]]},{"geoid":"4200364","name":"Adamstown","full":"Adamstown borough","lsad":"borough","polygons":[[[-760765,402370,11,3,3,-18,23,-25,16,32,28,-9,9,10,122,-37,113,119,-1,48,-54,13,-57,-34,-194,-1,-17,-6,4,-48,-10,-1]]]},{"geoid":"4200372","name":"Adamsville","full":"Adamsville CDP","lsad":"CDP","cdp":true,"polygons":[[[-803779,415084,0,-11,88,-1,0,-15,38,-1,-11,106,-96,-3,-1,-24,-15,0,-2,-37,-35,-10]]]},{"geoid":"4200396","name":"Addison","full":"Addison borough","lsad":"borough","polygons":[[[-793503,397494,9,-11,71,-19,29,-30,73,-26,22,-28,31,13,8,13,13,-12,17,13,-32,37,-17,53,-29,-25,-68,35,-28,-13,-57,14,-7,-14,-32,7]]]},{"geoid":"4200540","name":"Akron","full":"Akron borough","lsad":"borough","polygons":[[[-762177,401561,10,6,94,-8,7,-22,-21,-41,8,-5,-3,-25,-15,0,-2,-12,21,4,4,29,7,-16,21,2,11,11,17,-7,2,17,28,15,97,27,9,-5,19,59,-34,-6,-50,14,-3,37,-25,20,12,-29,-35,-4,-11,17,-10,-19,-8,12,-23,1,1,13,-21,52,-42,-7,-15,-41,-26,-2,5,-13,-20,-13,9,-11,-17,-9,15,-21,-32,-5]]]},{"geoid":"4200572","name":"Alba","full":"Alba borough","lsad":"borough","polygons":[[[-768345,416991,139,2,-1,134,-140,-1]]]},{"geoid":"4200628","name":"Albion","full":"Albion borough","lsad":"borough","polygons":[[[-803748,418832,216,2,-2,142,-214,-1]]]},{"geoid":"4200652","name":"Albrightsville","full":"Albrightsville CDP","lsad":"CDP","cdp":true,"polygons":[[[-756214,410127,37,-19,1,-9,57,-36,23,-40,35,-17,53,69,95,92,-5,13,-52,3,-55,-14,-56,15,-145,-39]]]},{"geoid":"4200660","name":"Alburtis","full":"Alburtis borough","lsad":"borough","polygons":[[[-756104,405059,40,15,42,-51,28,6,14,-13,76,45,14,0,-40,81,-131,5,-38,-15,12,-25,-36,-18]]]},{"geoid":"4200676","name":"Aldan","full":"Aldan borough","lsad":"borough","polygons":[[[-752960,399171,33,-18,174,79,-53,21,-46,2,27,52,-9,11,-103,-76,-51,-27]]]},{"geoid":"4200756","name":"Alexandria","full":"Alexandria borough","lsad":"borough","polygons":[[[-781061,405597,67,-31,33,-14,21,27,-41,19,-9,-11,-53,34]]]},{"geoid":"4200764","name":"Alfarata","full":"Alfarata CDP","lsad":"CDP","cdp":true,"polygons":[[[-774621,406594,50,-51,40,-2,48,84,-6,24,-15,10,-12,30,-97,-13,1,-14,-28,-28]]]},{"geoid":"4200820","name":"Aliquippa","full":"Aliquippa city","lsad":"city","polygons":[[[-802891,406038,33,31,10,-17,25,7,75,-50,40,26,85,8,2,-12,48,0,24,-53,17,0,15,54,-7,26,54,8,27,23,0,10,18,0,12,-151,35,-100,28,4,-16,137,36,273,-1,56,-25,10,-49,50,-22,53,-3,27,-14,5,-26,44,-34,-13,32,-48,3,-107,12,-19,-14,-8,1,-12,-21,0,-30,13,-8,-6,8,-48,-16,-20,-89,-23,-3,-15,-87,-27,-67,7,-34,-17,-9,17,-30,-11,-22,32,-21,-28,34,-23,10,-21,-24,-29,-46,-19]]]},{"geoid":"4200924","name":"Alleghenyville","full":"Alleghenyville CDP","lsad":"CDP","cdp":true,"polygons":[[[-759980,402374,48,-30,-38,-81,19,-27,-11,-10,9,-8,49,9,39,-15,10,14,18,3,26,-10,110,16,74,17,-8,35,35,-4,82,27,-14,62,-33,8,-12,19,-2,26,-200,-16,-38,11,-16,21,-48,1,-3,-43,-93,-14]]]},{"geoid":"4200980","name":"Allenport","full":"Allenport CDP","lsad":"CDP","cdp":true,"polygons":[[[-778809,403649,43,1,30,-20,64,-9,33,-15,31,11,37,-6,20,16,7,20,-42,13,-26,38,-47,25,-36,43,-13,-3,-42,32,23,-28,-15,-16,-13,4,-1,24,-22,6,-70,-109]]]},{"geoid":"4200988","name":"Allenport","full":"Allenport borough","lsad":"borough","polygons":[[[-798771,400809,83,-7,98,13,26,-41,37,10,-46,66,4,9,75,19,71,-36,24,37,9,27,-3,19,-108,215,-120,-193,-40,-36,-110,-12,-24,-49]]]},{"geoid":"4201004","name":"Allensville","full":"Allensville CDP","lsad":"CDP","cdp":true,"polygons":[[[-778308,405384,79,-78,-20,-18,93,-108,103,54,93,68,-63,45,14,20,-127,94,-93,-43,-46,44,-19,-14,8,-41]]]},{"geoid":"4202000","name":"Allentown","full":"Allentown city","lsad":"city","polygons":[[[-755255,405922,15,11,17,-35,-26,-5,-2,-8,6,-7,30,6,-18,-31,14,-42,24,6,25,20,57,-12,83,16,18,2,19,16,17,7,7,9,12,-4,54,17,10,-17,Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"PR","state":"Puerto Rico","fips":"72","features":[{"geoid":"7200186","name":"Aceitunas","full":"Aceitunas comunidad","lsad":"comunidad","cdp":true,"polygons":[[[-670737,184460,21,2,2,-53,25,10,11,16,18,-8,3,-13,12,1,15,10,-4,52,13,37,-10,-7,-14,5,-14,-33,-20,10,-7,-23,-20,-2,-21,8]]]},{"geoid":"7200358","name":"Adjuntas","full":"Adjuntas zona urbana","lsad":"zona urbana","cdp":true,"polygons":[[[-667316,181624,8,-7,97,-61,38,23,9,34,0,71,-143,16,-7,-9]]]},{"geoid":"7200616","name":"Aguada","full":"Aguada zona urbana","lsad":"zona urbana","cdp":true,"polygons":[[[-671853,183772,13,8,26,-2,38,30,5,23,-51,-11,-23,-21,-15,18,4,11,-19,11,-9,-21,-32,13,-6,-5,5,-17,-80,20,-6,-21]]]},{"geoid":"7200745","name":"Aguadilla","full":"Aguadilla zona urbana","lsad":"zona urbana","cdp":true,"polygons":[[[-671641,184577,23,-29,11,-71,39,-78,4,-40,12,-27,-8,-44,6,-44,-19,-66,-28,-22,15,-9,-1,-10,-19,-9,-16,-26,27,1,31,22,-12,-31,-11,4,-6,-15,22,-7,0,-23,-9,-8,5,-13,16,-12,8,-24,15,-2,-20,-9,9,-13,-16,-14,0,-23,27,14,14,284,35,70,7,117,6,17,23,10,12,-3,0,16,-47,155,2,21,-51,-10,-12,1,-3,8,-26,-12,-26,-34,-26,-4]]]},{"geoid":"7200874","name":"Aguas Buenas","full":"Aguas Buenas zona urbana","lsad":"zona urbana","cdp":true,"polygons":[[[-661164,182484,12,4,24,-16,28,24,26,-20,16,2,81,112,-22,20,-28,-8,-1,-6,-13,6,17,14,9,-7,10,14,52,15,-11,15,-3,25,-35,-12,-70,4,-20,-19,10,-14,4,-35,-45,-11,-21,-32,10,-25,-25,-20]]]},{"geoid":"7201003","name":"Aguas Claras","full":"Aguas Claras comunidad","lsad":"comunidad","cdp":true,"polygons":[[[-656788,182299,7,-25,57,0,24,12,-1,-9,77,61,76,103,41,90,30,25,-40,6,-21,15,-8,-5,-14,15,-47,3,-30,-18,-28,4,-55,24,-14,-18,3,-11,-24,-25,12,-57,-41,-83,-4,-40]]]},{"geoid":"7201089","name":"Aguilita","full":"Aguilita comunidad","lsad":"comunidad","cdp":true,"polygons":[[[-665424,180315,35,-60,-18,-26,27,0,37,-18,78,4,13,31,-9,33,23,11,0,15,21,-3,-8,17,-18,7,-14,-15,-18,2,-27,29,12,5,-106,10,-28,-29]]]},{"geoid":"7201218","name":"Aibonito","full":"Aibonito zona urbana","lsad":"zona urbana","cdp":true,"polygons":[[[-662807,181397,42,-35,23,3,10,-15,115,-44,27,37,38,-11,12,-13,13,41,16,22,-7,19,17,9,-16,13,-51,8,7,14,-38,4,-31,-7,-2,9,-19,3,-3,-13,-28,3,-8,17,-63,55,-16,-22,10,-15,-21,-2,-17,-25,12,-21,-10,-26]]]},{"geoid":"7201863","name":"Alianza","full":"Alianza comunidad","lsad":"comunidad","cdp":true,"polygons":[[[-668656,184522,22,2,-4,-42,48,5,-2,-52,87,3,-9,29,10,46,23,11,1,23,-6,-1,3,33,-33,3,1,28,36,3,-11,24,-52,2,-37,-30,-14,2,1,-28,-9,0,-1,-28,-39,4,0,-18,-16,-1]]]},{"geoid":"7202680","name":"Añasco","full":"Añasco zona urbana","lsad":"zona urbana","cdp":true,"polygons":[[[-671485,182837,-18,-32,9,-61,31,35,10,-3,39,30,36,-3,22,8,-4,34,-6,3,17,18,12,44,4,-3,19,30,-41,47,-38,-27,-23,-61,-33,-27,5,-6,-25,-15,-39,-2]]]},{"geoid":"7203024","name":"Animas","full":"Animas comunidad","lsad":"comunidad","cdp":true,"polygons":[[[-666408,184434,83,-19,-7,45,-12,-1,8,52,-10,-1,-5,-13,-46,-6,4,-14,-13,-29]]]},{"geoid":"7203174","name":"Anon Raices","full":"Anon Raices comunidad","lsad":"comunidad","cdp":true,"polygons":[[[-665871,181378,26,-3,22,-15,-2,32,-40,17,-33,-1]]]},{"geoid":"7203196","name":"Antón Ruíz","full":"Antón Ruíz comunidad","lsad":"comunidad","cdp":true,"polygons":[[[-658136,181835,39,6,52,-20,14,69,1,36,-15,16,10,28,-73,-70,-43,-8]]]},{"geoid":"7203368","name":"Arecibo","full":"Arecibo zona urbana","lsad":"zona urbana","cdp":true,"polygons":[[[-667690,184324,11,-50,1,-116,-18,-63,60,40,50,5,4,-13,64,-10,44,42,68,-4,3,-9,26,11,43,-9,-1,61,9,9,12,-12,18,1,4,-8,112,21,43,-57,-3,14,9,22,-23,53,24,-2,-8,30,-26,-4,-10,17,39,53,15,1,-93,249,19,57,16,14,20,-7,80,28,-1,6,43,15,56,36,8,9,-5,16,54,9,67,-10,77,-52,50,56,6,33,60,15,0,16,-15,13,5,17,-23,2,-57,-16,-2,21,-83,-62,-80,-2,-65,20,-19,-3,0,-55,-39,-43,-58,-9,-111,35,-92,-11,-25,-9,-66,5,-103,29,-154,69,-30,-56,-3,-71,-9,-20,10,-76,9,2,-3,-100,-7,-77,-24,-80]]]},{"geoid":"7203927","name":"Arroyo","full":"Arroyo zona urbana","lsad":"zona urbana","cdp":true,"polygons":[[[-660700,179664,25,-10,42,-48,74,-20,-5,43,41,-2,16,26,-4,80,-30,12,-44,0,9,32,54,6,7,62,-42,-3,-2,-7,-11,5,-11,-20,-28,0,3,-28,-16,-41,-69,26,18,-54,-29,3,-7,-14]]]},{"geoid":"7204620","name":"Bairoa La Veinticinco","full":"Bairoa La Veinticinco comunidad","lsad":"comunidad","cdp":true,"polygons":[[[-660252,182615,94,30,-99,-5]]]},{"geoid":"7204658","name":"Bajadero","full":"Bajadero comunidad","lsad":"comunidad","cdp":true,"polygons":[[[-666868,184300,-5,-26,6,-21,-15,4,22,-27,-14,-12,17,6,21,-19,18,-44,5,-55,9,-11,52,-4,39,20,56,81,-28,31,-6,52,23,14,-34,38,39,6,-28,44,-102,-7,-18,9,-39,2,-3,-14,26,-5,2,-29,-28,-4,-12,10,-8,-16,-11,-2]]]},{"geoid":"7204701","name":"Bajandas","full":"Bajandas comunidad","lsad":"comunidad","cdp":true,"polygons":[[[-657880,181639,20,-44,-8,-55,15,-53,28,-3,23,24,-6,53,19,32,0,23,-13,7,18,51,-11,22,-21,11,-40,-24,-21,-26]]]},{"geoid":"7205217","name":"Barahona","full":"Barahona comunidad","lsad":"comunidad","cdp":true,"polygons":[Line truncated
|
||||
@@ -0,0 +1,49 @@
|
||||
# US Census Bureau places pack
|
||||
|
||||
City, town, village and census designated place (CDP) outlines for area
|
||||
annotations ("outline Austin", "outline Springfield, Illinois"), read by
|
||||
`src/data/placeBoundaries.js`. One file per state or territory, fetched when
|
||||
an ask needs that state (files under 4 KB are inlined into the app bundle by
|
||||
the bundler).
|
||||
|
||||
| File | Contents |
|
||||
|------|----------|
|
||||
| `index.json` | source, schema, curation, and each state's code, FIPS code, name, place count and box |
|
||||
| `<ST>.json` | the places of one state (USPS code) |
|
||||
| `files.js` | every file's URL, so bundlers emit them (generated) |
|
||||
|
||||
**Source:** U.S. Census Bureau cartographic boundary files,
|
||||
<https://www2.census.gov/geo/tiger/GENZ2025/shp/cb_2025_us_place_500k.zip>
|
||||
(SHA-256 `ce0e4019ecd4123d03d53aaa936eed0459b82e3e14b89a3dcd4d5e8b3308627d`).
|
||||
32,629 places in the 50 states, the District of Columbia, Puerto Rico and the
|
||||
Island Areas: 19,733 incorporated places and 12,896 CDPs.
|
||||
|
||||
**License:** public domain — a work of the U.S. Government (17 U.S.C. § 105).
|
||||
See DATA_SOURCES.md.
|
||||
|
||||
**Regenerate** (requires Python with shapely==2.1.2 on GEOS 3.13.1):
|
||||
`node scripts/build-census-places.mjs [--python <exe>]` downloads the pinned
|
||||
zip (to the system temp directory, or `--cache <dir>`), checks its SHA-256,
|
||||
rewrites the pack and runs `scripts/pack_geometry.py repair census`; the
|
||||
result is the same byte for byte. `python scripts/pack_geometry.py check
|
||||
census` checks the shipped pack.
|
||||
|
||||
**Schema:** each state file has `st`, `state`, `fips` and `features[]` with
|
||||
`geoid`, `name` (`NAME`), `alt[]` (everyday names of consolidated
|
||||
governments, e.g. "Nashville"), `full` (`NAMELSAD`), `lsad` (city, town,
|
||||
village, CDP, …), `cdp` (census designated place), `d` (decimals when not
|
||||
4) and `polygons`. `polygons` is a list of parts, largest first, each
|
||||
`[outer, ...holes]`; every ring is open and stored as integers in units of
|
||||
10^-4 degrees (10^-`d` when present), the first vertex absolute and each
|
||||
later one as a `[dLon, dLat]` delta. An optional `label: [lon, lat]` in degrees
|
||||
supplies a verified filled anchor when the outer-ring centroid is outside the
|
||||
place or inside a hole. Already-filled anchors and polygon coordinates are
|
||||
preserved. The final repair pass checks labels against degree-decoded geometry;
|
||||
interior labels are not rounded back onto the vertex grid.
|
||||
|
||||
**Curation:** the county pack's simplification (see
|
||||
`../us_census_counties/README.md`), keeping triangles. A place whose
|
||||
simplified rings would cross is simplified again at half the tolerance, then
|
||||
at 5 or 6 decimals. Every place is then a valid MultiPolygon under GEOS in
|
||||
the pack's integer units (the rest are repaired and snapped back to the
|
||||
grid), with its largest part first.
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"RI","state":"Rhode Island","fips":"44","features":[{"geoid":"4403520","name":"Ashaway","full":"Ashaway CDP","lsad":"CDP","cdp":true,"polygons":[[[-717984,414089,97,21,202,28,-121,77,20,21,80,9,-16,58,-39,59,8,17,-37,70,-33,0,-45,-15,0,-28,-62,-43,-15,-22,-22,30,-10,-202,15,-10,2,-12,-10,-33,-16,-13]]]},{"geoid":"4408020","name":"Bradford","full":"Bradford CDP","lsad":"CDP","cdp":true,"polygons":[[[-717749,413820,1,-13,122,-18,-3,-5,9,8,32,94,78,52,12,-10,9,-1,107,8,65,-35,8,3,-4,82,-23,2,-15,10,42,8,-74,-2,-16,14,-22,-4,-33,10,-15,11,-14,18,4,15,-26,11,-46,2,-8,-3,-23,-36,-31,-24,-20,-4,-12,-27,-15,-18,14,-13,4,-35,-68,-53,-52,-12]]]},{"geoid":"4412340","name":"Carolina","full":"Carolina CDP","lsad":"CDP","cdp":true,"polygons":[[[-716769,414488,51,-38,36,2,105,54,33,5,52,-10,-16,13,7,21,-12,18,17,8,39,78,26,76,-6,13,8,26,1,49,10,9,-3,13,-28,2,-42,-19,-21,-30,-50,-5,-26,-22,-22,-5,-28,2,-6,-40,-17,-11,9,-46,-34,9,2,-31,-11,-21,-22,3,-27,-31,-11,-48,-11,-11]]]},{"geoid":"4414140","name":"Central Falls","full":"Central Falls city","lsad":"city","polygons":[[[-714037,418811,227,30,8,38,-16,5,-13,15,16,33,-2,39,-46,25,-20,2,-164,-50,-24,-29]]]},{"geoid":"4414320","name":"Charlestown","full":"Charlestown CDP","lsad":"CDP","cdp":true,"polygons":[[[-716554,413849,21,-27,-1,-9,79,-17,-12,-64,4,-63,41,-6,45,40,22,-29,51,-4,19,-27,27,-1,19,16,55,9,33,24,42,53,15,38,-18,17,-7,32,20,26,-7,87,-261,-103,-110,19,-58,-4]]]},{"geoid":"4414860","name":"Chepachet","full":"Chepachet CDP","lsad":"CDP","cdp":true,"polygons":[[[-716966,419197,-11,0,15,-33,71,-27,34,-34,32,-16,-5,-15,8,-18,-22,-13,-8,-16,23,-10,87,15,10,-30,30,-1,12,-32,37,-32,102,-9,33,-14,42,-36,42,15,51,-12,45,26,54,2,-7,15,17,7,2,8,23,0,9,11,-18,-1,-51,41,-49,71,-20,0,-1,-13,-68,4,-15,47,-83,49,-21,0,-5,37,7,13,-12,33,-27,-1,-21,10,-44,59,41,22,-378,-10]]]},{"geoid":"4415940","name":"Clayville","full":"Clayville CDP","lsad":"CDP","cdp":true,"polygons":[[[-717054,417672,35,22,21,-6,38,-47,-6,-14,35,-12,40,-2,26,8,9,9,-19,5,-6,14,12,18,19,-31,16,3,-13,9,3,18,14,3,17,-11,12,27,-45,29,12,17,16,-1,-7,-24,45,18,11,-4,-7,-14,56,-23,5,15,15,-2,-6,19,7,10,12,-7,6,24,27,40,-19,16,-17,39,16,17,-31,0,-16,-10,-1,-13,-86,-10,-20,-21,-72,13,-15,-19,-34,1,3,-13,-14,-25,-27,22,-11,-16,6,-16,-47,-14,-1,-9,-49,-41]]]},{"geoid":"4419180","name":"Cranston","full":"Cranston city","lsad":"city","polygons":[[[-715593,417893,105,-527,14,-54,16,-11,905,23,25,19,-9,31,24,23,66,5,3,40,-21,47,59,33,-6,25,21,17,-15,15,18,-1,12,20,17,-1,21,17,8,-21,20,13,48,4,32,20,10,16,22,2,11,-7,-14,-24,10,2,47,11,37,36,55,10,28,-1,10,-9,18,17,40,-16,15,-27,36,4,20,-6,28,-54,10,-8,9,9,-18,18,1,84,-62,124,11,26,81,14,-69,12,-149,-5,12,-28,-20,-37,-37,-12,-12,-43,-19,-14,-31,8,-44,31,-44,10,32,89,-134,1,-25,21,-28,88,0,48,-29,52,-215,-22,-23,-13,-16,-56,-20,7,-20,-5,-7,-18,-91,0,-80,-48,-80,-8,-57,-18,-107,-7,-51,5,-117,25,-36,18,-131,-11,-79,-26]]]},{"geoid":"4420260","name":"Cumberland Hill","full":"Cumberland Hill CDP","lsad":"CDP","cdp":true,"polygons":[[[-714862,419782,75,-11,46,-45,87,-32,10,-13,-6,-21,28,-54,4,-32,66,-18,66,-50,83,-18,-47,152,-28,37,36,33,19,6,-40,49,9,22,-15,32,-258,124,-147,-152]]]},{"geoid":"4422960","name":"East Providence","full":"East Providence city","lsad":"city","polygons":[[[-713935,418071,83,-50,44,-58,35,-16,40,-36,6,-26,7,13,23,-67,-20,3,11,-25,26,-2,29,-32,-12,-23,2,-41,-35,-65,50,1,28,-40,10,-55,-15,-43,22,-14,7,-28,-5,-16,41,0,19,62,360,249,-100,43,-15,21,1,42,-29,55,-17,22,-54,18,-14,20,18,100,-83,148,23,49,97,75,-70,93,75,165,-403,-39,27,-69,1,-72,-14,-108,-38,-32,-97,-129,-64,-16,-18,-31]]]},{"geoid":"4427640","name":"Foster Center","full":"Foster Center CDP","lsad":"CDP","cdp":true,"polygons":[[[-717548,417976,66,-63,53,-147,31,6,72,36,49,-13,24,28,35,-16,4,23,21,-1,7,18,41,-17,16,35,-6,29,23,1,19,24,-37,-8,-55,24,-27,28,-12,46,-137,-22,-208,-8]]]},{"geoid":"4431240","name":"Greene","full":"Greene CDP","lsad":"CDP","cdp":true,"polygons":[[[-717678,416977,16,-8,-7,-15,19,-14,2,-14,22,-6,-18,-45,5,-25,33,1,36,-52,71,-23,46,12,3,-20,34,1,-24,28,-2,28,14,13,-10,21,8,23,14,11,134,-3,349,20,-9,91,-45,95,-131,-18,-168,27,-30,13,3,21,-33,36,-109,-29,-14,9,-114,-17,0,-48,-32,-18,-11,-27,2,-16,-11,-4,-9,-19,-9,6,-15,-8]]]},{"geoid":"4431600","name":"Greenville","full":"Greenville CDP","lsad":"CDP","cdp":true,"polygons":[[[-715746,418587,431,56,8,59,-6,24,-56,46,46,23,-4,27,-18,31,-19,8,8,7,-26,78,-29,33,-22,8,-8,59,-46,68,-37,34,-22,-8,-6,-22,-27,17,-19,-27,-3,-30,-25,-14,10,-36,29,-19,-36,-13,-18,12,-21,-6,-2,-26,-25,-31,2,-26,-30,-31,-2,-18,11,-19,-56,-12,-19,12,-16,-4]]]},{"geoid":"4433040","name":"Harmony","full":"Harmony CDP","lsad":"CDP","cdp":true,"polygons":[[[-716302,419111,16,-25,3,-39,61,-62,1,-27,-19,-10,59,12,40,-44,17,6,34,-36,88,-36,-20,-21,9,-43,109,-20,30,13,7,18,-22,-5,2,9,-35,26,-11,-10,-37,24,8,6,75,-12,56,-18,9,9,29,-10,-26,131,-52,22,-19,21,-52,30,-14,-4,-30,-34,-30,-11,-20,22,-77,54,-119,175,-11,-5,-4,-44,-40,-10,-16,-17]]]},{"geoid":"4433400"Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"SC","state":"South Carolina","fips":"45","features":[{"geoid":"4500100","name":"Abbeville","full":"Abbeville city","lsad":"city","polygons":[[[-824064,341862,27,-17,15,9,34,-4,-5,-8,12,-12,-13,-13,23,-21,-22,4,-1,-9,21,-4,-29,-4,-1,-32,-12,-19,29,-9,-8,-7,4,-13,-20,1,-1,8,-25,-7,56,-14,13,-17,21,6,27,-8,-60,-47,41,18,90,-38,-13,-6,29,-25,-17,-52,-12,-9,31,-13,0,-19,25,2,-6,105,71,5,-14,19,30,20,-3,-45,45,-2,14,-17,6,17,20,0,-4,8,16,6,-5,13,-27,1,13,20,9,-12,87,35,-4,13,-31,17,6,12,10,-11,47,2,5,8,-9,10,-30,5,26,30,-26,26,9,25,-28,36,14,7,-16,5,22,18,12,-13,41,18,2,-13,44,6,-15,8,-6,25,-29,-17,-4,14,-36,-18,-34,29,-44,-5,-21,33,21,11,9,27,-11,48,-43,-9,0,-66,-38,3,-24,36,15,8,-6,8,-30,-11,-5,15,6,25,-16,28,-80,-2,10,-35,-14,-11,7,-7,-22,-18,9,-10,11,10,20,-1,26,13,14,-7,-44,-35,-4,11,-33,-18,-20,20,-15,-25,-64,-11,3,-14,-14,-3,-4,-16,-20,2,-4,13,-19,-7,5,-15,-37,-2]]]},{"geoid":"4500165","name":"Abney Crossroads","full":"Abney Crossroads CDP","lsad":"CDP","cdp":true,"polygons":[[[-805162,345036,29,-61,13,27,39,17,37,36,1,16,41,20,-66,5,-33,22,-13,-3,10,16,-19,1,-39,-34,8,-2,-11,-27]]]},{"geoid":"4500370","name":"Adams Run","full":"Adams Run CDP","lsad":"CDP","cdp":true,"polygons":[[[-803592,327197,47,-51,10,0,-10,-18,123,1,-1,33,45,1,0,-14,8,-2,20,7,-12,-3,12,25,34,2,-32,71,-50,-18,-8,49,5,12,-15,26,-129,0,-4,-31]]]},{"geoid":"4500550","name":"Aiken","full":"Aiken city","lsad":"city","polygons":[[[-817023,335860,-7,-10,-40,14,-14,1,0,-1,14,-1,8,-44,-33,1,-82,10,0,11,-20,2,1,-11,-10,1,-4,-28,-31,12,-46,30,27,29,40,8,-12,12,-73,8,-20,-33,-20,10,-22,5,-132,13,-26,-4,-16,-7,-118,-94,-2,-5,6,-69,-30,-7,-21,8,-41,-2,-26,-21,73,4,-5,-13,44,-2,8,-11,4,-28,-9,-10,-15,12,-15,-1,-8,-13,-43,-7,9,12,25,2,20,14,-9,-4,-38,4,-1,25,9,8,-43,1,-20,-40,7,-18,23,3,11,-9,-37,-7,-2,14,-16,-3,-2,-17,11,2,5,-9,-1,-25,-9,-3,9,-23,12,-60,-18,-3,3,-16,19,3,3,-13,-19,-3,5,-21,19,3,14,-65,8,-23,17,-24,24,-19,-10,-15,23,-12,-8,-12,53,-11,13,17,12,-8,-19,-17,15,-5,2,6,44,-10,-1,-6,47,-8,85,-49,5,6,13,-7,32,-10,11,2,-1,-13,13,-3,-9,-21,-34,9,-16,-32,10,-7,-40,9,-20,13,-8,-13,1,15,-22,5,-20,-42,-34,-4,8,-7,9,-30,20,11,5,-10,-12,-15,8,-6,-5,-14,-38,-11,43,-40,24,-12,40,41,-13,-15,10,-6,-14,1,-46,-47,19,-11,-8,-15,73,-24,-34,-94,28,-20,-22,-64,8,-15,-10,-4,0,-2,30,0,17,-32,34,-23,62,-9,3,6,17,-8,-5,-19,22,-13,25,21,34,6,11,43,-28,31,8,16,28,18,33,-2,31,4,-26,23,-6,-7,-17,14,38,30,27,45,7,18,34,37,-22,30,19,18,32,4,44,14,56,-119,2,1,-62,133,6,8,-9,-2,33,30,9,48,-73,-35,-33,42,22,12,-17,21,14,7,-14,13,-36,10,26,0,3,16,-48,0,-20,39,38,14,9,0,10,-50,28,0,7,-7,19,7,33,0,-3,-46,31,20,16,52,-22,18,-78,4,2,51,46,-2,-6,43,-23,17,27,12,18,-38,18,-14,12,3,0,8,13,0,24,27,-21,9,-17,27,134,56,7,-15,38,15,-22,-31,-30,3,-5,-15,-21,-23,33,9,2,-11,117,-28,-8,20,1,31,8,9,-19,29,-29,25,6,3,5,4,17,27,-20,-27,-13,6,5,13,-4,3,7,13,-13,4,-17,-39,-15,-15,-31,-8,-10,35,10,1,7,33,-14,15,-17,-21,-3,-28,-38,-11,-7,-8,-21,12,-28,-18,-6,12,26,9,5,18,2,-11,30,-12,19,26,-46,9,-19,9,-9,7,18,38,-20,-17,-14,4,9,-10,-3,-11,-10,3,3,5,-5,15,0,25,5,29,-6,59,7,-1,28,29,15,-9,-18,27,55,39,-23,3,-13,12,-18,-24,-12,-7,-15,5,-5,12,33,20,27,25,25,20,-21,19,33,26,21,-19,2,2,-31,28,-25,13,-8,-3,-14,33,-49,7,-2,-3],[-817398,335090,-23,19,25,-15],[-817712,335326,-17,18,-17,33,-39,181,5,24,15,-11,7,1,16,-10,12,0,0,15,39,0,1,-19,10,-5,23,12,43,-22,32,21,50,2,55,17,143,-6,1,-147,8,-74,-1,-22,21,-16,-11,-18,7,-20,-40,20,-52,10,-11,21,20,-2,-3,8,18,21,-27,21,-8,0,0,-5,-21,-7,3,13,4,-5,3,6,-4,2,-16,1,4,-42,-14,5,-10,6,-21,-7,-1,5,11,0,20,13,-4,11,-4,-13,-21,35,-18,-37,10,-13,-19,6,16,36,0,17,-24,2,-15,-25,-4,-19,-19,-22,-4,-14,-13,-11,-41,-14,0,-7,-45,4,-17,5,22,31,-31,20],[-817617,335801,-9,0,0,-30,-28,-2,9,27,108,91,37,9,140,-14,-3,-8,5,-31,-28,-2,10,-21,-6,-17,-26,4,-1,-8,-17,5,-1,-22,27,0,0,-16,17,2,0,12,17,-3,-5,-22,34,-13,-14,-23,-15,-4,-14,-7,17,-15,3,7,5,-1,1,8,19,-1,0,-28,-9,-1,9,-8,-40,1,2,-12,-16,-1,-7,15,-29,0,-19,8,-13,-11,16,-13,-38,2,-17,-4,-39,8,-26,19,-13,0,26,36,-16,1,-19,24,-3,33,-20,-2,3,-20,-12,-1]],[[-817728,335278,1,-6,-23,-12,23,-22,-9,-5,17,-33,14,-11,-14,-9,-14,-22,8,-13,16,11,36,2,2,-29,26,2,-8,-17,20,-13,33,20,-34,27,14,5,9,23,-10,17,1,14,-28,7,15,24,-10,3,4,9,-25,7,-11,-6,2,8,-25,4,1,7]],[[-816876,335995,-106,51,-28,-24,-68,-12,75,6,70,-35,-8,-8,40,-10]],[[-817085,335887,7,123,-1,0]]]},{"geoid":"4500775","name":"Alcolu","full":"Alcolu CDP","lsad":"CDP","cdp":true,"polygons":[[[-802451,337802,52,-50,-5,-8,26,-121,-4,-39,-31,-20,-7,-14,8,-17,43,-31,5,-22,27,-19,8,-21,-2,-19,31,-43,34,-27,17,1,19,-17,28,-9,15,3,49,44,169,89,-109,156,-93,102,-1,-24,-28,-1,-30,37,-58,-57,-115,155,-34,-8]]]},{"geoid":"4500955","name":"Allendale","full":"Allendale town","lsad":"town","polygons":[[[-813325,330024,12,2,14,-20,86,-22,0,-14,116,-29,42,-1,81,28,58,73,8,46,-13,51,-57,63,-60,23,-57,6,-71,-17,-53,-41,-31,-59,0,-61,-84,-7]]]},{"geoid":"4501360","name":"Anderson","full":"Anderson city","lsad":"city","polygons":[[[-826916,345470,24,6,4,-10,23,31,18,9,9,-16,22,-6,-43,-65,5,-39,-13Line truncated
|
||||
@@ -0,0 +1 @@
|
||||
{"st":"SD","state":"South Dakota","fips":"46","features":[{"geoid":"4600100","name":"Aberdeen","full":"Aberdeen city","lsad":"city","polygons":[[[-985262,454741,12,-3,-13,-10,0,-60,101,-1,0,67,-24,4,28,6,1,57,0,-7,52,7,6,-30,-30,-1,0,-30,-31,0,3,-112,100,25,0,-12,-98,-24,-20,-13,2,-28,19,0,0,-40,-31,9,0,-23,39,0,-8,-72,17,0,-4,-66,-14,0,1,-62,45,0,5,30,14,2,0,23,-36,39,35,0,0,34,35,0,0,-109,52,0,0,25,-10,11,-25,0,-15,11,-1,62,128,-2,-3,-39,62,0,11,39,94,-1,-9,-15,-11,0,0,-129,-23,0,0,-22,7,-50,51,0,1,216,78,0,0,-26,26,1,0,-47,103,0,0,60,31,0,0,11,-18,0,0,19,38,0,0,49,75,5,0,28,79,0,-12,-3,-10,-26,54,0,-7,-217,79,0,0,143,28,0,51,-15,24,-37,22,1,104,-70,65,48,15,1,-16,19,-27,4,0,10,-22,0,-38,26,0,-36,-30,21,-1,29,-13,0,-59,41,0,52,103,-7,0,7,-52,0,-8,17,-43,0,0,35,28,0,1,14,-29,-1,0,58,-102,0,-3,-35,-81,1,-21,34,207,2,0,217,-107,0,0,-49,-100,-33,0,13,-103,0,0,-46,-73,-24,50,17,-29,6,0,25,-19,36,21,16,15,26,24,14,-92,1,0,35,-45,1,46,99,-53,-94,-50,0,-1,67,-101,6,0,-41,-16,-1,0,-15,-35,0,-2,-57,-269,2,0,-23,-22,5,0,-18,-16,0,0,37,-46,49,-9,22,-103,0]]]},{"geoid":"4600460","name":"Agar","full":"Agar town","lsad":"town","polygons":[[[-1000766,448353,54,-6,6,28,11,0,0,28,-17,0,-1,52,-43,1,0,-37,-16,-36]]]},{"geoid":"4600520","name":"Agency Village","full":"Agency Village CDP","lsad":"CDP","cdp":true,"polygons":[[[-971029,455581,412,0,0,38,102,0,4,316,-102,0,1,86,-379,-3,-38,-18]]]},{"geoid":"4600540","name":"Akaska","full":"Akaska town","lsad":"town","polygons":[[[-1001309,453266,201,-3,1,91,-204,3]]]},{"geoid":"4600620","name":"Albee","full":"Albee town","lsad":"town","polygons":[[[-965587,450494,104,1,-1,37,-103,0]]]},{"geoid":"4600700","name":"Alcester","full":"Alcester city","lsad":"city","polygons":[[[-966362,430199,39,-4,0,-17,42,7,0,12,55,2,-1,23,44,0,4,181,-143,0,0,-19,-13,0,0,-53,49,0,4,-73,-40,0,0,14,-31,-4,-9,-10]]]},{"geoid":"4600820","name":"Alexandria","full":"Alexandria city","lsad":"city","polygons":[[[-977888,436606,19,-15,-2,-110,149,-3,3,114,-123,5,-24,13,-6,24,-16,5]]]},{"geoid":"4600900","name":"Allen","full":"Allen CDP","lsad":"CDP","cdp":true,"polygons":[[[-1019612,432816,105,1,0,-39,16,-2,20,-15,18,7,61,-24,74,0,5,-71,205,-2,0,-29,157,88,-60,8,-15,36,-25,19,-23,2,12,28,-21,47,-28,20,-79,13,-32,-4,-27,-12,-70,-7,-293,5]]]},{"geoid":"4601020","name":"Alpena","full":"Alpena town","lsad":"town","polygons":[[[-983825,441770,100,2,1,-73,101,0,0,71,67,4,-16,4,-1,66,51,1,0,72,-303,-2]]]},{"geoid":"4601140","name":"Altamont","full":"Altamont town","lsad":"town","polygons":[[[-967028,448335,254,0,0,145,-255,1]]]},{"geoid":"4601450","name":"Anderson","full":"Anderson CDP","lsad":"CDP","cdp":true,"polygons":[[[-966309,435149,300,-2,0,73,-100,0,-26,36,-25,2,-17,36,-22,7,-7,-8,-4,-116,-97,3,-1,-17]]]},{"geoid":"4601500","name":"Andover","full":"Andover town","lsad":"town","polygons":[[[-979092,454066,102,0,0,15,26,0,0,20,-26,0,0,38,-102,1]]]},{"geoid":"4601560","name":"Angostura","full":"Angostura CDP","lsad":"CDP","cdp":true,"polygons":[[[-1034381,433431,50,-8,-20,-15,29,-29,33,-19,149,-11,-22,-6,16,-12,-9,-9,17,-6,-3,-7,-26,0,-12,11,-30,-14,24,-16,34,-10,7,-23,12,-4,-9,-16,10,-45,26,-19,-12,-38,17,-20,27,0,43,-20,1,-44,15,-38,33,-17,31,4,2,11,14,-5,-25,-22,22,-21,22,-4,44,-25,9,-14,27,-9,13,-14,-2,-16,34,-11,-2,-23,53,-11,27,-23,-14,-23,4,-19,12,0,12,36,15,6,56,-8,27,-58,1,22,19,6,10,26,33,20,0,9,25,17,45,-3,1,185,34,25,9,21,-425,374,-103,134,-69,-23,-97,-15,-27,-21,-27,9,-130,-21,-4,24,-28,-3,-25,-25,-15,-38]]]},{"geoid":"4601740","name":"Antelope","full":"Antelope CDP","lsad":"CDP","cdp":true,"polygons":[[[-1006526,433082,11,7,44,-23,53,-7,14,5,19,-32,-13,1,-1,-54,25,6,60,-11,-3,-9,37,-2,20,15,21,-1,44,-26,-10,16,34,-1,5,15,-6,50,39,0,4,146,-397,-2,0,-72]]]},{"geoid":"4601980","name":"Ardmore","full":"Ardmore CDP","lsad":"CDP","cdp":true,"polygons":[[[-1036581,430142,108,3,-12,6,3,19,11,5,-22,33,-36,15,7,18,-13,9,-69,1]]]},{"geoid":"4602180","name":"Arlington","full":"Arlington city","lsad":"city","polygons":[[[-971490,443550,300,-1,9,146,-106,0,-3,73,-49,0,1,-38,-35,0,0,-13,-15,-6,-18,0,-32,20,-1,-37,-50,-1]]]},{"geoid":"4602260","name":"Armour","full":"Armour city","lsad":"city","polygons":[[[-983544,433121,189,-4,2,144,-190,2]]]},{"geoid":"4602340","name":"Artas","full":"Artas town","lsad":"town","polygons":[[[-998113,458850,101,1,-22,8,-8,40,-54,1,0,-38]]]},{"geoid":"4602380","name":"Artesian","full":"Artesian town","lsad":"town","polygons":[[[-979312,440024,150,2,-2,107,-147,-1,-1,-61]]]},{"geoid":"4602530","name":"Ashland Heights","full":"Ashland Heights CDP","lsad":"CDP","cdp":true,"polygons":[[[-1031513,441256,202,0,0,-145,63,0,88,49,50,18,1,30,-26,0,0,-18,-7,0,0,23,20,0,0,16,13,0,1,179,-405,0,0,-82]]]},{"geoid":"4602540","name":"Ashton","full":"Ashton city","lsad":"city","polygons":[[[-985085,449915,58,1,-4,-40,102,-1,-1,110,-101,1,0,-37,-55,-1]]]},{"geoid":"4602580","name":"Astoria","full":"Astoria town","lsad":"town","polygons":[[[-965516,445555,102,-1,0,45,-101,2]]]},{"geoid":"4602780","Line truncated
|
||||
Loaded 100 of 1278 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user