Cache of collections that can be used to avoid re-reading Collection JSON in pystac.serialization.merge_common_properties
. The CollectionCache will contain collections as either as dicts or PySTAC Collections, and will set Collection JSON that it reads in order to merge in common properties.
Caches a collection JSON.
This class tracks resolved objects tied to root catalogs. A STAC object is ‘resolved’ when it is a Python Object; a link to a STAC object such as a Catalog or Item is considered “unresolved” if it’s target is pointed at an HREF of the object.
Tracking resolved objects allows us to tie together the same instances when there are loops in the Graph of the STAC catalog (e.g. a LabelItem can link to a rel:source, and if that STAC Item exists in the same root catalog they should refer to the same Python object).
Resolution tracking is important when copying STACs in-memory: In order for object links to refer to the copy of STAC Objects rather than their originals, we have to keep track of the resolved STAC Objects and replace them with their copies.
id_keys_to_objects – Existing cache of a key made up of the STACObject and it’s parents IDs mapped to the cached STACObject.
hrefs_to_objects – STAC Object HREFs matched to their cached object.
ids_to_collections – Map of collection IDs to collections.
Set the given object into the cache.
obj – The object to cache
Returns True if there is a collection with given collection ID is cached.
Get the cached object that has the same cache key as the given object.
obj – The given object who’s cache key will be checked against the cache.
Either the cached object that has the same cache key as the given object, or None
STACObject or None
Gets the cached object at href.
href – The href to use as the key for the cached object.
Returns the STACObject if cached, otherwise None.
STACObject or None
Retrieved a cached Collection by its ID.
id – The ID of the collection.
with the given ID, otherwise None.
Collection or None
Gets the STACObject that is the cached version of the given STACObject; or, if none exists, sets the cached object to the given object.
obj – The given object who’s cache key will be checked against the cache.
Either the cached object that has the same cache key as the given object, or the given object.
STAC Object HREFs matched to their cached object.
Existing cache of a key made up of the STACObject and it’s parents IDs mapped to the cached STACObject.
Map of collection IDs to collections.
Merges two ResolvedObjectCache.
The merged cache will give preference to the first argument; that is, if there are cached keys that exist in both the first and second cache, the object cached in the first will be cached in the resulting merged ResolvedObjectCache.
first – The first cache to merge. This cache will be the preferred cache for objects in the case of ID conflicts.
second – The second cache to merge.
The resulting merged cache.
Removes any cached object that matches the given object’s cache key.
obj – The object to remove
Caches a collection JSON.
Produce a cache key for the given STAC object.
If a self href is set, use that as the cache key. If not, use a key that combines this object’s ID with it’s parents’ IDs.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4