Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

How can I code an "overwrite option" on a standalone ZonalStatisticsAsTable using ArcPy?

I don't see any overwrite option from a Esri example.

# Execute ZonalStatisticsAsTable
outZSaT = ZonalStatisticsAsTable(inZoneData, zoneField, inValueRaster, 
                                 outTable, "NODATA", "MEAN")

Is impossible or possible to overwrite?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

Use arcpy.env.overwriteOutput.

arcpy.env.overwriteOutput = True
# Execute ZonalStatisticsAsTable
outZSaT = ZonalStatisticsAsTable(inZoneData, zoneField, inValueRaster, 
                                 outTable, "NODATA", "MEAN")
share|improve this answer
    
It worked fine. Thanks –  Nahm Aug 26 at 22:44
1  
(in case it's not obvious, note that Jason's answer applies to the whole session, not just to this command) –  Stephen Lead Aug 27 at 4:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.