stac-utils / stactools

Command line utility and Python library for STAC
https://stactools.readthedocs.io/
Other
104 stars 28 forks source link

Allow geometries to be computed from multiple asset footprints #445

Closed jpolchlo closed 1 year ago

jpolchlo commented 1 year ago

Related Issue(s):

392

Description: This PR extends update_geometry_from_asset_footprint() to have more flexibility in how the footprint is derived in the event of multiple, non-coincident asset footprints. Previously, this method would simply take the first matching asset footprint. This PR allows for the footprint to be the intersection or union of the matching assets. Adding the intersection was an executive decision, since I can imagine wanting to build STACs for analysis where we want to be sure data is present for all assets to avoid needing to filter for NODATA in subsequent steps. If this doesn't make sense, it can be removed in favor of only using the union.

PR checklist:

jpolchlo commented 1 year ago

This PR needs an improved test. I'm in the market for a good sample Item to base it on.

jpolchlo commented 1 year ago

I realized too late that the baseline for the test here should have been derived from rasters that indicate the union/intersection. Not worth holding up the show, though. Merging this, but making this comment for posterity.