Repository navigation
Engine v1.0.16
Fixes office-address geocoding: the address cleaner missed three unit shapes, and the search box never called it at all. Changed blocks only — no new blocks, no fence-set change, no fork adoption required.
- Changed
poi-geocode:cleanPoiAddressgained three rules. (1) Letter units —Room J,Suite B,Building B— which the existing rule missed because it required[0-9]after the token; bounded to a single letter plus optional digits (Room A5) so it can only ever eat the designator, never the word after it (the city name usually sits there, unpunctuated). (2)PO Box <n>in all its punctuations, including the parenthesized form (175 Water St., (P.O. Box 205), Burlington) and a trailing period (P.O. Box 226. LEWISTOWN). (3) A separator dash orphaned by a removed floor (69 W. Washington St. - 6th Floor→… St. -), anchored to a comma or end-of-string so hyphenated names (Winston-Salem) and hyphenated house numbers (88-11 Sutphin Blvd) are untouched. All three sit behind the same(\S)guard the numeric rules use, so a leading#10 Public Squareand a box-only address are still left alone. - Changed
geocoder-search:runGeocodeSearchretries a zero-result search withcleanPoiAddress(q)when cleaning changes the string, ahead of the sibling-metro fallback.
Why the search box needed this at all. cleanPoiAddress has existed in poi-geocode for months and the search path never called it — the typed string went to the provider verbatim. So the same fragment the office pins had handled all along still sank the search box, which is what users actually hit, because people paste addresses off letterheads.
Why retry, not clean up front. Cleaning every query would be simpler and is measurably no better: on 12 paired queries (same address with and without the fragment) the as-typed form scores 7/12, the cleaned form 9/12, and the hand-stripped form also 9/12 — so cleaning closes the entire gap the fragment opens, and nothing beyond it. Retrying keeps two properties that unconditional cleaning gives up: a search that works today cannot regress, and a genuine place name that merely looks like a unit (The Room 43) is only ever cleaned after the as-typed query has already come back empty. It costs one extra request on a miss — the same shape as the sibling-metro fallback it runs ahead of, and nothing on the happy path.
Measured, not assumed. Against the source fork's whole shipped corpus (409 addresses in data/app/, 37 carrying a unit fragment): 63 rewrites, zero residual debris, zero house numbers or ZIPs lost. Hit rate on the unit-bearing set went 5/37 → 35/37, though most of that belongs to a fork-level change shipping alongside this one and NOT part of the engine — the POI provider was bounding every lookup to the metro bbox while a statewide layer named addresses outside it. Forks adopting this release should check the same thing in their own poiGeocodeRequest: the bound belongs to the widest layer the fork ships, not to its metro. Chicago moved it to a POI_GEOCODE_BBOX METRO-config value; a fork whose rosters are all city-scoped needs no change.
Why not a different geocoder. The question this started as. On the same corpus the US Census one-line geocoder scores 35/37 with no cleaning whatsoever — i.e. exactly what the cleaned Nominatim path now scores — so the remaining headroom no longer justifies a second provider. It also fails differently: it needs a complete address, where a viewbox-bounded lookup rescues a bare 4314 S. Cottage Grove Ave., and it sends no CORS header, so a static page can reach it only via JSONP. Chaining the two would reach 55/57 if that ever becomes worth the trust widening; recorded, not built.
Guarded in smoke_test.mjs: the cleanPoiAddress table grew 7 → 14 cases (each new shape, plus the guards it must not trip), and two new checks drive a stubbed geocoder — deterministic, no external network — proving the retry fires on a unit-fragment miss and does not fire when there is nothing to clean.