Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to sweep through a feature class checking for invalid features (and log the invalid features).

Would IValidation.Validate work or does that just check for rules?

If not I'm guessing I might be able to do something like (to force re-validation):

((IGeometryCollection)featureClass.GetFeature(oid).Shape).GeometriesChanged();

However I'm not clear on what would happen if the feature was invalid I would still need find the ids of the invalid feature. Any suggestions?

share|improve this question
    
I guess it would help to define what you mean by "invalid" features. –  blah238 May 2 '12 at 21:51
add comment

1 Answer 1

up vote 2 down vote accepted

You could run the Check Geometry tool (either within ArcObjects using the IGeoprocessor interface or interactively), which creates a table with a record of each invalid geometry, its OID and the type of error.

You could alternatively try using the ITopologicalOperator.IsSimple or ITopologicalOperator3.IsSimpleEx properties.

The former only checks whether a geometry is topologically correct, while the latter attempts to determine the reason (see the esriNonSimpleReasonEnum enumeration) for its not being topologically correct.

Another possibility, since you said you are using Oracle, might be using ST_IsSimple in SQL, assuming you are using ST_Geometry.

share|improve this answer
    
Does Check Geometry work in SDE? From the documentation - "Valid input formats are shapefile and feature classes stored in a personal geodatabase or file geodatabase. SDE Geodatabases automatically check the validity of each geometry when they are uploaded; therefore the Check Geometry and Repair Geometry tools are not for use with SDE." –  user3661 May 3 '12 at 18:48
    
If it says not to, don't. What exactly is the impetus for wanting to check geometry on SDE features? You would have to be modifying them programmatically for them to become invalid, and when you attempt the store them, SDE would throw an error if they aren't topologically correct. –  blah238 May 3 '12 at 19:04
    
Its rather convoluted - but we are inserting features manually through Oracle. –  user3661 May 3 '12 at 19:58
    
Then you would probably want to vote for this Esri Idea: ideas.arcgis.com/… –  blah238 May 3 '12 at 20:25
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.