Skip to content
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

init #1

Merged
merged 4 commits into from
Mar 20, 2024
Merged

init #1

merged 4 commits into from
Mar 20, 2024

Conversation

vincentsarago
Copy link
Member

@vincentsarago vincentsarago commented Mar 20, 2024

Initial PR with /collections/{collectionId} and /collections/{collectionId}/items/{itemId} set of endpoints. Most of the code comes from titiler-pgstac and titiler-cmr



@attr.s
class STACAPIBackend(BaseBackend):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a custom MosaicBackend which will call the /search API on each tile request to get the list of assets

params.pop("bbox", None)

results = catalog.search(**params)
return list(results.items_as_dicts())
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're using pystac-client to call the STAC API and handle the pagination

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note: we are using .items_as_dicts to avoid serialization to pystac Item.

We are also using a custom (simple) STAC Reader which expects Dict as input

# "filter": query,
# "filter-lang": filter_lang,
"limit": limit or 100,
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main dependency for the /collections mosaic endpoint. Only collectionId is required for now

Note: This is assuming we only want to visualize ONE collection at a time.

@vincentsarago vincentsarago merged commit 891082f into main Mar 20, 2024
5 checks passed
@vincentsarago vincentsarago deleted the sketch branch March 21, 2024 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant