Overwrite datasets in scratch geodatabase arcpy?

I've created a scratch file geodatabase, intended to be a temporary location where I can reproject the necessary datasets. The script runs fine the first go around. However, it fails on the second try since the feature classes in the scratch file geodatabase already exist.

What is the best way to overwrite or delete the data sets (sourceNAD27, sourceNAD83 and sourceWGS84) in my scratch file geodatabase?

       # source is the full path to the datasets in the sde         sourceNAD27 = os.path.join(sourceDB,'{schema}.{table}'.format(schema=sourceDict['schema'], table=sourceDict['table']))          # copy features into a temporary location         arcpy.FeatureClassToFeatureClass_conversion(sourceNAD27,os.path.join(arcpy.env.scratchGDB),'sourceNAD27')          # project from GCS_North_American_1927 to GCS_North_American_1983         arcpy.Project_management (os.path.join(arcpy.env.scratchGDB, 'sourceNAD27'), os.path.join(arcpy.env.scratchGDB, 'sourceNAD83'), 4269, "NAD_1927_To_NAD_1983_NADCON", 4267)          # project from GCS_North_American_1983 to WGS_1984_Web_Mercator_Auxiliary_Sphere         arcpy.Project_management (os.path.join(arcpy.env.scratchGDB, 'sourceNAD83'), os.path.join(arcpy.env.scratchGDB, 'sourceWGS84'), 3857, "WGS_1984_(ITRF00)_To_NAD_1983", 4269)          # target is the full path to the datasets in the sde         target = os.path.join(targetDB,'{schema}.{table}'.format(schema=targetDict['schema'], table=targetDict['table'])) 

Replay

Figured it out, arcpy.env.overwriteOutput = True

Category: arcpy Time: 2016-07-29 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.125 (s). 12 q(s)