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.

  • How does your query filter's WHERE look like? Can it be related to gis.stackexchange.com/questions/11943/… ?
    – Petr Krebs
    Sep 7 '11 at 13:32
  • What happens if you select the features first using your query filter then use Planarizelines on that selection (by passing IEditor.EditSelection)? Sep 7 '11 at 15:16
  • Thanks for reply. Kirk, it's a standalone tool, so i do not use the editor. Maybe the planarize function internally produces a query using "IN" for deletion of the origin features. I'm gonna check this today. Sep 8 '11 at 7:06
  • 1
    Planarizelines just needs an IEnumFeature, so you should be able to implement that and pass that without needing the editor. Your implementation of IEnumFeature could use IFeatureClass.GetFeatures which overcomes the 1000 feature limit. Sep 8 '11 at 14:55
  • great to hear it, I've posted as answer, please mark it. Sep 8 '11 at 17:30

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

  • 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. Sep 9 '11 at 14:54

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.

  • 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? Sep 8 '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. Sep 8 '11 at 14:35
  • Humn interesting. Nice debugging. Kirks suggestions are good, they might help you out. I've never used planarize, so... Sep 8 '11 at 17:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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