Need to split a polyline into equal number arcobjects

912
1
06-15-2017 03:58 AM
NigelDsouza1
New Contributor

I am faced with a problem. I need to split a polyline into equal number of parts using c# arcobjects where the user will enter the number of parts to split the polyline into.

I need to do this using arcobjects as I have a huge file. Does anyone have a solution?

0 Kudos
1 Reply
by Anonymous User
Not applicable

There are a few ways you can do this.

IFeatureEdit.Split

The idea is you take a polyline, work out the split distance based on how many parts you need, then create a point down the line with ICurve.QueryPoint. Feed that point into the split. As this creates new features, you have to use the next split point to do a spatial search to find the underlying polyline it created, then keep iterating. (alternatively use IFeatureEdit2.SplitWithUpdate for the split)

ICurve.GetSubcurve

This extracts portions of a polyline based on distance. Similar to above you have to first work out the distances with QueryPoint, but then create features with the extracted geometry (and attributes) and delete the original one.

0 Kudos