[ORD C#] get point's offset from alignment?

i know how to get a point's station by looking at the delivered example, but having a hard time finding anything for figuring out the offset.

right now I'm thinking my best/easiest option is to project onto the alignment using ProjectPointOnPerpendicular, then use GetPointAtDistanceOffset to get the point on the alignment and then compare that point to the target point to get a straight distance and use that as the offset. but then figuring out if its offset to the left or right could be a little tricky...

is there a better way..am i missing an api call that would make this easy?

Parents
  • John,

    The linearPoint generated from the ProjectPointOnPerpendicular  has the Offset properties with it.  You should be able to use the Offset property.

    LinearPoint linearPoint1 = baseLine.ProjectPointOnPerpendicular (point1);
    LinearPoint linearPoint2 = baseLine.ProjectPointOnPerpendicular (point2);

    if ( m_displayDetails )
    {
    System.Diagnostics.Debug.WriteLine ("Offsets computed");
    System.Diagnostics.Debug.WriteLine ("Offsets: @ Start Point {0,10:0.000000}", linearPoint1.Offset);
    System.Diagnostics.Debug.WriteLine ("Offsets: @ End Point {0,10:0.000000}", linearPoint2.Offset);
    System.Diagnostics.Debug.WriteLine ("Start and End distances computed");
    System.Diagnostics.Debug.WriteLine ("Offsets: @ Start Distance {0,10:0.000000}", linearPoint1.DistanceAlong);
    System.Diagnostics.Debug.WriteLine ("Offsets: @ End Distance {0,10:0.000000}", linearPoint2.DistanceAlong);
    System.Diagnostics.Debug.WriteLine ("Offset Line Length compared to Base Line Length");
    System.Diagnostics.Debug.WriteLine ("Base Line Length: {0,10:0.000000}", baseLine.Length);
    System.Diagnostics.Debug.WriteLine ("Offset Line Length: {0,10:0.000000}", offsetLine.Length);
    }

    Answer Verified By: John Drsek 

Reply
  • John,

    The linearPoint generated from the ProjectPointOnPerpendicular  has the Offset properties with it.  You should be able to use the Offset property.

    LinearPoint linearPoint1 = baseLine.ProjectPointOnPerpendicular (point1);
    LinearPoint linearPoint2 = baseLine.ProjectPointOnPerpendicular (point2);

    if ( m_displayDetails )
    {
    System.Diagnostics.Debug.WriteLine ("Offsets computed");
    System.Diagnostics.Debug.WriteLine ("Offsets: @ Start Point {0,10:0.000000}", linearPoint1.Offset);
    System.Diagnostics.Debug.WriteLine ("Offsets: @ End Point {0,10:0.000000}", linearPoint2.Offset);
    System.Diagnostics.Debug.WriteLine ("Start and End distances computed");
    System.Diagnostics.Debug.WriteLine ("Offsets: @ Start Distance {0,10:0.000000}", linearPoint1.DistanceAlong);
    System.Diagnostics.Debug.WriteLine ("Offsets: @ End Distance {0,10:0.000000}", linearPoint2.DistanceAlong);
    System.Diagnostics.Debug.WriteLine ("Offset Line Length compared to Base Line Length");
    System.Diagnostics.Debug.WriteLine ("Base Line Length: {0,10:0.000000}", baseLine.Length);
    System.Diagnostics.Debug.WriteLine ("Offset Line Length: {0,10:0.000000}", offsetLine.Length);
    }

    Answer Verified By: John Drsek 

Children
No Data