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 ItemCollection.to_collection #1254

Closed
gadomski opened this issue Oct 4, 2023 · 6 comments · Fixed by #1522
Closed

Add ItemCollection.to_collection #1254

gadomski opened this issue Oct 4, 2023 · 6 comments · Fixed by #1522
Assignees

Comments

@gadomski
Copy link
Member

gadomski commented Oct 4, 2023

This would be a nice convenience method that would generate the extents, etc from the items in the ItemCollection.

@jsignell
Copy link
Member

I think of ItemCollections as more analogous to Catalogs than to Collections. I guess I think that because you can represent items from more than one Collection in an ItemCollection. But I guess from pystac's perspective Collections just inherit from Catalogs so maybe it doesn't matter?

@gadomski
Copy link
Member Author

Yeah, I agree with the general point that not all ItemCollections map to a Collection. However, often they do (e.g. a search result), and creating a "sub-collection" (here's a collection that describes my search results) could be of use to some folks?

@jsignell jsignell modified the milestone: 2.0 Nov 17, 2023
@gadomski gadomski added this to the v1.12 milestone Sep 23, 2024
@KeynesYouDigIt
Copy link
Contributor

On paper, this makes sense as interesting and I was thinking of taking it on. However, do we have more bites from users on whether or not this would solve an active problem for them?

@gadomski
Copy link
Member Author

Nope! This would be more of a "if you build it they will come" feature.

I do tend to create issues like this one when I'm using pystac and it's ergonomics don't match my expectations, so that's one user I guess 🙂

@jsignell
Copy link
Member

jsignell commented Feb 6, 2025

I'm taking a crack at this. Considering doing it the other way around and putting a from_items on Collection that way it could take an iterable of items or an ItemCollection. Is there a reason why the other way around would be better you think?

@jsignell jsignell self-assigned this Feb 6, 2025
@gadomski
Copy link
Member Author

gadomski commented Feb 7, 2025

Is there a reason why the other way around would be better you think?

Nope, makes sense to me, and I feel like we're most of the way there with https://pystac.readthedocs.io/en/stable/api/pystac.html#pystac.Extent.from_items (which I find myself using and then passing to a collection a lot).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants