0

I'm tracing a Geometric Network with Forward Star.

While tracing, I Also want to visualize the network edges after each trace.

So I created a feature class of feature type Complex Edge (I have tried all esriSimple, esriSimpleEdge and esriSimpleComplex)

IFeatureClass edgesWithOrientation_FeatureClass = featureWorkspace.CreateFeatureClass("edgesWithOrientation", fields, CLSID, null, esriFeatureType.esriFTSimple, strShapeField, null);

While tracing, I get the geometry of each edge and add it into the above created feature class

IGeometry netEdgeFeat = _geomNet.get_GeometryForEdgeEID(connectedEdgeEID);

IFeature edgeOrientationFeature = edgesWithOrientation_FeatureClass.CreateFeature();
edgeOrientationFeature.Shape = (IGeometry)netEdgeFeat; //ERROR
edgeOrientationFeature.set_Value(edgesWithOrientation_FeatureClass.FindField("weight"), orientVal);

edgeOrientationFeature.Store();

On the line edgeOrientationFeature.Shape = (IGeometry)netEdgeFeat, An Exception is thrown: No support for this geometry type.

I'm not sure what geometry type is returned by get_GeometryForEdgeEID

I've also tried to first cast the returned edge geometry into Polyline.

IPolyline netEdgePolyline = netEdgeFeat as IPolyline

The cast is successful but I get the same exception.

Your Answer

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

Browse other questions tagged or ask your own question.