Skip to content

feat: data quality - filter null geometry, diagnostic endpoint (Meta #5, #6)#94

Open
madhavcodez wants to merge 3 commits into
mainfrom
fix/data-quality-group6
Open

feat: data quality - filter null geometry, diagnostic endpoint (Meta #5, #6)#94
madhavcodez wants to merge 3 commits into
mainfrom
fix/data-quality-group6

Conversation

@madhavcodez
Copy link
Copy Markdown
Contributor

@madhavcodez madhavcodez commented May 7, 2026

Summary

  • Meta Simple Chat Server #5: Filter l.geom IS NOT NULL in /locations and /disasters/{id}/summary - locations without geometry were counted in sidebar but never rendered on map, causing mismatch
  • FE feat: chat tools for address-aware damage lookups (frontend #51) #70: Frontend hasOverlay boolean on MapPolygon, dashed stroke for polygons without satellite imagery overlay
  • Meta Initial VLM Prompt #6: New GET /data-quality/report?disaster_id=... diagnostic endpoint - reports location/image-pair data quality metrics
  • Chat coverage fix: Updated system prompt to explain xBD dataset covers only Pender County (NC), Duplin County (NC), and Horry County (SC). Chat now returns clear out-of-coverage messages.

Changes

Backend (3 files)

  • app/main.py: Added l.geom IS NOT NULL to WHERE clauses; registered data_quality router
  • app/routers/data_quality.py (NEW): Diagnostic endpoint with COUNT+FILTER SQL
  • app/services/gemini.py: Updated system prompt with Florence dataset coverage boundaries; improved empty-result responses

Frontend (3 files)

  • types.ts: Added hasOverlay?: boolean to MapPolygon interface
  • Dashboard.tsx: Thread hasOverlay through polygon parser, filter sidebar tile counts
  • MapView.tsx: Dashed stroke for polygons where hasOverlay === false

Closes UTDisaster/meta#5, UTDisaster/frontend#70, UTDisaster/meta#6

Test plan

  • Sidebar tile count matches visible polygons on map
  • Aggregate total matches renderable locations only
  • Polygons without satellite imagery show dashed outline
  • Polygons WITH imagery show normal solid outline (no regression)
  • GET /data-quality/report?disaster_id=hurricane-florence returns valid JSON
  • GET /data-quality/report without disaster_id returns 422
  • Chat query for New Bern returns coverage explanation
  • Chat query for Pender County still returns valid damage stats
  • Frontend TypeScript build passes clean
  • Backend Python files parse without errors

… dashed imageless polygons

- /locations: filter out NULL geometry locations (root cause of Meta #5 sidebar-map mismatch)
- /disasters/{id}/summary: exclude NULL geometry from aggregate counts and classification breakdown
- New /data-quality/report endpoint with storage analysis for bucket reduction (Meta #6)
- Frontend: hasOverlay field on MapPolygon, dashed stroke for imageless polygons (FE #70)
- Frontend: sidebar tile count excludes geometry-less locations

Addresses Meta #5, FE #70, Meta #6
@vercel
Copy link
Copy Markdown

vercel Bot commented May 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
backend Ready Ready Preview, Comment May 7, 2026 5:00pm

Update system prompt to explain the xBD dataset covers only Pender
County (NC), Duplin County (NC), and Horry County (SC). Queries for
areas outside these counties now return a clear explanation instead
of a confusing partial response. Empty get_damage_by_area results
also include the coverage note.
Remove MOCK_CHATS dict and /chat/mock-conversations endpoints superseded
by real chat router. Fix duplicate flyTo action when Gemini calls both
get_damage_hotspots and navigate_map in the same round.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate: most images do not show any locations

1 participant