Hello,
in my application (based on MapSuite 7) users have the option to edit shapefiles. When deleting a shape in the a specific file, MapSuite give me a dialogue box "The format of the well known binary is incorrect. Parametername: wellKnownBinary."
I have tried some things: Create a new Shapefile as a copy from the original file with ArcMap (10.2), Rebuild index files with the MapSuite explorer and so on. No luck.
So, I have attached the new generated shapefile by ArcView (no MapSuite Indexfiles). Hope somebody can can me to solve this Problem.
Regards Torsten
161-LK_Harz.zip (1.91 MB)
Edit Shapefile failes
Hi Torsten,
I test the data with a sample but it works fine in my end, I can delete the features without the issue, would you please try the attached sample?
If the issue persists, would you attach a sample to recreate the issue?
Thanks,
Troy
post11993.zip (47.8 KB)
Hi Troy,
thank you for the answer. With your code I got no errors. My Implementation is a little bit different:
First: the user can select shapes.
These (selected) shapes I store in EditOverlay.EditShapesLayer.InternalFeatures
Second: if the user confirms a dialogue, that he is sure to delete the features, I delete the features an perform "Rebuild". Then the error occurs.
See the code below.
Is there something wrong?
Regards Torsten
try
{
if (ly_.IsOpen) ly_.Close();
if (ly_ is ShapeFileFeatureLayer)
{
((ShapeFileFeatureLayer)ly_).ReadWriteMode = ShapeFileReadWriteMode.ReadWrite;
}
ly_.Open();
ly_.EditTools.BeginTransaction();
foreach (var f in Map.EditOverlay.EditShapesLayer.InternalFeatures)
{
ly_.EditTools.Delete(f.Id);
}
ly_.EditTools.CommitTransaction();
ly_.Close();
if (ly_ is ShapeFileFeatureLayer)
{
ShapeFileFeatureLayer.Rebuild(((ShapeFileFeatureLayer)ly_).ShapePathFileName);
((ShapeFileFeatureLayer)ly_).ReadWriteMode = ShapeFileReadWriteMode.ReadOnly;
}
}
catch (Exception x)
{
MessageBox.Show(x.Message);
}
Torsten,
Sorry to say we still can’t recreate the exception, I am just guessing if the exception is happened only when we delete some special features rather than any of the deleted feature will recreate it? That would be best that you can take some time to create a sample for us to recreate the exception.
What’s more, I am wondering what’s the purpose to call the ShapeFileFeatureLayer.Rebuild method? I don’t think we need to do this as in the above CommitTransaction method, the deleted function have done.
Thanks,
Troy