1

I have a process in which I need to use coverages. I can create the coverages just fine using FeatureClassToCoverage_conversion within arcpy but trying to union 2 coverages together does not work in arcpy with the identified method "Union_arc". I suspect it has something to do with creating an ArcINFO workspace, but I do not know how to use this for _arc commands.

The error is "Object: Tool or environment not found" I have ArcINFO installed and can run these tools successfully in Modelbuilder. I have attached a test script to get Union working. Running 10.1 ArcGIS python 2.7.

import arcpy, os, sys
from arcpy import env
print 'Starting....'
env.OverWriteOutput = True
arcpy.SetProduct("ArcInfo")
env.workspace = "G:\\Projects\\P747\3円_Landbase\\LB1\\temp\\test2\\"
TEMP = "\\\\silver\\clients\\Projects\\P747\3円_Landbase\\LB1\\TEMP\\"
print 'Loaded Data....'
if arcpy.Exists(TEMP + "airworkspace3"):
 arcpy.Delete_management(TEMP + "airworkspace3")
arcpy.CreateArcInfoWorkspace_management(TEMP, "airworkspace3")
r = str(1)
for fc in arcpy.ListFeatureClasses():
 print 'Working on ' + fc
 CovName = TEMP + "airworkspace3\\" + "Layer1"
 CovName3 = TEMP + "airworkspace3\\" + "Success"
 if arcpy.Exists(CovName + str(r)):
 arcpy.Delete_management(CovName + str(r))
 arcpy.FeatureclassToCoverage_conversion(fc + " POLYGON", CovName + r, "", "DOUBLE")
 r += str(1)
print 'Working on Union' 
arcpy.Union_arc(CovName + "1", CovName2+ "2", CovName3)
print 'Completed ' + fc + ' processing....' 
asked Jan 16, 2015 at 21:02
6
  • what is the error message? Commented Jan 16, 2015 at 21:23
  • can you run the tools and then use Geoprocessing>Results>CopyAsPythonSnippet to help with the code? Commented Jan 16, 2015 at 21:24
  • That is what I have done and the tools are not recognized by arcpy Commented Jan 16, 2015 at 21:30
  • stand alone or in the python window? Commented Jan 16, 2015 at 21:33
  • 1
    Would you be able to edit your question to include a code snippet that can be used by someone with an Advanced level license to see precisely where you are stuck, please? Commented Jan 17, 2015 at 2:50

1 Answer 1

1

After much fanfare, I found this to work. Seems really strange to have to re-name an alias, but it worked.

import arcinfo, arcpy, os, sys
from arcpy import env
arcpy.SetProduct("ArcInfo")
tbx = arcpy.ImportToolbox(r"C:\Program Files (x86)\ArcGIS\Desktop10.1\ArcToolbox\Toolboxes\Coverage Tools.tbx", "newalias")
print arcpy.Usage("union_newalias")
arcpy.Union_newalias(CovName1, CovName2, CovName3)
answered Jan 30, 2015 at 18:02

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.