ERROR

InvalidShapeException: invalid shapes were detected

Error Message

When adding shapefiles to Author or ArcExplorer Java Edition or creating a MapService in Administrator that uses shapefiles, the follow error message is displayed in the Message Console for Author, ArcExplorer Java Edition or Administrator:

"Jan 1, 2002 12:00:00 PM: com.esri.mo.file.shp.db
com.esri.mo.file.shp.InvalidShapeException: X invalid shape/s were detected in <servicename>
at com.esri.mo.file.shp.eb.dispose(Unknown Source)
at com.esri.mo.data.feat.BaseFilterCursor.dispose(Unknown Source)
at com.esri.mo.map.draw.BaseRenderer.draw(Unknown Source)
..."

Cause

There are three possible reasons a shapefile can generate an InvalidShapeException error:

1. When a shape is not of the same type as the file. For instance, a point shape in a polygon file.

2. When there is a problem with the shape geometry. For instance, a polyline with a path that contains one point. Polyline paths must contain at least two points. Another example is a polygon whose ring does not have at least three points. Polygon rings must close and, therefore, should have at least three points.

3. When a null shape is encountered.

Solution or Workaround

Remove the invalid shapes from the shapefile.

  1. Start ArcCatalog.
  2. Create a new personal geodatabase: right-click on a folder in the Catalog tree and select New > Personal Geodatabase.
  3. Right-click on the personal geodatabase, select Import > Shapefile to Geodatabase
    and specify the shapefile, providing a name for the output feature class.
  4. If the shapefile has no spatial reference information, specify a projection for the output feature class.

    A. In the Shapefile to Geodatabase wizard, click Change Settings.

    B. In the Output Settings Window, under the Spatial Reference Tab, click Change�.

    C. Click Select� to specify a projection.

    D. Select the projection that pertains to the shapefile.

    E. Click Add.

    F. Click OK.

    G. Click OK to close the Output Settings window.



    If the shapefile has the correct projection, continue to Step 5.
  5. Click OK to run the conversion process, which creates a new feature class has under the personal geodatabase.
  6. Right-click on the new feature class and select Export > Geodatabase to Shapefile.
  7. In the dialog box, specify a name for the new shapefile. Click OK to run the conversion process.
  8. Close ArcCatalog.
  9. Start ArcMap and add the new shapefile.
  10. Open the attribute table for this layer.

    Note:
    A new field called 'Shape_Leng' has been added to the attribute table.

  11. Add the Editor toolbar to ArcMap, if necessary. This toolbar can be added by right-clicking on the ArcMap toolbar and checking the Editor choice.
  12. On the Editor toolbar, click Start Editing.
  13. Sort the table in ascending order of the 'Shape_Leng' field.

    Note:
    Features that have a length value of '0' are the invalid features in the shapefile.

  14. Select the invalid features and delete them. Save Edits to the shapefile and Stop Editing.

    Once these features have been removed, use this new shapefile in Author, ArcExplorer Java Edition, or Administrator.

Article ID:000005900

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Related Information

Discover more on this topic