Skip to content

feat: NLP-driven Geotagging and Map Integration for PDF Reports#207

Open
Gopisokk wants to merge 1 commit intofireform-core:mainfrom
Gopisokk:feat/geotagging-map-integration
Open

feat: NLP-driven Geotagging and Map Integration for PDF Reports#207
Gopisokk wants to merge 1 commit intofireform-core:mainfrom
Gopisokk:feat/geotagging-map-integration

Conversation

@Gopisokk
Copy link

@Gopisokk Gopisokk commented Mar 8, 2026

Resolves #108

📝 Description

This PR addresses one of the most critical needs for first responders: accurate geolocation. It implements an automated pipeline that extracts location descriptions from voice transcriptions and converts them into precise GPS coordinates and visual map markers.

🛠️ Changes Made

  • Implemented Geotagger Service: Added src/geocoder.py utilizing geopy (Nominatim) for geocoding and staticmap for rendering map images.
  • Implicit Field Extraction: Enhanced src/file_manipulator.py to automatically prompt the LLM for a "Location Summary" from any transcript, regardless of the PDF template fields.
  • Dynamic PDF Overlays: Integrated PyMuPDF (fitz) in src/filler.py to dynamically "stamp" a visual map image onto the finished PDF report.
  • Dependencies: Added geopy, staticmap, PyMuPDF, and Pillow to requirements.txt.
  • Documentation: Updated the README.md to highlight the new 📍 Geotagging and 🗺️ Map Integration capabilities.

🛡️ Reliability & Resiliency

  • Offline Fallback: The system is designed to catch all networking and geocoding timeouts. If the external API is unreachable or the location is ambiguous, the system gracefully skips the map generation while still completing the PDF report.
  • Cleanup: Temporary map images are automatically deleted after they are embedded into the PDF to save disk space.

🧪 Testing

  • Unit Tests: Added tests/test_geocoder.py with 100% mocked network responses to verify address resolution and image generation paths.
  • E2E Verification: Verified the full flow from natural language input ("Eiffel Tower") to a final PDF with a map stamp.

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.

[FEAT]: NLP-driven Geotagging and Map Integration for PDF Reports

1 participant