Skip to content

Client.search().pages() using paging does not work correctly #490

@honza801

Description

@honza801

Hi,

I'm trying to count all items in collection using paging, but it seems, that paging is not working correctly. It seems it that Client.search().pages() yields ony the first page.

According to the pystac-client API reference for pystac_client.Client.search method

max_items – The maximum number of items to return from the search
limit – A recommendation to the service as to the number of items to return per page of results

I wrote code inspired by Usage/ItemSearch documentation. Following code results in 1 page and 100 items, but 2 pages and 200 items should be proceeded.

results = client.search(limit=100, max_items=200, collections=collection)
pages = 0
items = 0
for page in results.pages():
    pages+=1
    for item in page.items:
        items+=1
print(pages, items)

Having limit=200 and max_items=100 does not work either.

Am I doing something wrong?

Thanks,
Jan

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions