I am looking for some type of process to repair shapefiles with the .NET tools. I know there is the MakeValid method for a Feature, but I was wondering if there is something else written in the tools to account for shape count / record count differences or anything else as a whole on repairing corrupt shapefiles.
I have a shapefile in my system that apparently got corrupted somewhere. Whenever I go to call a…
myCurrentLayer.FeatureSource.GetFeaturesByColumnValue(
“mycolumn”
,
“myvalue”
, ReturningColumnTypes.AllColumns)
The MapSuiteCore.dll throws a NullReferenceException. I am wondering if there is a way that I can check a shapefile as a whole to make sure it is a valid shapefile. I haven’t tried it, but I would guess that since it throws a NullReferenceException on that method, that I wouldn’t be able to get individual features to check the .isValid property of them. I am running version 8.0.0.0 of the MapSuiteCore and WpfDesktopEdition.
I know there was a bug with Deleting features that was fixed in a later version of the Development branch (assuming it is in the Production branch by now), but is there possibly one in the creation of a shapefile feature too that corrupted my shapefile while it was being used?
My main concern is fixing corrupt shapefiles, and I would be happy if there is some way to check the shapefile components to make sure they were valid.