pystac icon indicating copy to clipboard operation
pystac copied to clipboard

Efficiently fetching a specific child object

Open palmerj opened this issue 4 years ago • 11 comments

I'm having trouble reducing the number of s3 calls in my application with a catalog containing many 1000's of child objects. If I call catalog.get_child(id, recursive=False) it will iterate through the child objects in sequence resolving each of them until it finds object it needs. Given that the child links don't contain the ID of the referenced object this is understandable. However, the child URLs from a STAC catalog published using best practises do contain the ID. Would it be possible to somehow add an optimisation to pystac to use the URL to short circuit the lookup process? I guess it could fall back to traversing the child objects if the URL extract of the ID doesn't work and the returned object ID doesn't match. I'm also wondering if this an issue with the STAC specification.

palmerj avatar Jun 07 '20 06:06 palmerj