How to split polyline at vertices?

274
3
06-27-2012 01:52 PM
Highlighted
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
Reply
0 Kudos
3 Replies
Highlighted
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
Reply
0 Kudos
Highlighted
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?
Reply
0 Kudos
Highlighted
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?
Reply
0 Kudos