fix(ui): use Govmap resolved address text for street inference, not frequency heuristic
Previous approach: pick most common streetNameHeb among street-source deals. Problem: a busier nearby street wins even when the searched parcel is on a quieter street (e.g. רב צעיר beats הילדסהיימר despite being a different street). Fix: backend now returns resolved_address from Govmap autocomplete (e.g. "הילדסהיימר 14, ירושלים"). Frontend parses the leading non-numeric tokens as the street name and uses that as ground truth for proximity labeling. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -165,13 +165,15 @@ def create_app() -> FastAPI:
|
||||
logger.exception("find_recent_deals_for_address failed")
|
||||
raise HTTPException(status_code=502, detail=str(e))
|
||||
|
||||
# Search-center coords for the map (best-effort).
|
||||
# Search-center coords + resolved address text for the UI (best-effort).
|
||||
search_coords = None
|
||||
resolved_address = None
|
||||
try:
|
||||
ar = govmap_client.autocomplete_address(req.address)
|
||||
if ar.results and ar.results[0].coordinates:
|
||||
c = ar.results[0].coordinates
|
||||
search_coords = {"longitude": c.longitude, "latitude": c.latitude}
|
||||
resolved_address = ar.results[0].text
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
@@ -198,6 +200,7 @@ def create_app() -> FastAPI:
|
||||
return {
|
||||
"search": {
|
||||
"address": req.address,
|
||||
"resolved_address": resolved_address,
|
||||
"coordinates": search_coords,
|
||||
"years_back": req.years_back,
|
||||
"radius_meters": req.radius_meters,
|
||||
|
||||
Reference in New Issue
Block a user