Select to view content in your preferred language

ArcGIS Pro 2.5: How to overwrite outputs of geoprocessing tools when run in a model builder?

5544
11
05-08-2020 09:22 AM
JamalNUMAN
Legendary Contributor

ArcGIS Pro 2.5: How to overwrite outputs of geoprocessing tools when run in a model builder?

 

Despite the fact that “Allow geoprocessing tools to overwrite existing datasets” option is checked, outputs appear not be overwritten when working with model builder.

 

What could be the issue here?

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
11 Replies
oliviersouligno
New Contributor

Hi Jamal,

Wow, I have exactly the same issue, I am happy to see that I am not the only one to experiment this .

Did you find a solution ?

JamalNUMAN
Legendary Contributor

Hi Olivier,

I’m still waiting for some feedback from esri experts on this issue. Not sure if some of them has already explored this problem

 

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
JoeBorgione
MVP Emeritus

I don't write any models, but you should be able to set an environment that allows you to over write existing data.

Take a look here: Geoprocessing environment settings—ArcGIS Pro | Documentation 

That should just about do it....
JamalNUMAN
Legendary Contributor

 

I couldn’t find myself an option that allows overwriting except the one that appears in screenshots of my first post.

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
JamalNUMAN
Legendary Contributor

For example, if the cell size the in the “Euclidian Distance” is changed, then the outputs are not replaced, instead new raster are created!

 

Is there a way to overwrite such that the number of outputs are kept 5 for my model?

----------------------------------------
Jamal Numan
Geomolg Geoportal for Spatial Information
Ramallah, West Bank, Palestine
AZendel
Frequent Contributor

If I'm interpreting these posts correctly, there is no way to specify that a particular/individual geoprocessing model should overwrite its outputs. The only option is to set this in the Pro options tab as shown in the first post. Is this still the case? I'm calling a lot of geoprocessing models from ArcPy and I want to allow some of the models to overwrite existing outputs. This setting in the Pro user interface is likely ignored when running a completely standalone ArcPy script. 

Please confirm when you can. And ESRI, if you're reading this, please allow this option to be set within individual models. 

0 Kudos
curtvprice
MVP Esteemed Contributor

When calling your model from arcpy, arcpy.env.overwriteOutput should be set to True. Is this not working? Often in the desktop apps it is common for a layer to not easily release file locks (regardless of overwrite setting), lots of bug fixes of that through the years.

When running standalone outside of the desktop app, there aren't data layers in the interface (just in memory when created) so these problems are less likely - IF you make sure the environment overwriteOutput is set to True in your code.

0 Kudos
AZendel
Frequent Contributor

Thanks for the suggestion. I just tried arcpy.env.overwriteOutput = True and it does work. 

mbramos
Occasional Contributor

Is there a way to write this as a custom script tool and pop it into an existing Model? The model I'm creating has to be able to be used in the GP pane as a 'tool'. 

0 Kudos