-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNashville_Imagery.py
33 lines (25 loc) · 1.01 KB
/
Nashville_Imagery.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import arcpy
import boto3
from botocore.handlers import disable_signing
import os
#Franchyze923 working data from youtube
s3 = boto3.resource('s3')
s3.meta.client.meta.events.register('choose-signer.s3.*', disable_signing)
bucket = 'noaa-eri-pds'
mosaic_dataset = r"D:\Projects\GISData\AWS_Testing.gdb\Nashville_Tornado"
my_bucket = s3.Bucket(bucket)
prefix = "2020_Nashville_Tornado/20200307a_RGB/"
counter = 0
images_to_add = []
for file in my_bucket.objects.filter(Prefix=prefix):
counter+=1
vsis3_image_path = os.path.join("/vsis3/", bucket, file.key).replace("\\", "/")
print("Adding {} to list".format(vsis3_image_path))
print("counter = {}".format(counter))
images_to_add.append(vsis3_image_path)
if counter > 50:
break
print("This is the image list, to be used as input for AddRasters {}".format(images_to_add))
arcpy.AddRastersToMosaicDataset_management(mosaic_dataset, "Raster Dataset", images_to_add)
print(arcpy.GetMessages())
print("Program finished")