-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_buffer.py
More file actions
31 lines (23 loc) · 847 Bytes
/
create_buffer.py
File metadata and controls
31 lines (23 loc) · 847 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
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
"""
Created on Sun May 3 13:06:55 2020
@author: Naomi
"""
# This script runs the Buffer tool. The user supplies the input
# and output paths, and the buffer distance.
import arcpy
arcpy.env.overwriteOutput = True
try:
# Get the input parameters for the Buffer tool
inPath = arcpy.GetParameterAsText(0)
outPath = arcpy.GetParameterAsText(1)
bufferDistance = arcpy.GetParameterAsText(2)
# Run the Buffer tool
arcpy.Buffer_analysis(inPath, outPath, bufferDistance)
# Report a success message
arcpy.AddMessage("All done!")
except:
# Report an error messages
arcpy.AddError("Could not complete the buffer")
# Report any error messages that the Buffer tool might have generated
arcpy.AddMessage(arcpy.GetMessages())