hello,
I have some VB.NET code which is constructing a line piece by piece from a set of coordinates in a table. I was creating the separate iLine and then adding those to a Path object. Once the series of point composing the line is finished then I add that Geometry into a Polyline. And that works. It has recently transpired that creating that I want to create the line as geodesics or loxodromes, depending upon the line. I found the ConstructGeodeticLineFromPoints member of the IConstructGeodetic interface. But this creates Polylines so the previous code I had with Paths is no longer working. I am trying to Union my spearate geodetically accurate polyline segments with a TopologicalOperator but that is taking a whole lot longer and runs into problems after a while. I was trying to look into SegmentCollections and GeometryCollections to mimic what I had been doing previously with iLines and Paths, but it doesn't seem to be working. Does anybody have any experience with easily joining together polyline elements programatically together?
cheers
shawn
Solved! Go to Solution.
Hi Shawn,
To summarize your situation, you want to join a polyline created from calling ConstructGeodeticLineFromPoints (polyline_1) with an existing polyline, say polyline_2, right? If that's the case, you can use ISegmentCollection like this:
Dim pSegColl_2 As ISegmentCollection
Set pSegColl_2 = polyline_2
Dim pSegColl_1 As ISegmentCollection
Set pSegColl_1 = polyline_1
pSegColl_2.AddSegmentCollection pSegColl_1
Hi Shawn,
To summarize your situation, you want to join a polyline created from calling ConstructGeodeticLineFromPoints (polyline_1) with an existing polyline, say polyline_2, right? If that's the case, you can use ISegmentCollection like this:
Dim pSegColl_2 As ISegmentCollection
Set pSegColl_2 = polyline_2
Dim pSegColl_1 As ISegmentCollection
Set pSegColl_1 = polyline_1
pSegColl_2.AddSegmentCollection pSegColl_1
hey Weifang
Thanks very much, that worked. I didn't think to try doing it that way at all. That's so simple, and so elegant - exactly what I was hoping for.
cheers
shawn