ThinkGeo.com    |     Documentation    |     Premium Support

How does union or combine work?

Hi,


Not quite sure how the union or combine works. Say I have two polyline shapes, L1 has 3 points (A, B,C), L2 has 3 points (D,E,F), after union these two polyiines together, will I get a polyline which connects A,B,C,D,E,F together? Or will I get a polyline with two sections: A->B->C, then D->E->F?


I need the first combined polylines, which means if another line passes through C and D, the combined polylines will  intersect with it..


Any help or code snippet is greatly appreciately.


Rose



Rose,


I have to admit that we do not support neither union logics described above, while we can write the logic as any you want.
 
Following code snippet shows you how to cmobine tow lines together end by end, hope it can satisfy your requirement:

        private LineShape GetCombinedLineShape(LineShape lineShape1, LineShape lineShape2)
        {
            LineShape returningShape = new LineShape();
 
            foreach (Vertex vertex in lineShape1.Vertices)
            {
                returningShape.Vertices.Add(vertex);
            }
 
            foreach (Vertex vertex in lineShape2.Vertices)
            {
                returningShape.Vertices.Add(vertex);
            }
 
            return returningShape;
        }

 
Any more quesitons just feel free to let me know.
 
Thanks.
 
Yale