start into ee functionality
This commit is contained in:
parent
ea14aae7ce
commit
17b6e9fc14
@ -110,11 +110,11 @@ parser.add_argument(
|
||||
parser.add_argument(
|
||||
"-O",
|
||||
"--override-existing",
|
||||
dest='override-existing',
|
||||
default=True,
|
||||
dest='override_existing',
|
||||
action='count',
|
||||
default=0,
|
||||
required=False,
|
||||
action='store_true',
|
||||
help="verbose mode, log output goes to stderr")
|
||||
help="will not refetch an existing file unless this option is specified")
|
||||
|
||||
parser.add_argument(
|
||||
"-c",
|
||||
@ -177,7 +177,6 @@ target_region_name="{}{}{}".format(args.country,
|
||||
bbox=get_mainland_bbox(args.country, args.region)
|
||||
logging.debug("BBOX for [{}] as tuple is {}".format(target_region_name, bbox))
|
||||
|
||||
#ee.Geometry.BBox(w,s,e,n)
|
||||
b_list = list(bbox)
|
||||
logging.debug("BBOX for [{}] as list is {}".format(target_region_name, b_list))
|
||||
|
||||
@ -185,5 +184,18 @@ target_filename = target_region_name + ".png"
|
||||
|
||||
if os.path.exists(target_filename):
|
||||
logging.debug("The file [{}] already exists.".format(target_filename))
|
||||
if args.override_existing == 0:
|
||||
print("The file [{}] already exists. -O flag not specified. Exiting.".format(target_filename))
|
||||
sys.exit(5)
|
||||
else:
|
||||
logging.debug("The file [{}] does not exist.".format(target_filename))
|
||||
logging.debug("Creating file [{}]".format(target_filename))
|
||||
with open(target_filename, 'w') as f:
|
||||
pass
|
||||
|
||||
ee.Initialize(project="arizona-topo")
|
||||
elv = ee.Image('USGS/SRTMGL1_003')
|
||||
region_of_interest = ee.Geometry.BBox(b_list[0],
|
||||
b_list[1],
|
||||
b_list[2],
|
||||
b_list[3])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user