-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pagination doesn't work for Copernicus product catalogue #641
Comments
Looks like that server doesn't correctly support POST requests (which is what pystac-client is using in your first example), and isn't returning a $ curl -s -X POST https://catalogue.dataspace.copernicus.eu/stac/search --json '{"collections": ["SENTINEL-2"]}' | jq .links <<<
null
$ curl -s -X GET https://catalogue.dataspace.copernicus.eu/stac/search --json '{"collections": ["SENTINEL-2"]}' | jq .links
[
{
"rel": "next",
"type": "application/json",
"href": "https://catalogue.dataspace.copernicus.eu/stac/search?page=2"
},
{
"rel": "self",
"type": "application/json",
"href": "https://catalogue.dataspace.copernicus.eu/stac/search"
},
{
"rel": "root",
"type": "application/json",
"href": "https://catalogue.dataspace.copernicus.eu/stac"
}
] As a workaround, you can provide from pystac_client import Client
catalog = Client.open("https://catalogue.dataspace.copernicus.eu/stac")
item_search = catalog.search(
collections=["SENTINEL-2"],
method="GET",
max_items=100,
limit=10,
)
print(len(list(item_search.items()))) # <- prints 100 Note that POST is recommended but not required, so there's an argument that pystac-client should default to GET (at least when there's no |
As an aside, https://catalogue.dataspace.copernicus.eu/stac does advertise $ curl -s https://catalogue.dataspace.copernicus.eu/stac | jq '.links[6]'
{
"href": "https://catalogue.dataspace.copernicus.eu/stac/search",
"title": "STAC search",
"rel": "search",
"type": "application/json",
"method": "POST"
} |
The response of Dataspace Copernicus support is that:
|
First, initializing the client and creating the search over the Copernicus product catalogue:
The following code doesn't automatically paginate:
However, the following code does automatically paginate:
The text was updated successfully, but these errors were encountered: