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

get_sample: Create spatial extent based on gsd #120

Open
m-mohr opened this issue Apr 8, 2022 · 2 comments
Open

get_sample: Create spatial extent based on gsd #120

m-mohr opened this issue Apr 8, 2022 · 2 comments

Comments

@m-mohr
Copy link
Member

m-mohr commented Apr 8, 2022

The current implementation is having a certain type of data (i.e. roughly having S2, L8, S1 resolutions) in mind. When you use S5P with very coarse resolution though, the default implementation with the 0.0003° radius only returns ~1px. On the other hand, for very high resolution imagery, it returns a relatively large sample.
The implementation should read the metadata and try to get the gsd from it (there are several locations where you can look though). This is usually in meters and can be roughly converted to degrees. In this cases it doesn't need to be overly precise though. Based on that the sample can be more consistently sized.

@flahn
Copy link
Member

flahn commented Apr 8, 2022

When I check a collection with multiple resoultions, the field "gsd" has ultiple elements then.

coll = describe_collection("SENTINEL2_L2A")
coll$summaries$gsd
## [[1]]
## [1] 10
##
## [[2]]
## [1] 30
##
## [[3]]
## [1] 60

Need to decide at some point whether to use the highest or lowest resolution.

@m-mohr
Copy link
Member Author

m-mohr commented Apr 8, 2022

In Platform only, there's also openeo:gsd per band, which also gives you x/y information and a unit.

But yeah, reading from the summaries, I assume I'd take the 60 in this case, because it seems better to have a little too much data rather than having just a single pixel ;-)

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

No branches or pull requests

2 participants