Skip to content

Test GPS info on real camera trap images - #250

Merged
agentmorris merged 1 commit into
agentmorris:mainfrom
ivnpsvc:read-exif-gps-real-images
Oct 8, 2026
Merged

agentmorris merged 1 commit into
agentmorris:mainfrom
ivnpsvc:read-exif-gps-real-images

Conversation

@ivnpsvc

@ivnpsvc ivnpsvc commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #247 and #248.

Adds test_get_gps_info_real_images() to megadetector/data_management/read_exif.py, which runs
get_gps_info(), has_gps_info() and get_exif_lat_lon() on the real camera trap images in the new
gps-tests folder of the test data package, downloaded with md_tests.download_test_data(). It
covers valid GPS (including zero degrees latitude), null island (N/E and S/W refs, with and without
check_for_null_island), junk GPS values (reported as present, with no location), GPS tags without
lat/lon, an empty GPS IFD, no GPS, no EXIF, and a corrupt image, each as a filename, a PIL image, and
an EXIF dict. It also fails if an image is added to gps-tests without an expected result.

Everything the real images now cover is removed from the synthetic-image test, which keeps only the
cases that don't occur in real images: null island stored as NaN, a missing file, an exif_tags
field that is None, and string-valued GPS values.

Adds test_get_gps_info_real_images, using the gps-tests folder of the test data package via md_tests.download_test_data(). The synthetic-image test now only covers cases that don't occur in real images.
@agentmorris
agentmorris merged commit f9a36dd into agentmorris:main Oct 8, 2026
20 checks passed
@agentmorris

Copy link
Copy Markdown
Owner

Merged, thanks!

@ivnpsvc
ivnpsvc deleted the read-exif-gps-real-images branch October 8, 2026 22:26
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.

2 participants