How to Find the Intersection Between Two pystac
Item Collections?
#289
-
I have defined a coordinate bounding box that I'm using to query two Planetary Computer catalogs, that I then store in two seperate # first search
search_one = catalog.search(collections=["example-cat1"],
bbox=latlon_bounds,
datetime=time_range)
items_one = search_one.get_all_items()
# second search
search_two = catalog.search(collections=["example-cat2"],
bbox=latlon_bounds,
datetime=time_range)
items_two = search_two.get_all_items() How do I find the intersection of Thank you in advance for any help with this! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Do you want a single geometry as your output? Or a collection of geometries (where each on is like the intersection between two input items)? I think the second one would be a spatial join, which is implemented in geopandas: https://geopandas.org/en/stable/gallery/spatial_joins.html. We have a small example of geopandas + STAC at https://planetarycomputer.microsoft.com/docs/quickstarts/reading-stac/#Analyzing-STAC-Metadata. |
Beta Was this translation helpful? Give feedback.
Do you want a single geometry as your output? Or a collection of geometries (where each on is like the intersection between two input items)?
I think the second one would be a spatial join, which is implemented in geopandas: https://geopandas.org/en/stable/gallery/spatial_joins.html. We have a small example of geopandas + STAC at https://planetarycomputer.microsoft.com/docs/quickstarts/reading-stac/#Analyzing-STAC-Metadata.