Skip to content

Commit 4343a02

Browse files
committed
geeadd 0.1.6
1 parent 07bc03e commit 4343a02

File tree

8 files changed

+36
-228
lines changed

8 files changed

+36
-228
lines changed

README.md

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
# Google Earth Engine Batch Asset Manager with Addons
2-
[![DOI](https://zenodo.org/badge/87708514.svg)](https://zenodo.org/badge/latestdoi/87708514)
3-
42
Google Earth Engine Batch Asset Manager with Addons is an extension of the one developed by Lukasz [here](https://github.com/tracek/gee_asset_manager) and additional tools were added to include functionality for moving assets, conversion of objects to fusion table, cleaning folders, querying tasks. The ambition is apart from helping user with batch actions on assets along with interacting and extending capabilities of existing GEE CLI. It is developed case by case basis to include more features in the future as it becomes available or as need arises. tab.
53

64
![CLI](http://i.imgur.com/8Cvh3XY.gif)
@@ -12,6 +10,7 @@ Google Earth Engine Batch Asset Manager with Addons is an extension of the one d
1210
* [Parsing metadata](#parsing-metadata)
1311
* [Usage examples](#usage-examples)
1412
* [EE User](#ee-user)
13+
* [Create](#create)
1514
* [Upload a directory with images and associate properties with each image:](#upload-a-directory-with-images-and-associate-properties-with-each-image)
1615
* [Upload a directory with images with specific NoData value to a selected destination:](#upload-a-directory-with-images-with-specific-nodata-value-to-a-selected-destination)
1716
* [Asset List](#asset-list)
@@ -23,20 +22,11 @@ Google Earth Engine Batch Asset Manager with Addons is an extension of the one d
2322
* [Assets Copy](#assets-copy)
2423
* [Assets Access](#assets-access)
2524
* [Set Collection Property](#set-collection-property)
26-
* [Convert to Fusion Table](#convert-to-fusion-table)
2725
* [Cleanup Utility](#cleanup-utility)
2826
* [Cancel all tasks](#cancel-all-tasks)
2927

3028
## Installation
31-
We assume Earth Engine Python API is installed and EE authorised as desribed [here](https://developers.google.com/earth-engine/python_install). This toolbox also uses some functionality from GDAL
32-
For installing GDAL in Ubuntu
33-
```
34-
sudo add-apt-repository ppa:ubuntugis/ppa && sudo apt-get update
35-
sudo apt-get install gdal-bin
36-
```
37-
For Windows I found this [guide](https://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windows) from UCLA
38-
39-
To install toolbox:
29+
We assume Earth Engine Python API is installed and EE authorised as desribed [here](https://developers.google.com/earth-engine/python_install). To install:
4030
```
4131
git clone https://github.com/samapriya/gee_asset_manager_addon
4232
cd gee_asset_manager && pip install .
@@ -58,11 +48,17 @@ sudo python setup.py develop or sudo python setup.py install
5848

5949
As usual, to print help:
6050
```
51+
usage: geeadd.py [-h]
52+
{ee_user,create,upload,lst,tasks,taskquery,report,delete,mover,copy,access,collprop,cleanout,cancel}
53+
...
54+
6155
Google Earth Engine Batch Asset Manager with Addons
6256
6357
positional arguments:
64-
{ee_user,upload,lst,tasks,taskquery,report,delete,mover,copy,access,collprop,convert2ft,cleanout,cancel}
58+
{ee_user,create,upload,lst,tasks,taskquery,report,delete,mover,copy,access,collprop,cleanout,cancel}
6559
ee_user Allows you to associate/change GEE account to system
60+
create Allows the user to create an asset collection or
61+
folder in Google Earth Engine
6662
upload Batch Asset Uploader.
6763
lst List assets in a folder/collection or write as text
6864
file
@@ -81,8 +77,6 @@ positional arguments:
8177
"folder" --asset "users/john/doe" --user
8278
8379
collprop Sets Overall Properties for Image Collection
84-
convert2ft Uploads a given feature collection to Google Fusion
85-
Table.
8680
cleanout Clear folders with datasets from earlier downloaded
8781
cancel Cancel all running tasks
8882
@@ -161,6 +155,17 @@ Having metadata helps in organising your asstets, but is not mandatory - you can
161155
### EE User
162156
This tool is designed to allow different users to change earth engine authentication credentials. The tool invokes the authentication call and copies the authentication key verification website to the clipboard which can then be pasted onto a browser and the generated key can be pasted back
163157

158+
### Create
159+
This tool allows you to create a collection or folder in your earth engine root directory. The tool uses the system cli to achieve this and this has been included so as to reduce the need to switch between multiple tools and CLI.
160+
```
161+
usage: ppipe.py create [-h] --typ TYP --path PATH
162+
163+
optional arguments:
164+
-h, --help show this help message and exit
165+
--typ TYP Specify type: collection or folder
166+
--path PATH This is the path for the earth engine asset to be created full
167+
path is needsed eg: users/johndoe/collection
168+
```
164169
### Upload a directory with images to your myfolder/mycollection and associate properties with each image:
165170
```
166171
geeadd upload -u [email protected] --source path_to_directory_with_tif -m path_to_metadata.csv --dest users/johndoe/myfolder/myponycollection
@@ -300,20 +305,6 @@ optional arguments:
300305
```
301306

302307

303-
### Convert to Fusion Table
304-
Once validated with gdal and google fusion table it can be used to convert any geoObject to google fusion table. Forked and contributed by Gennadii [here](https://github.com/gena/ogr2ft). The scripts can be used only with a specific google account
305-
```
306-
usage: geeadd.py convert2ft [-h] --i I --o O [--add_missing]
307-
308-
optional arguments:
309-
-h, --help show this help message and exit
310-
--i I input feature source (KML, SHP, SpatiLite, etc.)
311-
--o O output Fusion Table name
312-
--add_missing add missing features from the last inserted feature index
313-
314-
geeadd.py convert2ft --i "./aoi.kml" --o "converted_aoi"
315-
```
316-
317308
### Cleanup Utility
318309
This script is used to clean folders once all processes have been completed. In short this is a function to clear folder on local machine.
319310
```
@@ -336,4 +327,4 @@ usage: geeadd.py cancel [-h]
336327
337328
optional arguments:
338329
-h, --help show this help message and exit
339-
```
330+
```

geeadd/batch_uploader.pyc

-967 Bytes
Binary file not shown.

geeadd/ee_ls.pyc

-108 Bytes
Binary file not shown.

geeadd/gee_assets_errors.log

Whitespace-only changes.

geeadd/gee_assets_info.log

Whitespace-only changes.

geeadd/geeadd.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@ def upload_from_parser(args):
3838
metadata_path=args.metadata,
3939
multipart_upload=args.large,
4040
nodata_value=args.nodata)
41-
def ft_from_parser(args):
42-
input_file=str(args.i)
43-
output_ft=str(args.o)
44-
os.system("ogr2ft.py -i "+input_file+" -o "+output_ft)
41+
4542
def taskquery_from_parser(args):
4643
taskquery(destination=args.destination)
4744
def mover_from_parser(args):
@@ -65,6 +62,11 @@ def tasks_from_parser(args):
6562

6663
def ee_authorization():
6764
os.system("python ee_auth.py")
65+
def create_from_parser(args):
66+
typ=str(args.typ)
67+
ee_path=str(args.path)
68+
os.system("earthengine create "+typ+" "+ee_path)
69+
6870
def ee_user_from_parser(args):
6971
ee_authorization()
7072
def genreport_from_parser(args):
@@ -82,6 +84,11 @@ def main(args=None):
8284
parser_ee_user=subparsers.add_parser('ee_user',help='Allows you to associate/change GEE account to system')
8385
parser_ee_user.set_defaults(func=ee_user_from_parser)
8486

87+
parser_create = subparsers.add_parser('create',help='Allows the user to create an asset collection or folder in Google Earth Engine')
88+
parser_create.add_argument('--typ', help='Specify type: collection or folder', required=True)
89+
parser_create.add_argument('--path', help='This is the path for the earth engine asset to be created full path is needsed eg: users/johndoe/collection', required=True)
90+
parser_create.set_defaults(func=create_from_parser)
91+
8592
parser_upload = subparsers.add_parser('upload', help='Batch Asset Uploader.')
8693
required_named = parser_upload.add_argument_group('Required named arguments.')
8794
required_named.add_argument('-u', '--user', help='Google account name (gmail address).', required=True)
@@ -138,12 +145,6 @@ def main(args=None):
138145
parser_collprop.add_argument('--p',help='"system:description=Description"/"system:provider_url=url"/"system:tags=tags"/"system:title=title')
139146
parser_collprop.set_defaults(func=collprop_from_parser)
140147

141-
parser_ft = subparsers.add_parser('convert2ft',help='Uploads a given feature collection to Google Fusion Table.')
142-
parser_ft.add_argument('--i', help='input feature source (KML, SHP, SpatiLite, etc.)', required=True)
143-
parser_ft.add_argument('--o', help='output Fusion Table name', required=True)
144-
parser_ft.add_argument('--add_missing', help='add missing features from the last inserted feature index', action='store_true', required=False, default=False)
145-
parser_ft.set_defaults(func=ft_from_parser)
146-
147148
parser_cleanout=subparsers.add_parser('cleanout',help='Clear folders with datasets from earlier downloaded')
148149
parser_cleanout.add_argument('--dirpath',help='Folder you want to delete after all processes have been completed')
149150
parser_cleanout.set_defaults(func=cleanout_from_parser)

geeadd/ogr2ft.py

Lines changed: 0 additions & 184 deletions
This file was deleted.

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44
setup(
55
name='geeadd',
6-
version='0.1.5',
7-
packages=find_packages(),
8-
package_data={'geeadd': ['logconfig.json']},
6+
version='0.1.6',
7+
packages=['geeaddon'],
8+
package_data={'geeaddon': ['logconfig.json']},
99
url='https://github.com/samapriya/gee_asset_manager_addon',
1010
license='Apache 2.0',
1111
classifiers=(
@@ -26,7 +26,7 @@
2626
description='Google Earth Engine Batch Assets Manager with Addons',
2727
entry_points={
2828
'console_scripts': [
29-
'geeadd=geeadd.geeadd:main',
29+
'geeadd=geeaddon.geeadd:main',
3030
],
3131
},
3232
)

0 commit comments

Comments
 (0)