Ticket #389 (new Defect)

Opened 1 month ago

Find and Convert ArcGIS Rasters to Polygons fails with ValueError: The feature class ... has the shape type 'polyline', but this function requires a feature class with the shape type 'polygon'

Reported by: jjr8 Assigned to: jjr8
Priority: Medium Milestone: 0.8
Component: Tools - Conversion Version:
Keywords: Cc:

Description

ArcGIS geoprocessing output is similar to this:

Executing (Find and Convert ArcGIS Rasters to Polygons): ArcGISRasterFindAndConvertToPolygons H:\Sea_Ice\UBremen_Ice_Concentration_Rasters H:\Sea_Ice\UBremen_Ice_Edge_Shapefiles false # * false # # # # # # # # # os.path.join(outputWorkspace, 'Ice_Edge_' + os.path.basename(inputRaster)[4:] + '.shp') os.path false H:\Sea_Ice\UBremen_Ice_Edge_Shapefiles
Start Time: Thu Oct 08 14:40:35 2009
Running script ArcGISRasterFindAndConvertToPolygons...
Finding ArcGIS rasters and inserting rows into table "work": workspace="H:\Sea_Ice\UBremen_Ice_Concentration_Rasters", wildcard="*", searchTree=False, rasterType="None"
Finished inserting rows: 0:00:00 elapsed, 124 rows inserted, 0:00:00.003798 per row.
Updating field "outputFeatureClass" in table "work"...
Update complete: 0:00:00 elapsed, 124 rows updated, 0 deleted, 0 unchanged, 0:00:00.001330 per row.
Querying the table "work" to build lists of inputs and outputs...
Query complete: 0:00:00 elapsed, 124 rows retrieved, 0:00:00.000862 per row.
ValueError: The feature class H:\Sea_Ice\UBremen_Ice_Edge_Shapefiles\Ice_Edge_20061201.shp, specified for the element 0 of the outputFeatureClassList parameter (where 0 is the first element), has the shape type 'polyline', but this function requires a feature class with the shape type 'polygon'. Please provide a feature class with shape type 'polygon'.
<type 'exceptions.ValueError'>: The feature class H:\Sea_Ice\UBremen_Ice_Edge_Shapefiles\Ice_Edge_20061201.shp, specified for the element 0 of the outputFeatureClassList parameter (where 0 is the first element), has the shape type 'polyline', but this function requires a feature class with the shape type 'polygon'. Please provide a feature class with shape type 'polygon'.
Failed to execute (Find and Convert ArcGIS Rasters to Polygons).
End Time: Thu Oct 08 14:41:03 2009 (Elapsed Time: 28.00 seconds)

This problem occurs when an output feature class exists but has the wrong shape type. The expected result is that the tool would overwrite the existing output (if overwrite is turned on) or fail with a message saying that the output feature class already exists. Instead the tool is failing to overwrite the output feature class, and instead complaining that it has the wrong shape type.

The workaround to this is to delete the existing feature class manually before running the tool.

If the existing feature class is the expected shape type, then the tool functions properly (it either overwrites it or fails saying it already exists).