eomatch.mu_stac.MatchupCatalogue.add_asset_by_id

eomatch.mu_stac.MatchupCatalogue.add_asset_by_id#

MatchupCatalogue.add_asset_by_id(collection_id: str, item_id: str, asset_key: str, file_path: str, media_type: str | None = None, title: str | None = None, roles: List[str] | None = None) → bool[source]#

Add or replace a STAC asset on an item identified by collection and item ID.

Lower-level alternative to add_matchup_asset() for use when only the STAC IDs are known (e.g. from a CLI or after a query() call), without a live Matchup object.

Parameters:
  • collection_id – ID of the collection containing the target item.

  • item_id – ID of the item to update.

  • asset_key – asset key to set, e.g. "comparison:2026-05-12".

  • file_path – path or URL to use as the asset’s href.

  • media_type – MIME type for the asset; auto-detected from the file extension if None.

  • title – human-readable title for the asset; defaults to the filename.

  • roles – STAC asset roles, e.g. ["thumbnail"].

Returns:

True if the item was found and updated, False if not found.