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 load_stac to localprocessing #445

Closed
wants to merge 16 commits into from

Conversation

clausmichele
Copy link
Member

Added a copy paste version of load_stac into the LocalConnection object.
This will allow me to use it in this way:

import openeo
from openeo.local import LocalConnection
local_conn = LocalConnection('')
url = "https://planetarycomputer.microsoft.com/api/stac/v1/collections/landsat-c2-l2"
spatial_extent = {"west": 11.259613, "east": 11.406212, "south": 46.461019, "north": 46.522237}
temporal_extent = ["2022-06-01","2022-06-15"]
bands = ["red"]
properties = {"eo:cloud_cover": dict(lt=50)}
s2_cube = local_conn.load_stac(url=url,
                    spatial_extent=spatial_extent,
                    temporal_extent=temporal_extent,
                    bands=bands,
                    properties=properties)
s2_cube.execute()

@soxofaan we would need to understand if we could reuse the code I'm developing here Open-EO/openeo-processes-dask#127 to get the cube metadata, since from the url only is not so easy, especially for big STAC Collections.
If the metadata is not set correctly, the client unfortunately doesn't allow to proceed in many cases. By the way, is it possible to deactivate manually the checks on the metadata?

@clausmichele clausmichele marked this pull request as ready for review June 28, 2023 16:06
@soxofaan
Copy link
Member

soxofaan commented Jul 7, 2023

we would need to understand if we could reuse the code I'm developing here Open-EO/openeo-processes-dask#127 to get the cube metadata

The local processing feature currently depends on openeo_processes_dask[implementations], so it should be possible to reuse functionality from there.

By the way, is it possible to deactivate manually the checks on the metadata?

yes, I'm considering something like that under #442

@clausmichele
Copy link
Member Author

@soxofaan I added the code that, once the load_stac PR in openeo-processes-dask will be merged, will load the metadata using that implementation. It adds some overhead in terms of time, but in the meanwhile validates also the load_stac call.

openeo/local/connection.py Outdated Show resolved Hide resolved
openeo/local/connection.py Outdated Show resolved Hide resolved
openeo/local/connection.py Outdated Show resolved Hide resolved
openeo/local/connection.py Show resolved Hide resolved
openeo/local/connection.py Outdated Show resolved Hide resolved
@clausmichele
Copy link
Member Author

@soxofaan the changes that we discussed about have been implemented, you could now review and merge!

Copy link
Member

@soxofaan soxofaan left a comment

Choose a reason for hiding this comment

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

some minor stuff

requirements-localprocessing.txt Show resolved Hide resolved
docs/cookbook/localprocessing.rst Outdated Show resolved Hide resolved
docs/cookbook/localprocessing.rst Outdated Show resolved Hide resolved
docs/cookbook/localprocessing.rst Show resolved Hide resolved
docs/cookbook/localprocessing.rst Show resolved Hide resolved
docs/cookbook/localprocessing.rst Outdated Show resolved Hide resolved
docs/cookbook/localprocessing.rst Outdated Show resolved Hide resolved
openeo/local/connection.py Outdated Show resolved Hide resolved
@clausmichele
Copy link
Member Author

@soxofaan points from review addressed!

soxofaan added a commit that referenced this pull request Jul 18, 2023
@soxofaan
Copy link
Member

merged in 8d1d947

@soxofaan soxofaan closed this Jul 18, 2023
@clausmichele clausmichele deleted the add_load_stac branch May 6, 2024 08:05
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.

2 participants