[GIS] Shapes not matching number of records

arcgis-desktopfeaturesmerge

I am trying to merge features (polygons) from 7 subregions in ArcGIS (v10.x). Merge goes fine but when I do any other process on it (e.g. Adding a field, calculations etc), the merged file is corrupted. When I want to view the shapefile I get a message "Open Failed … Number of shapes do not match number of table records"

I tried to check geometry of the merged file (before any process was launched) and found 4 self-intersections. I tried to repair geometry to fix them but it did not help!


The version I am using is 10.2.0.3348. Unfortunately the files are heavy (each over 2GB, there are 7) to upload. Besides, they are from the Provincial Ministry and I am not sure if I could put them in the public domain.

I received the data as a geodatabase (certain forest operations in individual management units of a region). I need to extract a few variables from this data to join with another large dataset at regional scale for further analyses (décisions are at regional scale). I had earlier scripted the entire process in Python (which was working fine on several other regions). Since my script was always looking for shapefiles (and moreso I am unsure of working with geodatabases directly), I extracted individual shapefiles.

The initial process is supposed to merge the shapefiles into a region, add a few fields and calculate them. The merge goes through but no other process on it (e.g. add field).

@Polygeo, the process works on a subset (perhaps the subset did not have self-intersection issues)?

I displayed all the data in ArcMap, exported them as individual shapefiles, merged, made a new copy (through export) of the merge, and still have the same problem.

Best Answer

Without knowing all the information (as you have already mentioned above like Version, steps you did etc.), it seems like a general problem I have had many times: The problem (maybe) is the shape itself. It´s an old buggy format, for example sometime when I have to use shapes and erase geometries when I get the same error.

If you want to work with shapes (this works for me):

  • Load your (original) shapes into ArcGIS
  • Export your (original) shapes again (table of contents, right click, export)
  • merge your Data, use your (new) exported shapes --> should work now

If you want to do it without shapes and prevent such problems in future:

  • Export your data to an geodatabase --> if it´s in there, treat it like a shape without problems

If you want to use the geodatabase (recommend, because your data is heavy) you should only work within the *.gdb. Do not export the Data to an *.shp (never in your workflow), do the merge with data from a *.gdb, maybe the original data or an export to a new *.gdb. My experiences with shapes are that they are limited: e.g. if you merge, does all your fields have enough characters for long text fields?

Related Question