Select to view content in your preferred language

I am trying to buffer multiple feature classes from a directory but I keep getting the same error message.

1244
11
03-19-2020 11:30 AM
JohnnyMonds
Emerging Contributor

import arcpy

# Set workspace for listing
arcpy.env.workspace = r"T:\chastain\PrgGIS\World"
# Get a list of all feature classes
fcs = arcpy.ListFeatureClasses("*")
# Loop through the list
for fc in fcs:
#print names
print("These feature classes are in the World folder", fc)
Output = fc + "Buff"
arcpy.Buffer_analysis(fc, Output, "100 Meters")

ERROR 000670: output Output Feature Class is same as input Input Features
Failed to execute (Buffer).

Tags (1)
0 Kudos
11 Replies
DavidPike
MVP Frequent Contributor

Hey you're very welcome Johnny. Two final points:

1. dependant on the buffer distance you may want to consider a "GEODESIC" buffer to preserve true distance.

2. Buffering country sized polyline data is extreeeeeemely processing intensive

JohnnyMonds
Emerging Contributor

Ok, update...Found the Country shapefile to be corrupted, thank you for your help. here is my final script

import arcpy,os

# Set workspace for listing
arcpy.env.workspace = r"T:\chastain\PrgGIS\World"
# Get a list of all feature classes
fcs = arcpy.ListFeatureClasses("*")
# Loop through the list
for fc in fcs:
fc_path = os.path.join(arcpy.env.workspace, fc)
#print names
print("These feature classes are in the World folder", fc)
Output = r"C:\Users\johnny.monds\Desktop\Test" +fc[:-4] + "_Buff.shp"
arcpy.Buffer_analysis(fc, Output, "100 Meters", "FULL", "ROUND", "ALL")

0 Kudos