Closed pt20 closed 6 months ago
Hello, @pt20, the current workflow of Xee is as follows: If you are passing the geometry, the bounds are taken from the provided geometry itself and If you are not passing the geometry, the bounds are taken from the crs.
In the preceding example, you didn’t include geometry in ds
, so it uses the bounds from the (CRS), which are (-180.0, -90.0, 180.0, 90.0)
. In contrast, in ds2
you included geometry, so it uses the bounds from the geometry, which are -101.87406 33.53129 -101.80808 33.57658
.
is there an oversight in setting the dimensions according to the AOI and scale correctly?
- Upon reviewing the dimensions of the AOI, it's important to note that the longitude coordinates range from -101.8740622035503 to -101.80807878169567, with a scale set to 20 degrees.
- The scale of 20 degrees is utilized because, in the absence of a specified projection, the default CRS is 'EPSG:4326'. As a result, the units are interpreted as degrees.
Based on this geometry and scale, the bounding box coordinates are calculated using the formula x_min + scale_x
& y_max + scale_y
. The resulting coordinates for the bounding box are accurately determined as (-91.87406, 23.57658).
Please let me know if you have any more questions, and I'll do my best to help!
I am closing this issue if you still have doubt please feel free to reopen it.
Hi @dabhicusp ,
Thank you for your response and apologies for the delay, somehow I didn't get notification of your reply.
I understand now how the scale factor works. I will try with scale factor 0.00018
which would roughly translate to 20 meters.
Description
I am experiencing an issue with the
xee
library when trying to load anImageCollection
from Google Earth Engine into an xarray dataset. Specifically, the dimensions of the dataset are not as expected when I specify thegeometry
andscale
parameters. This behavior is inconsistent with the expected outcome described in thexee
documentation and compared to similar operations on other collections likeECMWF/ERA5_LAND/HOURLY
.Steps to Reproduce
ImageCollection
using theCOPERNICUS/S2_SR
andCOPERNICUS/S2_CLOUD_PROBABILITY
collections for a specific area of interest (AOI) and date range.ImageCollection
to an xarray dataset without specifyinggeometry
andscale
, and observe the dimensions.ImageCollection
to an xarray dataset, this time specifyinggeometry
andscale
, and note the change in dimensions.Here's a refactored version of the
s2-cloudless
notebook.Expected Behavior
The dimensions of the dataset (ds2) should accurately represent the specified AOI and scale, similar to the dimensions observed when performing a similar operation on the
ECMWF/ERA5_LAND/HOURLY
collection (as per readme).Actual Behavior
The dimensions of the dataset
ds
istime: 1, lon: 360, lat: 180
(meaning whole globe) andds2
significantly reduce totime: 1, lon: 1, lat: 1
(based on lat, lon values it seems like centroid of the AOI) upon specifying geometry and scale. This reduction does not align with the expected spatial resolution or the size of the AOI.Additional Context
The AOI polygon is approximately 30sqkm in the mainland US. I followed the procedures provided in the s2-cloudless notebook and the guidance in the xee library's README. Is the observed behavior intended, or is there an oversight in setting the dimensions according to the AOI and scale correctly?
Many thanks in advance and let me know if I should provide additional info! 🙏🏽