I've got a polyline feature class and I've identified the first feature that is a multipart feature. I now want to find out which of the paths of this multipart feature intersects with a point. Up till now I managed to fill a geometry collection with the parts (paths) of the polyline. My method to check for the intersection requires a polyline input. And this is where I'm stuck. How can I convert/cast/? one of the two paths in the geometry collection to a polyline?
Here is some code, but pPolylineCSPart
is null:
//right polyline into geometry collection
IGeometryCollection pGeometryCollection = new PolylineClass();
pGeometryCollection = pRightPolyline as IGeometryCollection;
//loop through geometry collection
for (int intPartCount = 0; intPartCount < pGeometryCollection.GeometryCount; intPartCount++)
{
IPolyline pPolylineCSPart = new PolylineClass();
//cast polyline part to polyline
pPolylineCSPart = pGeometryCollection.get_Geometry(intPartCount) as IPolyline;
//check if part intersects river
bMultipartIntersectRiver = PolylineIntersectioCheck.Are2PolylinesIntersecting(pPoint, pPolylineCSPart);
if (bMultipartIntersectRiver)
{
pSplitFeat.Shape = pPolylineCSPart;
SplitCSFClass.CopyAttributes(pTransectSplit, pSplitFeat);
pSplitFeat.Store();
}
}
Many Thanks!