I try to integrate two features (shapes) with their ranks using ArcPy.


I don't get a clue from the explanation/example in ArcGIS help. It's straight forward, however, to apply this tool from the graphical dialog.

I seek a working example having 2 shapes: a.shp (rank 1), b.shp (rank 2).

I'm using ArcGIS 10.2


This is an example where shapefile 'a' will have rank 1 and shapefile 'b' will have rank 2, integrated with a tolerance of 100 meters:

import arcpy
a = r"C:\data\a.shp"
b = r"C:\data\b.shp"
arcpy.Integrate_management("a 1; b 2", "100 meters")

Trick: if you don't know the arcpy syntax of a tool, you can either

  • put the tool with the desired parameters in Modelbuilder and export it to a Python script (Model menu > Export > To Python Script);
  • run the tool (standalone) and export it as Python snippet from the geoprocessing results window (right-click the tool in the results window > Copy As Python Snippet).
  • I finally used a value table... vTab = arcpy.ValueTable(2) vTab.addRow("a.shp" + " 1") vTab.addRow("b.shp" + " 1") arcpy.Integrate_management(vTab,0.01) ...but your approach seems to be a short cut to it. – tlange Feb 20 '15 at 6:13
  • @GISGe, you code won't work, this is what you meant arcpy.Integrate_management("{} 1; {} 2".format(a,b), "100 meters") – gotchula Jan 14 '16 at 22:28

Your Answer

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

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