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

Add 'from_items' to Extent #223

Merged
merged 1 commit into from
Oct 28, 2020
Merged

Conversation

lossyrob
Copy link
Member

This refactors the code in Collection.update_extent_from_items into a static method on Extent so that the logic can be used in the case where a user has items but not (yet) a collection. This is useful if you are building a Collection from a set of Items, in that you can do:

items = ???
extent = pystac.Extent.from_items(items)
collection = Collection(id="collection_id", description="a description", extent=extent)
collection.add_items(items)

This refactors the code in Collection.update_extent_from_items into a
static method on Extent so that the logic can be used in the case
where a user has items but not (yet) a collection.
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