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

"EEException: Date: Parameter 'value' is required" when trying to download ASTER or SRTM data #43

Closed
chrislcosgrove opened this issue Nov 18, 2021 · 1 comment

Comments

@chrislcosgrove
Copy link

chrislcosgrove commented Nov 18, 2021

Thanks for the great tool!

When I try to download an ASTER or SRTM elevation image clipped by an AOI the error "EEException: Date: Parameter 'value' is required" is produced.

Code:
aoi_ASTER = ee.Image('NASA/ASTER_GED/AG100_003').select('elevation').clip(aoi)
aoi_ASTER_ds = aoi_ASTER.wx.to_xarray(scale=50, crs='EPSG:6931')

Error:
`---------------------------------------------------------------------------
HttpError Traceback (most recent call last)
~/opt/miniconda3/envs/SnowSat/lib/python3.9/site-packages/ee/data.py in _execute_cloud_call(call, num_retries)
333 try:
--> 334 return call.execute(num_retries=num_retries)
335 except googleapiclient.errors.HttpError as e:

~/opt/miniconda3/envs/SnowSat/lib/python3.9/site-packages/googleapiclient/_helpers.py in positional_wrapper(*args, **kwargs)
133 logger.warning(message)
--> 134 return wrapped(*args, **kwargs)
135

~/opt/miniconda3/envs/SnowSat/lib/python3.9/site-packages/googleapiclient/http.py in execute(self, http, num_retries)
914 if resp.status >= 300:
--> 915 raise HttpError(resp, content, uri=self.uri)
916 return self.postproc(resp, content)

HttpError: <HttpError 400 when requesting https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/value:compute?prettyPrint=false&alt=json returned "Date: Parameter 'value' is required.". Details: "Date: Parameter 'value' is required.">

During handling of the above exception, another exception occurred:

EEException Traceback (most recent call last)
/var/folders/9t/w440ycrj6z94kk6yxbspq8n40000gn/T/ipykernel_56124/1447908745.py in
1 # Get into xarray datasets
----> 2 overuman_ASTER_ds = overuman_ASTER.wx.to_xarray(scale=50, crs='EPSG:4236')
3 overuman_ASTER_ds

~/opt/miniconda3/envs/SnowSat/lib/python3.9/site-packages/wxee/image.py in to_xarray(self, path, region, scale, crs, masked, nodata, progress, max_attempts)
80 """
81 with tempfile.TemporaryDirectory(prefix=constants.TMP_PREFIX) as tmp:
---> 82 files = self.to_tif(
83 out_dir=tmp,
84 region=region,

~/opt/miniconda3/envs/SnowSat/lib/python3.9/site-packages/wxee/image.py in to_tif(self, out_dir, description, region, scale, crs, file_per_band, masked, nodata, progress, max_attempts)
161 )
162
--> 163 url = self._get_url(region, scale, crs, file_per_band, nodata, max_attempts)
164
165 tifs = self._url_to_tif(

~/opt/miniconda3/envs/SnowSat/lib/python3.9/site-packages/wxee/image.py in _get_url(self, region, scale, crs, file_per_band, nodata, max_attempts)
237 url = img.getDownloadURL(
238 params=dict(
--> 239 name=image_id.getInfo(),
240 scale=scale,
241 crs=crs,

~/opt/miniconda3/envs/SnowSat/lib/python3.9/site-packages/ee/computedobject.py in getInfo(self)
96 The object can evaluate to anything.
97 """
---> 98 return data.computeValue(self)
99
100 def encode(self, encoder):

~/opt/miniconda3/envs/SnowSat/lib/python3.9/site-packages/ee/data.py in computeValue(obj)
670 The result of evaluating that object on the server.
671 """
--> 672 return _execute_cloud_call(
673 _get_cloud_api_resource().projects().value().compute(
674 body={'expression': serializer.encode(obj, for_cloud_api=True)},

~/opt/miniconda3/envs/SnowSat/lib/python3.9/site-packages/ee/data.py in _execute_cloud_call(call, num_retries)
334 return call.execute(num_retries=num_retries)
335 except googleapiclient.errors.HttpError as e:
--> 336 raise _translate_cloud_exception(e)
337
338

EEException: Date: Parameter 'value' is required.`

@aazuspan
Copy link
Owner

Hi @chrislcosgrove, that ASTER image is missing a system:time_start property, which is required by to_xarray. As a workaround, you can give it a system:time_start using the set method before you export it, like so:

aoi_ASTER = aoi_ASTER.set("system:time_start", ee.Date("2000"))

That should resolve your problem, but feel free to re-open if it doesn't.

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