How to split polyline at vertices?

583
3
06-27-2012 01:52 PM
InsuHong1
New Contributor
Hi,


How can I split polyline at its vertices?

There is SplitLine tools in geoprocessing, but generate geoprocessing object and execute it is slow.

Is there any other way to split?



Thanks.


Insu
0 Kudos
3 Replies
DimaShats
New Contributor III
Hi,

Do you want to split using ArcEngine?
Did you try IPolycurve.SplitAtPoint ?

Best Regards, Dima.


Hi,


How can I split polyline at its vertices?

There is SplitLine tools in geoprocessing, but generate geoprocessing object and execute it is slow.

Is there any other way to split?



Thanks.


Insu
0 Kudos
InsuHong1
New Contributor
Yes. I tried, but failed.

Here's my code for that.


                IPolyline plConvexHullLine = (IPolyline)igConvexHullLine;
                for (int e = 0; e < pcVertices.PointCount; e++)
                {
                    IPoint ptIn = pcVertices.get_Point(e);
                    int f;
                    int g;
                    Boolean k;
                    plConvexHullLine.SplitAtPoint(ptIn, false, true, out k, out f, out g);
                }


is there any problem with my code?
0 Kudos
DimaShats
New Contributor III
If you want to split your polyline at any vertex, maybe you should to use ISegmentCollection objSegmentCol = igConvexHullLine as ISegmentCollection;
do you mean to this result?


Yes. I tried, but failed.

Here's my code for that.


                IPolyline plConvexHullLine = (IPolyline)igConvexHullLine;
                for (int e = 0; e < pcVertices.PointCount; e++)
                {
                    IPoint ptIn = pcVertices.get_Point(e);
                    int f;
                    int g;
                    Boolean k;
                    plConvexHullLine.SplitAtPoint(ptIn, false, true, out k, out f, out g);
                }


is there any problem with my code?
0 Kudos