Open-EO / openeo-r-client

R client package for working with openEO backends

Home Page:https://open-eo.github.io/openeo-r-client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

get_sample: Create spatial extent based on gsd

m-mohr opened this issue · comments

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.

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.

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 ;-)