AnsweredAssumed Answered

Find Line Segment Perpendicular to Point

Question asked by Lady_Jane on Apr 20, 2012
Latest reply on May 1, 2012 by kmysorekar-esristaff
Hi everyone,
I am trying to measure distances between points on a river network.  In order to get an accurate distance measure, there has to be a vertex on the river line where each of the points are located.  Some of my points can be as far as 10 or so metres away from the river, but I have set an arbitrary "snapping" threshold to 6 metres.  I use ITopologicalOperator.Buffer to create a 6 metre buffer around the points and then create an ISpatialFilter to catch all of the river segments that intersect the buffer.  In the image I've attached, the blue line represents the river, flowing south-east, the big red dot represents the point I am trying to "snap" and the little red dot represents the point on the stream I want to snap it to, and thus, create a vertex at.  The line is split into segments.  If I create a cursor to loop through the intersecting segments (of which there are 3 in the picture), the bold segment will be the first one selected.  I need a way to tell it that it is in fact the second segment that I need because this is closest to the point.
I believe that in order to use IProximityOperator.ReturnNearestPoint I already need to have a feature (segment) and not a feature class (river) as the input.  Any suggestion on how to identify the correct line segment?
Thanks.

Attachments

Outcomes