arcgis.features.manage_data overlay_layers method does not make use of context={"overwrite":True} parameter.

574
2
Jump to solution
04-18-2023 07:46 AM
BennyFriedman2
New Contributor

Hello all. 

I am using the overlay_layers method to erase building footprints from a layer of ground conditions. I'd like to do this by calling the overlay_layers method on the grounds layer and passing in the buildings layer as the overlay feature, then setting the output_name equal to the grounds layer name so that the cliped grounds layer replaces the original grounds layer. See code below: 

overlay_layers(grounds_layer, buildings_layer, overlay_type='Erase', output_name=f"{grounds_title}", context={"overwrite": True})

Running hat code returns the error: {Exception}Job failed.

 

However, if I set the output_name to something like "{grounds_title}_clipped" the job runs successfully and a clipped version is added to my arcgis online content. 

This leads me to believe it is not a problem with the name, or underlying data but is in fact an issue with the overwrite parameter. 

Thank you for any help.

@DavidPike @KevinHibma @David_McRitchie 

 

 

0 Kudos
1 Solution

Accepted Solutions
BennyFriedman2
New Contributor

Found the solution. To get the overwrite to work correctly you need to pass the layer object of the layer you'd like to overwrite into the output_name parameter.

grounds_clip = overlay_layers(grounds_layer, buildings_layer, overlay_type='Erase', output_name=grounds_layer, context={"overwrite": True})

 

View solution in original post

2 Replies
BennyFriedman2
New Contributor

Found the solution. To get the overwrite to work correctly you need to pass the layer object of the layer you'd like to overwrite into the output_name parameter.

grounds_clip = overlay_layers(grounds_layer, buildings_layer, overlay_type='Erase', output_name=grounds_layer, context={"overwrite": True})

 

David_McRitchie
Esri Contributor

Hey Benny apologies for not getting a chance to look at this, I was away on holiday. Glad to see you got it all sorted though!

Please feel free to @ mention me in future and more than happy to help where I can.

Esri UK -Technical Support Analyst
0 Kudos