Skip to content

Read footprint polygons from remote ZIP archives - #396

Merged
camante merged 1 commit into
mainfrom
feat/remote-archive-footprint
Sep 14, 2026
Merged

camante merged 1 commit into
mainfrom
feat/remote-archive-footprint

Conversation

@camante

@camante camante commented Sep 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

This pulls the ZIP footprint reading out of #385 into a reusable hook, following Matt's suggestion.

remote_archive_footprint reads polygon boundaries from a shapefile inside a remote ZIP without downloading the entire archive. It adds the combined outline to the Fetchez entry so later hooks can compare coverage. It also keeps the individual boundaries and their attributes for later source tracking.

If an archive has more than one shapefile, you can choose which one to read. You can also choose which attribute fields to keep. Other modules serving compatible ZIP archives can use the same hook, with no new dependencies.

This keeps archive reading separate from TNM discovery and the rules for choosing between overlapping sources. The hook preserves the polygons as supplied, including holes, and converts them to WGS84.

Tests

All 12 new hook tests passed. The full repository suite passed with 137 passed and 2 skipped. Pre-commit checks also passed.

The tests use real shapefiles in ZIPs served over local HTTP. They check layer and field selection, coordinate conversion, individual feature preservation, use with spatial_cull, and missing or invalid inputs. They also verify that the reader leaves a larger unrelated file in the ZIP unread and that the extracted attributes can be written to the audit log.

Source masks and spatial metadata still varied between unchanged-base runs, consistent with the Globato issue we discussed. The attached evidence records the full Newport comparison.

The dem-devel evidence bundle includes the test results, exact commits, and comparison details.
evidence_bundle.zip

@camante
camante requested a review from matth-love September 13, 2026 11:29
@matth-love

Copy link
Copy Markdown
Collaborator

This is great! And now as a generic hook this can be quite useful for other modules/hooks as well! Quite a cool hook you've made here!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now; but we should probably make a new directory and index for documentation on specific hooks so we don't end up with a huge list of hook specific docs alongside the more generic docs pages.

@camante
camante marked this pull request as ready for review September 14, 2026 03:04
@camante
camante merged commit 10d8c9d into main Sep 14, 2026
5 checks passed
@camante
camante deleted the feat/remote-archive-footprint branch September 14, 2026 03:05
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