How to apply the 'Integrate' tool (data management) using arcpy

4196
2
Jump to solution
02-11-2015 10:55 PM
TorstenLange
Occasional Contributor

Hi,

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

-- arcpy.Integrate_management() --

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 would appreciate a working example having 2 shapes: a.shp (rank 1), b.shp (rank 2).

I'm using ArcGIS 10.2

Thanks, Torsten

0 Kudos
1 Solution

Accepted Solutions
TorstenLange
Occasional Contributor

Hi Neil,

thanks a lot - though late - for your hint! It wasn't clear to me that "Value table" really means it's a data type, though the table column states 'data type' in the header. Thought of an explanation like "table of values" - maybe a normal python list.

I couldn't use your example as given, as the "insertRow"-method doesn't exist, but addRow.

vTab = arcpy.ValueTable(2)

vTab.addRow("ShapeA.shp" + " 1")

vTab.addRow("ShapeB.shp" + " 2")

arcpy.Integrate_management(vTab,0.01)

Thanks again,

Torsten

View solution in original post

0 Kudos
2 Replies
NeilAyres
MVP Alum

The list of features and their rank is stated to be a Value Table type in the help.

So just create a value table in arcpy.

vTab = arcpy.ValueTable()
vTab.insertRow("{} {}".format("ShapeA.shp", 1))
vTab.insertRow("{} {}".format("ShapeB.shp", 2))

Then use the vTab in the Integrate tool.

0 Kudos
TorstenLange
Occasional Contributor

Hi Neil,

thanks a lot - though late - for your hint! It wasn't clear to me that "Value table" really means it's a data type, though the table column states 'data type' in the header. Thought of an explanation like "table of values" - maybe a normal python list.

I couldn't use your example as given, as the "insertRow"-method doesn't exist, but addRow.

vTab = arcpy.ValueTable(2)

vTab.addRow("ShapeA.shp" + " 1")

vTab.addRow("ShapeB.shp" + " 2")

arcpy.Integrate_management(vTab,0.01)

Thanks again,

Torsten

0 Kudos