gee_asset_manager icon indicating copy to clipboard operation
gee_asset_manager copied to clipboard

ee.ee_exception.EEException: Property key "system:time_start" is invalid. Property keys must contain only letters, digits, and underscores.

Open arkanoid87 opened this issue 5 years ago • 1 comments

Traceback (most recent call last):
  File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/ee/data.py", line 324, in _execute_cloud_call
    return call.execute(num_retries=num_retries)
  File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/googleapiclient/_helpers.py", line 130, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/googleapiclient/http.py", line 856, in execute
    raise HttpError(resp, content, uri=self.uri)
googleapiclient.errors.HttpError: <HttpError 400 when requesting https://earthengine.googleapis.com/v1alpha/projects/earthengine-legacy/image:import?alt=json returned "Property key "system:time_start" is invalid. Property keys must contain
 only letters, digits, and underscores.">

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/jack/gee_asset_manager/gee_asset_manager/batch_uploader.py", line 126, in upload
    task_id = __start_ingestion_task(asset_request)
  File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/retrying.py", line 212, in call
    raise attempt.get()
  File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/six.py", line 696, in reraise
    raise value
  File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "/home/jack/gee_asset_manager/gee_asset_manager/batch_uploader.py", line 195, in __start_ingestion_task
    _ = ee.data.startIngestion(task_id, asset_request)
  File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/ee/data.py", line 1393, in startIngestion
    operation = _execute_cloud_call(
  File "/home/jack/miniconda3/envs/earthengine/lib/python3.8/site-packages/ee/data.py", line 326, in _execute_cloud_call
    raise _translate_cloud_exception(e)
ee.ee_exception.EEException: Property key "system:time_start" is invalid. Property keys must contain only letters, digits, and underscores.

arkanoid87 avatar Nov 20 '19 05:11 arkanoid87

time_start now is handled differently

https://developers.google.com/earth-engine/image_manifest

this quick horrible fix works:

def __create_asset_request(asset_full_path, gsid, properties, nodata_value, band_names):
    if band_names:
        band_names = [{'id': name} for name in band_names]

    return {"id": asset_full_path,
            "tilesets": [
                {"sources": [
                    {"primaryPath": gsid,
                     "additionalPaths": []
                     }
                ]}
            ],
            "bands": band_names,
            # "properties": properties,
            "start_time": { "seconds": properties["time_start"] }
            }

arkanoid87 avatar Nov 20 '19 05:11 arkanoid87