diff --git a/README.md b/README.md index 390ae22..29508ab 100644 --- a/README.md +++ b/README.md @@ -239,6 +239,9 @@ optional arguments: ``` # Changelog +### v0.3.3 +- Added fix for handling no data in manifests while uploading. + ### v0.3.2 - Fixed issue with selsetup. diff --git a/geeup/__init__.py b/geeup/__init__.py index 2bd006a..7894574 100644 --- a/geeup/__init__.py +++ b/geeup/__init__.py @@ -2,4 +2,4 @@ __author__ = 'Samapriya Roy' __email__ = 'samapriya.roy@gmail.com' -__version__ = '0.3.2' +__version__ = '0.3.3' diff --git a/geeup/batch_uploader.py b/geeup/batch_uploader.py index a65fff7..5d1116d 100644 --- a/geeup/batch_uploader.py +++ b/geeup/batch_uploader.py @@ -151,7 +151,10 @@ def upload(user, source_path, destination_path, metadata_path=None, nodata_value # j['id']=destination_path+'/'+line["id_no"] # j['tilesets'][0]['sources'][0]['primaryPath']=gsid json_data = json.dumps(j) - main_payload={"id": asset_full_path,"tilesets": [{"sources": [{"primaryPath": gsid,"additionalPaths": []}]}],"properties": j,"missingData": {"value": nodata_value}} + if nodata_value is not None: + main_payload={"id": asset_full_path,"tilesets": [{"sources": [{"primaryPath": gsid,"additionalPaths": []}]}],"properties": j,"missingData":{"value":nodata_value}} + else: + main_payload={"id": asset_full_path,"tilesets": [{"sources": [{"primaryPath": gsid,"additionalPaths": []}]}],"properties": j} with open(os.path.join(lp,'data.json'), 'w') as outfile: json.dump(main_payload, outfile) subprocess.call("earthengine --no-use_cloud_api upload image --manifest "+'"'+os.path.join(lp,'data.json')+'"',shell=True) diff --git a/setup.py b/setup.py index 271c526..1ba8f43 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def readme(): setuptools.setup( name="geeup", - version="0.3.2", + version="0.3.3", packages=find_packages(), url="https://github.com/samapriya/geeup", install_requires=[