I have a polyline feature class with several closed lines (the start point = the end point). I need to break these lines in two features, using ArcObjects (doesn't matter Java, VB or C#).
I have already detected these closed lines in this way:
IFeatureCursor featureCursor = lineFeatureClass.search(null, false);
IFeature feature = null;
while((feature = featureCursor.nextFeature()) != null) {
IGeometry geometry = feature.getShape();
IPolyline polyline = (IPolyline)geometry;
if(polyline.isClosed()) {
log.info("closed line detected");
boolean[] splitHappened = new boolean[1];
int[] newPartIndex = new int[1];
int[] newSegmentIndex = new int[1];
polyline.splitAtDistance(0.5, true, true, splitHappened, newPartIndex, newSegmentIndex);
}
}
Now, I get a polyline composed of 2 parts (or path), and I don't know how to get them.
Then, I need to remove the second path from the current feature, and create a new feature with the second path as a geometry and the same attribute values.
Does anyone know what's the best way to do that?