tighten the remaining voice outline review items

- One place-name key for server and tiles, so "St. Paul" and "Saint Paul"
  agree in Nominatim name checks.
- Tile street names: a lone letter is a direction only beside another name
  word ("E Street" is not "East Street"), and a trailing quadrant ("E St NW")
  may go unsaid in the ask.
- A building cut at the tile edge that is nearer the point than any whole
  one leaves the point instead of a farther neighbour standing in; an edge
  without a tile buffer counts as a cut, so a cut area never answers grounds.
- A batch building install re-judges only results that installed; a late
  timeout during caption conversion keeps the pending point drawn; a failed
  plain recaption keeps the old mark addressable.
- An interrupted Nominatim dispatch is reclaimed by the next lock owner ten
  minutes after the start its marker names; node:sqlite loads on first use
  without its experimental warning.
- PHOTON_URL accepts only https, which the page's connect-src allows.
- Shared OpenFreeMap tiles decode each layer when a consumer first selects
  it; outline selection reuses the shared ring area and simplification, and
  ground probes the shared ring centroid; the grounds word list lives once.
This commit is contained in:
Sameh Khamis committed 2026-11-02 08:50:05 -08:00
1 parent a38a065c5c
commit a61d0f4c2a
24 files changed
+422 -128

No files matched your search

@@ -156,6 +156,69 @@ test('a clipped fragment is never the building, and no neighbour stands in', ()
);
});
test('a nearer cut fragment stops a farther whole building standing in', () => {
// About 110 m on a side, 2 m east of the point.
const fragment = {
rings: [square(0.00002, 0, 0.001)],
clipped: true,
heightM: null,
};
// Whole, about 30 m west of the point.
const neighbour = {
rings: [square(-0.0004, 0.00045, 0.0001)],
clipped: false,
heightM: null,
};
const point = { lat: 0.0005, lon: 0 };
assert.equal(
buildingFromTiles([{ buildings: [fragment, neighbour] }], point),
null,
);
// The fragment's complete copy from the neighbouring tile is the answer.
const complete = { ...fragment, clipped: false };
assert.deepEqual(
buildingFromTiles(
[{ buildings: [fragment, neighbour] }, { buildings: [complete] }],
point,
)?.polygons,
[fragment.rings],
);
// A fragment farther than the whole building does not block it.
assert.ok(
buildingFromTiles([{ buildings: [fragment, neighbour] }], {
...point,
lon: -0.00028,
}),
);
});
test('grounds touching an unbuffered tile edge are cut, not complete', () => {
// One tile at z0 whose park layer has no buffer: the cut is the edge itself.
const decode = (coordinates) =>
decodeOpenFreeMapOutlineTile(null, 0, 0, 0, {
layers: {
park: {
length: 1,
extent: 4096,
feature: () => ({
properties: { class: 'park', name: 'Edge Park' },
loadGeometry: () => [[{ x: 0, y: 2048 }]],
toGeoJSON: () => ({
geometry: { type: 'Polygon', coordinates },
}),
}),
},
},
});
const ask = { lat: 0.005, lon: -179.995, name: 'Edge Park' };
const cut = decode([square(-180, 0, 0.01)]);
assert.equal(cut.areas[0].clipped, true);
assert.equal(enclosingAreaFromTiles([cut], ask), null);
const inside = decode([square(-179.999, 0, 0.01)]);
assert.equal(inside.areas[0].clipped, false);
assert.ok(enclosingAreaFromTiles([inside], ask));
});
test('a point in a courtyard is not inside the building', () => {
const block = {
rings: [square(0, 0, 0.001), square(0.0004, 0.0004, 0.0002).reverse()],