You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think the pystac_client.Client.get_collection method should contact the GET /collections/{collectionId} endpoint instead of iterating through the response of GET /collections. Its better for an API client to utilize the server where appropriate instead of doing something client-side, and the later runs into issues for APIs which have a lot of collections that aren't necessarily exposed through the first call to GET /collections.
The text was updated successfully, but these errors were encountered:
@geospatial-jeff totally agree with this, the iteration seems unnecessary.
Just thinking this through....pystac-client works with both static catalogs and APIs. get_collection currently calls get_collections. In the case of an API it will call /collections. In the case of a static catalogs it will look at just the immediate children and find the right one. In a static catalog also, the link is not necessarily the collection ID so it has to be iterated through.
I think the right answer here is that get_collection should also check for conformance, and if this is an API that supports the /collections endpoint then it should use /collections/<cid>, otherwise resort to iterating through.
Will try and get this into the next minor release which should be in the next day.
I think the
pystac_client.Client.get_collection
method should contact theGET /collections/{collectionId}
endpoint instead of iterating through the response ofGET /collections
. Its better for an API client to utilize the server where appropriate instead of doing something client-side, and the later runs into issues for APIs which have a lot of collections that aren't necessarily exposed through the first call toGET /collections
.The text was updated successfully, but these errors were encountered: