3

I wrote a little tool in ArcObjects/C# for planarizing a line feature class. I am using IFeatureConstruction::PlanarizeLinesFromCursor because I need to apply a query filter.
Now, I figured out a bug: when executing the operation on ArcSDE featureclass the method adds the planarized version of the geometries, but does not delete the origin (unsplitted) features. The effect only appears on ArcSDE feature classes when the filter contains more than 1000 features.

Does anyone know about this bug? Is there any workaround?

I am using ArcGIS 9.3.1 SP 2 and .Net 3.5 on Win7.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338

2 Answers2

2

Instead of using PlanarizeLinesFromCursor, try using PlanarizeLines, passing it a class that implements IEnumFeature by calling IGeodatabaseBridge.GetFeatures - which overcomes the 1000 feature limitation.

Kirk Kuykendall
  • 25,787
  • 8
  • 65
  • 153
  • 1
    I created a class implementing IEnumFeature. I used IFeatureClass.Select to perform the selection. Finally I got ISelectionSet.IDs as IEnumIds for implementing the Next() and Reset() methods. This way the 1000 feature limitation is no problem, although it is a little loss of performance. – Jolly Roger Sep 09 '11 at 14:54
1

I had a look into the SDE log file. Indeed the reason is ORA-1795 (maximum number of expressions in a list is 1000):

db_array_fetch_attrs OCI Fetch Error (1795)  
load_buffer error -51 on MYFEATURECLASS, rowid -1  

The query causing the error is created by the planarize-funktion internally. So I have no control to this. Unfortunately the function throws no exception or something like that.

I'm going to open an ESRI call. I will post the reply here.

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
  • This is a problem with Oracle, not ESRI IMHO. Change the query to use OR's. I know it's innefective, but maybe the bug will dissapear? – George Silva Sep 08 '11 at 14:16
  • 1
    @George My query I give to the filter is very simple, e.g. "OBJECTID < 1200" (or even empty to process the whole featureclass). The problem is that obviously the planarize function internally creates a query using "IN" for deletion of the origin features (I could see that in the Oracle trace). So the planarize function will always raise an error on a SDE/Oracle featureclass (or filter) with more than 1000 features. – Jolly Roger Sep 08 '11 at 14:35
  • Humn interesting. Nice debugging. Kirks suggestions are good, they might help you out. I've never used planarize, so... – George Silva Sep 08 '11 at 17:38