Skip to content

Commit 1fd3d96

Browse files
committed
added masking option
- added option to use last band for mask
1 parent ab9bfd4 commit 1fd3d96

File tree

6 files changed

+21
-3
lines changed

6 files changed

+21
-3
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ Required named arguments.:
262262
263263
Optional named arguments:
264264
--nodata NODATA The value to burn into the raster as NoData (missing data)
265+
--mask MASK Binary to use last band for mask True or False
265266
--pyramids PYRAMIDS Pyramiding Policy, MEAN, MODE, MIN, MAX, SAMPLE
266267
```
267268

@@ -339,6 +340,9 @@ optional arguments:
339340

340341
# Changelog
341342

343+
### 0.6.4
344+
- Added masking option to use last band as mask
345+
342346
### 0.6.2
343347
- Removed call to shell
344348
- Now prints status of task at task creation

docs/changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
### 0.6.4
4+
- Added masking option to use last band as mask
5+
36
### 0.6.2
47
- Removed call to shell
58
- Now prints status of task at task creation

geeup/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
__author__ = "Samapriya Roy"
44
__email__ = "[email protected]"
5-
__version__ = "0.6.3"
5+
__version__ = "0.6.4"

geeup/batch_uploader.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def upload(
8888
user,
8989
source_path,
9090
pyramiding,
91+
mask,
9192
destination_path,
9293
metadata_path=None,
9394
nodata_value=None,
@@ -216,6 +217,7 @@ def upload(
216217
"end_time": {"seconds": ""},
217218
"properties": j,
218219
"missing_data": {"values": [nodata_value]},
220+
"maskBands": {"bandIds": [], "tilesetId": ''}
219221
}
220222
if start is not None:
221223
main_payload["start_time"]["seconds"] = start
@@ -227,7 +229,10 @@ def upload(
227229
main_payload.pop("end_time")
228230
if nodata_value is None:
229231
main_payload.pop("missing_data")
230-
# print(json.dumps(main_payload))
232+
if bool(mask) is False:
233+
main_payload.pop("maskBands")
234+
235+
# print(json.dumps(main_payload, indent=2))
231236
schema = {
232237
"asset_path": {
233238
"type": "string",

geeup/geeup.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ def upload_from_parser(args):
303303
destination_path=args.dest,
304304
metadata_path=args.metadata,
305305
nodata_value=args.nodata,
306+
mask=args.mask,
306307
pyramiding=args.pyramids,
307308
overwrite=args.overwrite
308309
)
@@ -562,6 +563,11 @@ def main(args=None):
562563
type=int,
563564
help="The value to burn into the raster as NoData (missing data)",
564565
)
566+
optional_named.add_argument(
567+
"--mask",
568+
default=False,
569+
help="Binary to use last band for mask True or False",
570+
)
565571
optional_named.add_argument(
566572
"--pyramids",
567573
help="Pyramiding Policy, MEAN, MODE, MIN, MAX, SAMPLE",

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def readme():
1515

1616
setuptools.setup(
1717
name="geeup",
18-
version="0.6.3",
18+
version="0.6.4",
1919
packages=find_packages(),
2020
url="https://github.com/samapriya/geeup",
2121
install_requires=[

0 commit comments

Comments
 (0)