Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We are currently working on a project where we have to merge sections (polylines) to a route, but the big question is how to do this. We have currently tried adding those two as segmentcollections but it gives some rather wicked results.

share|improve this question
up vote 8 down vote accepted

Try using the ITopologicalOperator.Union method called on one of those polylines, passing the second one as its parameter. As long as the two polylines' endpoints meet, this approach should solve your problem.

EDIT: when performing union on multiple geometries (more than two), ITopologicalOperator.ConstructUnion is more efficient. You would call this method on an empty (freshly created) Polyline, passing an enumeration of all the polylines. This enumeration can be a GeometryBag instance as it implements IEnumGeometry.

share|improve this answer
I just switched back from ITopologicalOperator.ConstructUnion to ITopologicalOperator.Union because the merged geometry wasn't correct --vertices were moved (looked almost like the line was generalized except the vertex count didn't change). – Jay Cummins Jun 22 '11 at 16:51

It is also possible to use MergeGeometries from IConstructMerge interface.

I guess even that can solve the above issue!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.