1

I cannot get arcpy.Integrate_management to work. I can run as a standalone process in ArcMap just fine, and if I copy the result as a python snippet I get:

arcpy.Integrate_management(in_features="SFMTA_BikeLanes #", cluster_tolerance="30 Feet")

Now, I try to modify this to use in my Python script, so that the process runs on a feature class that exists in my geodatabase. I've tried:

#Set tolerance
ftTolerance = "30 Feet"
#arcpy.Integrate_management("G:\Shared drives\Bike Facilities Data\SF_BikeLanes.gdb\SFMTA_BikeLanes #", ftTolerance)

I've also tried:

#arcpy.Integrate_management("G:\Shared drives\Bike Facilities Data\SF_BikeLanes.gdb\SFMTA_BikeLanes", ftTolerance)

And, also tried:

# Define bike lanes feature class
bikeLanes = r'G:\Shared drives\Bike Facilities Data\SF_BikeLanes.gdb\SFMTA_BikeLanes'

arcpy.Integrate_management(bikeLanes,ftTolerance)

With all these, the script fails with the following error:

 Traceback (most recent call last):
  File "G:\My Drive\GIS\Bike_Aerial_Map_Automation\Scripts\Automation_Test.py", line 184, in <module>
    arcpy.Integrate_management(bikeLanes, ftTolerance)
  File "c:\program files (x86)\arcgis\desktop10.7\arcpy\arcpy\management.py", line 2133, in Integrate
    raise e
RuntimeError: Object: Error in executing tool

Failed to execute (TestAutomation).

Can anyone tell me what I'm doing wrong?

  • 1
    Your code looks right. You're missing the r for raw string in some of your paths but this isn't an issue with your paths. Maybe try running the Repair Geometry tool on your input and then try to Integrate again. – Emil Brundage Aug 20 at 20:44
  • Thanks, I've defined bikeLanes using the r : bikeLanes = r'G:\Shared drives\Bike Facilities Data\SF_BikeLanes.gdb\SFMTA_BikeLanes' So, as a last option I can try Repair Geometry? I'm a bit baffled here why this isn't working. – DiamondJoe12 Aug 20 at 20:51
  • 2
    What happened to # symbol, that exists in snippet? – FelixIP Aug 20 at 21:35
  • See the first option I tried in my answer - the # symbol is there, still fails. – DiamondJoe12 Aug 20 at 22:02
  • Anyone?! Still unable to solve this. – DiamondJoe12 Aug 22 at 17:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.