Correct syntax for coverage

1194
17
09-04-2012 02:41 PM
SamCoggins1
New Contributor III
Hello:

I've got a script that looks in a directory, finds coverages, and converts the coverages to a geodatabase. This works perfectly for every feature class in the coverage, except 'arc'. I have tried multiple ways of importing the 'arc' feature class, each time Python tells me it doesn't not exist or is not supported. I am wondering if I'm using the correct syntax, which I had assumed to be similar to a geodatabase. I am using this to refer to the arc feature class:

CDMS_Arc = "I:\\Workspace\\Coverage\\Arc"

Thanks
Tags (2)
0 Kudos
17 Replies
MathewCoyle
Frequent Contributor
Can you do the export manually through ArcCatalog or ArcMap?
0 Kudos
SamCoggins1
New Contributor III
Yep, manual exports work, only in ArcMap. All tools work through Model builder and as standalone tools, again only in ArcMap, not ArcCatalog...
0 Kudos
MathewCoyle
Frequent Contributor
Yep, manual exports work, only in ArcMap. All tools work through Model builder and as standalone tools, again only in ArcMap, not ArcCatalog...


So in ArcMap you load the whole coverage and can export the arc, but in ArcCatalog you cannot navigate to the arc feature at all, is that right?
0 Kudos
SamCoggins1
New Contributor III
Sorry, I'm not explaining this very well... Think I'm going brain dead from banging my head on my desk!

In ArcMap I can open a tool as a standalone, or in model builder and then drag and drop the arc features into the tool, navigate to its location in the directory from within the tool, or use the arc features in a tool by referencing it from the table of contents in ArcMap. Each time the arc file has worked I have not imported any of the other features from the coverage, just the arc's. Which also means I have only opened the arc features in ArcMap.

If I export a model as a script, even with ArcMap open the script fails because the 'file arc does not exist or is not supported'. I have tried loading other features from the coverage to a file geodatabase, no problem. Does it first time.

I did find that I could make a feature class within ArcCatalog and then use the Data Loader (make feature class, right click on new feature, Load Data) to import the arc features. However, I haven't found a Python function that uses the Data Load function.
0 Kudos
MathewCoyle
Frequent Contributor
Is this a line coverage or a polygon coverage? I'm assuming polygon since you talk about other features. Using the coverage toolbox, rebuild and/or clean it. Or if you are comfortable with ArcInfo Workstation you can try building and cleaning with that. Is this the only coverage you are having an issue with or is it every arc feature of all your coverages?

Also, if you can post your code you are having problems with that would help.
0 Kudos
SamCoggins1
New Contributor III
Hello again...

I'll see if I can clean the data using your suggestion. The arc file is a line file, it is contained in some coverages, but not in others. Therefore some coverages convert without a problem but my script crashes for others. I'm not sure whether posting the script will do you any good, I've simply written in a line that tells the script that if an 'arc' feature exists then to ignore it, because it gets hung up otherwise. I've also written a standalone script to try and convert the 'arc' features, it also crashes. However, I know the script works because I can use it to convert other feature classes within the coverage to geodatabase feature classes.

The coverage I'm using is not the only one containing an 'arc' feature class, there are several others. I cannot convert any of the arc features to a geodatabase feature class.

I appreciate your help! Thanks, Sam
0 Kudos
MathewCoyle
Frequent Contributor
As an example, this is how I export features from a coverage. I navigate to each coverage and make it my current workspace so I simply export by feature class name.

covList = arcpy.ListDatasets()
for cov in covList:
    arcpy.env.workspace = os.path.join(directory, folder, cov)
    if arcpy.Exists("polygon"):
        print "Converting", cov
        arcpy.FeatureClassToFeatureClass_conversion("polygon", outPath, cov)
    elif arcpy.Exists("arc"):
        print "Converting", cov
        arcpy.FeatureClassToFeatureClass_conversion("arc", outPath, cov)
0 Kudos
SamCoggins1
New Contributor III
Ok, I hard-coded it for this demonstration ... I can copy over a 'tic' feature from the coverage to the geodatabase, but not the 'arc' feature using this code:

# Import arcpy module
import arcpy, os

fc = 'Arc'

# Local variables:
CDMS_Arc = r'c:\TEST2\CDMS' + os.sep + fc
CDMS_gdb = r'c:\TEST2\CDMS.gdb' + os.sep + fc

# Process: Feature Class to Geodatabase (multiple)
#arcpy.CopyFeatures_management(CDMS_Arc, CDMS_gdb)
arcpy.FeatureClassToFeatureClass_conversion(CDMS_Arc, r'c:\TEST2\CDMS.gdb', fc)


I get this error message when I use either the FeatureClassToFeatureClass or the CopyFeatures (I used one or the other as you'll notice from my code):

Traceback (most recent call last):
  File "I:/Q_workspace/Sam_GIS/290812_CoveragetoGDB/Test10.py", line 19, in <module>
    arcpy.FeatureClassToFeatureClass_conversion(CDMS_Arc, r'c:\TEST2\CDMS.gdb', fc)
  File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 1132, in FeatureClassToFeatureClass
    raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000732: Input Features: Dataset c:\TEST2\CDMS\Arc does not exist or is not supported
Failed to execute (FeatureClassToFeatureClass).
0 Kudos
MathewCoyle
Frequent Contributor
I don't think it should matter, but try 'arc' instead, all lower case.
0 Kudos