File already exists after file was just created. Code in attached picture

1445
1
Jump to solution
12-07-2020 10:50 AM
SharitaU
New Contributor II

Generic Parameters: Table X (where the latitude value of some records are 0 while other records have a latitude of roughly -88) and Folder A

Program Goal: If folder A does not exist, create folder A, geocode just the records of table X where latitude is 0 and store the resulting shapefile in folder A. If folder A does exist, delete folder A, create folder A, geocode just the records of table X where latitude is 0 and store the resulting shapefile in folder A.

My code actually does everything I need it to do. The problem is however is that regardless of whether folder A existed previously or whether it was just created, once my file is geocoded and saved to folder A, my program throws error 000725 "Output feature class already exists". I don't understand why I'm running into this problem since the output feature class was just created. Even the time stamps of the files are accurate so I know I'm not looking at an old version of the shapefile. 

Help is greatly appreciated. Thanks in advance

0 Kudos
1 Solution

Accepted Solutions
DanPatterson
MVP Esteemed Contributor

The preview doesn't work (may be tied up in internal checks). 

Enter the code between the code blocks by clicking on the . . . and selecting the </> and insert your code.

 

In any event, you should set the ability to overwriteOutputs and use the "Exists" check.

Checking for the existence of data—ArcGIS Pro | Documentation

 

arcpy.env.overwriteOutput = True

 

 


... sort of retired...

View solution in original post

1 Reply
DanPatterson
MVP Esteemed Contributor

The preview doesn't work (may be tied up in internal checks). 

Enter the code between the code blocks by clicking on the . . . and selecting the </> and insert your code.

 

In any event, you should set the ability to overwriteOutputs and use the "Exists" check.

Checking for the existence of data—ArcGIS Pro | Documentation

 

arcpy.env.overwriteOutput = True

 

 


... sort of retired...