-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask1e.py
More file actions
24 lines (17 loc) · 781 Bytes
/
Task1e.py
File metadata and controls
24 lines (17 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import arcpy
# Set workspace
arcpy.env.workspace = 'V:/ENV859_PS4/Data'
# Allow us to overwrite output
arcpy.env.overwriteOutput = True
# Create list of buffer distance values
buffDists = ["100", "200", "300", "400", "500"]
#ChatGPT referenced to debug code (pasted for loop, no question posed) - removed "meters" from buffDists list, and specified meters in buffer analysis tool
#Iterate through buffDists
for i in buffDists:
# Set local variables
in_features = "streams.shp"
out_feature_class = "V:/ENV859_PS4/Scratch/buff_{}m.shp".format(i)
# Execute buffer
arcpy.Buffer_analysis(in_features, out_feature_class, "{} Meters".format(i), "", "", "ALL")
# display any messages, warnings, or errors to interactive console
print(arcpy.GetMessages())