Not much info out there these days on coverages in PYTHON.
I need to convert a feature class to a coverage but cannot find out how to do it in python.
All I have found is "http://resources.esri.com/help/9.3/ArcGISDesktop/com/Gp_ToolRef/conversion_tools/feature_class_to_coverage_conversion_.htm" but this doesn't get me far.
I have all required licenses.
I have not scripted out the example yet as its formatting doesn't make sense to me.
With help from below, I was able create a coverage. That coverage still needs to have Labels created and the arcpy.CreateLabels_arc
is not recognized by arcpy. Not much help out there regarding this either.
I do have ArcINFO installed. I am wondering if I have to create an arcinfo workspace as referenced in http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//0017000000ps000000 .
If this is the case how do I then implement this for my labels?
arcpy.FeatureclassToCoverage_conversion(env.workspace + '\\' + r + ' POLYGON', TEMP + str(FMUNAME) + '_Cov' , "", "DOUBLE")
-
1I think the first hurdles will be whether you have an ArcInfo level license and ArcInfo Workstation installed. If you do, then can you edit your question to include precisely what happens when you try to run that tool.PolyGeo– PolyGeo ♦2015年01月15日 00:37:54 +00:00Commented Jan 15, 2015 at 0:37
-
Do you have an Advanced license? There's the Feature Class To Coverage tool. I don't think it needs ArcInfo workstation installed.mkennedy– mkennedy2015年01月15日 00:39:38 +00:00Commented Jan 15, 2015 at 0:39
-
I'll defer to @mkennedy on whether you need ArcInfo Workstation installed.PolyGeo– PolyGeo ♦2015年01月15日 01:11:48 +00:00Commented Jan 15, 2015 at 1:11
-
I was just able to run it on a standard polygon shapefile in 10.3 without workstation installed. However, the "label" layer for two different conversions give an error message when trying to draw them in ArcMap.mkennedy– mkennedy2015年01月15日 16:52:16 +00:00Commented Jan 15, 2015 at 16:52
2 Answers 2
The Feature Class to coverage tool is maintained in ArcGis 10.1.
You may need to create an ArcInfo workspace first and then put the coverage there. From memory the tool will break the features down to the requirements of a coverage:
- 500 vertex limit on lines
- no overlapping polygons
- lines cannot intersect
After conversion it may be necessary to Build the coverage to enforce topology and create elements that don't exist (like build for node).
All of these tools require an Advanced (ArcInfo) license level.
If you have ArcInfo workstation installed you can use SHAPEARC to import a shapefile. More advanced data storage (personal/file geodatabase) cannot be accessed/manipulated in workstation but shapefiles and CAD can be imported... If you're not familiar with workstation then I would avoid using (or even installing) it as you're likely to get yourself frustrated very quickly. There are still many on GIS.SE that remember workstation and AML should you have any specific problems.
-
Working inside of arcgis I have no trouble with feature class to coverage. I am trying to implement it inside of python code.D_C– D_C2015年01月15日 00:42:30 +00:00Commented Jan 15, 2015 at 0:42
-
1If it can be done in model builder then export to python or alternately as PolyGeo showed recently you can export to python script from the results window in catalog. This will give you a template that you can manipulate/modify for scripting.Michael Stimson– Michael Stimson2015年01月15日 00:47:35 +00:00Commented Jan 15, 2015 at 0:47
-
it is late in the day and i forgot to even try exporting my model; I went directly to google and that turned up nothing.D_C– D_C2015年01月15日 00:51:08 +00:00Commented Jan 15, 2015 at 0:51
-
1It's hard to find anything about coverages any more. They're not completely depreciated though - the rigid topology has its uses!Michael Stimson– Michael Stimson2015年01月15日 00:54:05 +00:00Commented Jan 15, 2015 at 0:54
-
1@DavidCampbell if "Working inside of arcgis I have no trouble with feature class to coverage" then simply see the python examples in the help that Michael Miles-Stimson linked to in his answer.user2856– user28562015年01月15日 03:43:23 +00:00Commented Jan 15, 2015 at 3:43
In order to use the _arc tools, I had to get at the toolbox and alter the alias:
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")
if tbx is None:
print "Toolbox is null"
else:
tools = arcpy.ListTools("*_arc")
print "Number of tools found: " + str(len(tools))
for tool in tools:
print tool
#print arcpy.Usage(tool)
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 = 1
for fc in arcpy.ListFeatureClasses():
print 'Working on ' + fc
OutName3 = TEMP + "TSA_EX2_" + OutName + ".shp"
CovName = TEMP + "airworkspace3\\" + "Layer"
CovName3 = TEMP + "airworkspace3\\" + "Success"
if arcpy.Exists(CovName + str(r)):
arcpy.Delete_management(CovName + str(r))
arcpy.FeatureclassToCoverage_conversion(fc + " POLYGON", CovName + str(r), "", "DOUBLE")
r += 1
print 'Working on Union'
arcpy.Union_newalias(CovName + "1", CovName+ "2", CovName3)