How to get the M-value for a point on a polyline segment.

1902
3
Jump to solution
05-15-2012 11:52 AM
SuiHuang
Occasional Contributor II
Hi Experts:

    I am writing some code to calculate the "M value" of a point on a polyline segment. The polyline feature class is not an actual event layer. It is just a polyline feature class having begin_M and end_M fields for each segment. If I have a point sitting on a segment, how can I calculate the the "M" value on this point?
    The only idea in my mind for now is using ICurve.QueryPointAndDistance function to get the input point's distance along the polyline, and then use it ratio to the total length to calculate the interpolated "M" value of that point.
    Is there other linear referencing related ArcObject API for me to implement the function?
    Thank you.

Sui
0 Kudos
1 Solution

Accepted Solutions
SuiHuang
Occasional Contributor II
Hi Hornbydd and TomLUX:

    Thank you for your suggestion. After some study I found that in our corresponding manual data process step, the "Locate Feature Along Routes" Linear Referencing Tool is used to generate an output event table. I decide to use the IRouteLocatorOperations interface to find the M-value of the point.
    I understand I will need to create temporary layer if I use this method.
    Thank you.

View solution in original post

0 Kudos
3 Replies
TomSchuller
Occasional Contributor III
0 Kudos
DuncanHornby
MVP Notable Contributor
Sui,

If your underlying polyline layer was a PolylineM featureclass then you could have used the IMSegmentation3 interface and the GetMsAtDistance method. So you have 2 options:

  1. Do it the way you said, nothing wrong with that.

  2. When you identify the polyline that the point intersects take a copy of that polyline and turn it into a polylineM feature using your start and end values by using the CalibrateByMs method of the IMSegmentation3 interface.

Duncan
0 Kudos
SuiHuang
Occasional Contributor II
Hi Hornbydd and TomLUX:

    Thank you for your suggestion. After some study I found that in our corresponding manual data process step, the "Locate Feature Along Routes" Linear Referencing Tool is used to generate an output event table. I decide to use the IRouteLocatorOperations interface to find the M-value of the point.
    I understand I will need to create temporary layer if I use this method.
    Thank you.
0 Kudos