address the final review of the voice outline fixes

- A building word ("Burj Khalifa Tower", "Sagrada Familia Church") passes
  the last-word rule on a building-like result; enclosures stay out.
- The anchor chooses only among the best-named outlines, so a worse name
  never wins by containment alone.
- An ask without a quadrant takes only the quadrant of the matching street
  nearest the point; a leading quadrant ("SE Main St") may go unsaid too.
- On an unbuffered tile edge a fragment shows as an edge along the
  boundary, so a whole building touching it at a corner is not cut.
- Drop two orphaned comments and correct the place-name key wording.
This commit is contained in:
Sameh Khamis committed 2026-11-02 09:03:36 -08:00
1 parent a61d0f4c2a
commit 0712db9891
8 files changed
+194 -42

No files matched your search

+30
View File
@@ -84,6 +84,36 @@ test('a lone letter is a direction only beside a name; quadrants may go unsaid',
assert.ok(!streetNameMatches('E St NE', 'E Street Northwest'));
assert.ok(!streetNameMatches('E Street', 'E Street Northwest'));
assert.ok(!streetNameMatches('F Street Northwest', 'E Street'));
// A leading quadrant may go unsaid too (Portland's "SE Main St").
assert.ok(streetNameMatches('SE Main St', 'Main Street'));
assert.ok(!streetNameMatches('SE Main St', 'NE Main Street'));
});
test('an ask without a quadrant takes the quadrant beside the point', () => {
const street = (name, lat) => ({
name,
coordinates: [
[-77.03, lat],
[-77.02, lat],
],
});
const tiles = [
{
streets: [
street('E Street Northwest', 38.8962),
street('E Street Northeast', 38.8972),
street('E Street Southeast', 38.8822),
],
},
];
const near = streetFromTiles(tiles, {
name: 'E Street',
lat: 38.8963,
lon: -77.025,
});
assert.equal(near.name, 'E Street Northwest');
assert.equal(near.lines.length, 1, 'one quadrant, not three streets');
assert.ok(near.lines[0].every(([, lat]) => lat === 38.8962));
});
test('same-name segments merge into polylines around the point (Congress Avenue)', () => {