From 55b020e3bf2f00999283c5e28bacdf0701cb7ada Mon Sep 17 00:00:00 2001 From: samapriya Date: Wed, 26 Dec 2018 12:33:29 -0500 Subject: [PATCH] geeup v0.0.7 --- geeup/geeup.py | 12 ++++-------- geeup/metadata_ingest.py | 1 + 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/geeup/geeup.py b/geeup/geeup.py index f1c6f71..252b86a 100644 --- a/geeup/geeup.py +++ b/geeup/geeup.py @@ -1,6 +1,6 @@ #! /usr/bin/env python -import argparse,os,ee,sys +import argparse,os,ee,sys,platform os.chdir(os.path.dirname(os.path.realpath(__file__))) from hurry import filesize from ee import oauth @@ -79,7 +79,6 @@ def selupload_from_parser(args): multipart_upload=args.large, nodata_value=args.nodata, bucket_name=args.bucket, - band_names=args.bands, manifest=args.manifest) def tabup_from_parser(args): @@ -131,7 +130,6 @@ def main(args=None): required_named.add_argument('--source', help='Path to the directory with images for upload.', required=True) required_named.add_argument('--dest', help='Destination. Full path for upload to Google Earth Engine, e.g. users/pinkiepie/myponycollection', required=True) required_named.add_argument('-m', '--metadata', help='Path to CSV with metadata.') - required_named.add_argument('-mf','--manifest',help='Manifest type to be used,Choose PS OrthoTile(PSO)|PS OrthoTile DN(PSO_DN)|PS OrthoTile Visual(PSO_V)|PS4Band Analytic(PS4B)|PS4Band DN(PS4B_DN)|PS4Band SR(PS4B_SR)|PS3Band Analytic(PS3B)|PS3Band DN(PS3B_DN)|PS3Band Visual(PS3B_V)|RE OrthoTile (REO)|RE OrthoTile Visual(REO_V)') optional_named = parser_upload.add_argument_group('Optional named arguments') optional_named.add_argument('--large', action='store_true', help='(Advanced) Use multipart upload. Might help if upload of large ' 'files is failing on some systems. Might cause other issues.') @@ -148,18 +146,16 @@ def main(args=None): required_named = parser_selupload.add_argument_group('Required named arguments.') required_named.add_argument('--source', help='Path to the directory with images for upload.', required=True) required_named.add_argument('--dest', help='Destination. Full path for upload to Google Earth Engine, e.g. users/pinkiepie/myponycollection', required=True) + required_named.add_argument('-m', '--metadata', help='Path to CSV with metadata.') + required_named.add_argument('-mf','--manifest',help='Manifest type to be used,Choose PS OrthoTile(PSO)|PS OrthoTile DN(PSO_DN)|PS OrthoTile Visual(PSO_V)|PS4Band Analytic(PS4B)|PS4Band DN(PS4B_DN)|PS4Band SR(PS4B_SR)|PS3Band Analytic(PS3B)|PS3Band DN(PS3B_DN)|PS3Band Visual(PS3B_V)|RE OrthoTile (REO)|RE OrthoTile Visual(REO_V)') optional_named = parser_selupload.add_argument_group('Optional named arguments') - optional_named.add_argument('-m', '--metadata', help='Path to CSV with metadata.') optional_named.add_argument('--large', action='store_true', help='(Advanced) Use multipart upload. Might help if upload of large ' 'files is failing on some systems. Might cause other issues.') optional_named.add_argument('--nodata', type=int, help='The value to burn into the raster as NoData (missing data)') - optional_named.add_argument('--bands', type=_comma_separated_strings, help='Comma-separated list of names to use for the image bands. Spaces' - 'or other special characters are not allowed.') - required_named.add_argument('-u', '--user', help='Google account name (gmail address).') optional_named.add_argument('-b', '--bucket', help='Google Cloud Storage bucket name.') - parser_upload.set_defaults(func=upload_from_parser) + parser_selupload.set_defaults(func=selupload_from_parser) parser_tabup = subparsers.add_parser('tabup', help='Batch Table Uploader.') required_named = parser_tabup.add_argument_group('Required named arguments.') diff --git a/geeup/metadata_ingest.py b/geeup/metadata_ingest.py index bd1c8f6..526e0a8 100644 --- a/geeup/metadata_ingest.py +++ b/geeup/metadata_ingest.py @@ -36,6 +36,7 @@ os.chdir(os.path.dirname(os.path.realpath(__file__))) lp=os.path.dirname(os.path.realpath(__file__)) +sys.path.append(lp) ee.Initialize() def selupload(user, source_path, destination_path, manifest=None,metadata_path=None, multipart_upload=False, nodata_value=None, bucket_name=None):