I have trouble with some shapes and inserting into a SQL server table with a geography field defined.
It tells me "The specified input does not represent a valid geography instance". I know I can get around this by also having a geometry field defined and use that and SQL server to clean up the object before updating the geography field .
Is there any way to clean up the ring orientation, intersecting lines of a polygon, ect.. without pushing the feature to SQL Server and performing the cleaning there? I tried to see if there was a MakeValid method on the shape or the feature and there doesn't seem to be. I would rather take care of cleaning the shape client side than server side if I can.
Example of code where newFeature has invalid geometry.
sql2008Layer.EditTools.BeginTransaction();
sql2008Layer.FeatureSource.AddFeature(newFeature);
TransactionResult result = sql2008Layer.EditTools.CommitTransaction();