Add coordinate system detection for Argus GeoTIFF imagery#55
Draft
Copilot wants to merge 5 commits into
Draft
Conversation
…ation Co-authored-by: SBFRF <8375832+SBFRF@users.noreply.github.com>
Co-authored-by: SBFRF <8375832+SBFRF@users.noreply.github.com>
Co-authored-by: SBFRF <8375832+SBFRF@users.noreply.github.com>
Co-authored-by: SBFRF <8375832+SBFRF@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix Argus imagery coordinate system detection and conversion
Add coordinate system detection for Argus GeoTIFF imagery
Feb 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Argus GeoTIFF imagery uses NC State Plane (NAD83) coordinates, not lon/lat. The existing State Plane → Lon/Lat conversion is correct, but there was no automated detection or validation of coordinate systems, leading to confusion.
Changes
Added
detect_geotiff_crs()function - Analyzes coordinate ranges to return'state_plane','lonlat', or'unknown'Enhanced
get_geotiff_extent()documentation - Clarified that it returns coordinates in the GeoTIFF's native CRS with explicit warnings and conversion examplesUpdated example scripts - Added CRS detection, conditional conversion, and extent validation with warnings for suspicious ranges
Added unit tests - 4 tests covering State Plane, lon/lat, and unknown CRS detection scenarios
Usage
The State Plane → Lon/Lat conversion logic is preserved unchanged - this adds detection and validation layers only.
Original prompt
Fix Argus Imagery Coordinate System Detection and Proper Conversion
Problem Analysis
Based on diagnostic results from
examples/diagnose_coordinates.py, we've confirmed:However, PR #48 was created reporting alignment issues. The diagnostic shows the coordinate conversion itself is correct, so the issue must be in how the imagery is being displayed or used in
examples/test_wave_and_imagery.py.Root Cause
Looking at
examples/test_wave_and_imagery.pylines 130-144, the code:The problem is likely in the extent format or plotting logic, not the coordinate conversion itself.
Required Changes
1. Keep the State Plane Conversion (It's Correct!)
The conversion from State Plane to lon/lat in
test_wave_and_imagery.pyis correct and must be kept. Do NOT remove it as PR #48 suggests.2. Fix the Real Issue
The actual problem appears to be in how the extent is being used or displayed. Review
test_wave_and_imagery.pylines 145-175 to ensure:extentparameter format is correct:[left, right, bottom, top]in data coordinates3. Add Coordinate System Detection
Add a helper function to detect and validate coordinate systems:
4. Update test_wave_and_imagery.py
In
examples/test_wave_and_imagery.py:Example fix around line 130:
5. Add Documentation
Add a docstring to
get_geotiff_extent()explaining coordinate systems: