Hello,
I'm experiencing a strange error that only happens on some of my multipatch feature.
An error occurs when cycling through a RowCursor on a couple of features, but the rest come through fine. I have this working with legacy ArcObject code, so I don't see a problem with the features.
The exception thrown is "Value does not fall within the expected range." for 3 out of 79 features. Any ideas?
Here are the basic code snippets.
// Reset a search cursor.
Table table = m_db_info.geodb.OpenDataset<Table>(m_class_name);
FeatureClass fc = table as FeatureClass;
if (fc != null && m_mbr != null) {
SpatialQueryFilter spatial_filter = new SpatialQueryFilter();
if (SetupQueryGeometry(m_mbr, fc.GetDefinition().GetSpatialReference(), out Geometry extent)) {
// If queryFilter is an instance of ArcGIS.Core.Data.SpatialQueryFilter, either
// both the 'FilterGeometry' and 'SpatialRelationship' properties are set or both
// are not set. Otherwise, an ArgumentException will be raised.
if (extent.Extent.Area > 0) {
spatial_filter.FilterGeometry = extent;
spatial_filter.SpatialRelationship = SpatialRelationship.Intersects;
}
}
if (m_query.Length > 0) {
spatial_filter.WhereClause = m_query;
spatial_filter.SubFields = "*";
}
if (m_postfix.Length > 0) {
spatial_filter.PostfixClause = m_postfix;
}
m_cursor = table.Search(spatial_filter, false); // m_cursor is a RowCursor
}
...............................
// Traverse the features in another method.
try {
Table table = m_db_info.geodb.OpenDataset<Table>(m_class_name);
FeatureClass fc = table as FeatureClass;
while (m_cursor.MoveNext()) { (THROWING AN EXCEPTION ON A FEW FEATURES HERE)
using (Row row = m_cursor.Current) {
// Process the feature.
EsriFeatureRow feature = new EsriFeatureRow {
m_feature_id = (int)row.GetObjectID()
};
...etc...
}
Thank you in advance for any suggestions.
-Bill