Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a polyline geometry and wish to split it into two different geometries, based on a given point on that line, in ArcObjects.

I have tried to find out how to do this, but to no avail. I found that there are three methods which are sort of related to what I want.

  1. IFeatureEdit.Split Method This seems to do exactly what I want, but it Works on a Feature, and not on a Geometry. I Do not want to edit existing features, but copy the geometry from an existing feature, split it in two parts, and then process those parts.
  2. IPolycurve.SplitAtPoint Method I though that this method would be useful, but it just adds a new vertex at the point, and does not split the polyline
  3. ITopologicalOperator.Cut Method This would also work, but when I use it, giving a perpendicular line as the input paramter, I am getting an error which says 'An Internal error has occured in the geometry system.'

Is there some way of achieving what I want to do?

share|improve this question
add comment

1 Answer 1

up vote 4 down vote accepted

I would probably use IPolyCurve.SplitAtPoint and get the paths (parts) created after the split and do your processing on those. As long as the createPart argument is true, SplitAtPoint doesn't just add a new vertex, it inserts a new part between the split point and the end of the path.

Image

Whether this is the best approach somewhat depends on what processing you need to do however.

share|improve this answer
1  
The SplitAtPoint method creates a new path starting at the point. So after casting to IGeometryCollection, I got two paths, which I then had to wrap to get two different polylines. –  Devdatta Tengshe Oct 26 '12 at 9:00
add comment

Your Answer

 
discard

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.