Select to view content in your preferred language

Exception trying to SetShape on existing feature

577
2
Jump to solution
04-14-2023 05:28 AM
JoeHershman
MVP Regular Contributor

I have a standalone batch application which needs to move a feature to a new location.   The problem is when I try to update the geometry on the feature a very odd exception is thrown which I cannot find any information about

ArcGIS.Core.Data.GeodatabaseException
  HResult=0x80131500
  Message=A geodatabase exception has occurred.
  Source=ArcGIS.Core
  StackTrace:
   at ArcGIS.Core.Data.Feature.SetShapeInternal(Geometry shape)
   at ...

Inner Exception 1:
COMException: TabletPC inking error code. Queue is full (Exception from HRESULT: 0x80040238)

I have reduced this down to a pretty simple code

string polylineJson =
	"{\"hasZ\":true,\"hasM\":true,\"paths\":[[[1157175.5091482587,1949613.7086186269,0,null],[1157179.1629363969,1949513.7653565472,0,-23728156529555.527]]],\"spatialReference\":{\"wkid\":102671,\"latestWkid\":3435}}";

Polyline polyline = PolylineBuilder.FromJson(polylineJson);

long pipeObjectId = 1067988;
QueryFilter qf = new QueryFilter() { ObjectIDs = new [] { pipeObjectId } };

// _networkDataProvider just wraps operation of Opening Geodatabase Object, swicthing version and opening Feature Class
var rows = _networkDataProvider.PipelineFeatureClass.Search(qf,false);

if (rows.MoveNext())
{
	var pipeFeature = (Feature) rows.Current;
	//This line throws exception
	pipeFeature.SetShape(polyline); 
}

 What is the issue here?  I cannot find anything about this exception, but I can absolutely not set the Shape on the existing feature

Thanks

Thanks,
-Joe
0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

Check your _networkDataProvider.PipelineFeatureClass properties for having Z and M values. If _networkDataProvider.PipelineFeatureClass doesn't have one of values, edit polylineJson to match.

 

P.s. M value of second point could be invalid:

-23728156529555.527

 

View solution in original post

2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

Check your _networkDataProvider.PipelineFeatureClass properties for having Z and M values. If _networkDataProvider.PipelineFeatureClass doesn't have one of values, edit polylineJson to match.

 

P.s. M value of second point could be invalid:

-23728156529555.527

 

JoeHershman
MVP Regular Contributor

For some reason the way one of the points was created gave the goofy M value.  I changed how that was being done and it accepts the geometry when updating the feature

Thanks,
-Joe
0 Kudos