Description

Finds the distance to a point along a feature line or boundary.

Return Type

A Double value.  

The cumulative distance from the start of the feature to the VertexIndex vertex, plus the distance from that vertex to the target point. This distance will be in calibrated units if CalibratedDistance is True and the SpatialCalibration property is not Nothing.

Syntax

object.DistanceToFeaturePoint (TargetX, TargetY, [FeatureIndex], [VertexIndex], [CalibratedDistance])

The DistanceToFeaturePoint Method syntax has these parts:

PartDescription
objectAn expression evaluating to an object of type McLines.
TargetXRequired. A Single value.

Given target X pixel coordinate.

TargetYRequired. A Single value.

Given target Y pixel coordinate

FeatureIndexOptional. A Long value.

Which feature the distance is to be computed for (zero by default). This would be the return value from the PointClosestToPoint call if that method's ClosestPoint result is used to get the target point.

VertexIndexOptional. A Long value.

The vertex from which the target point is assumed to be extended (zero by default). This would be the returned ClosestVertexIndex from the PointClosestToPoint call if that method's ClosestPoint result is used to get the target point. For McPoints, this must be zero.

CalibratedDistanceOptional. A Boolean value.

If True (the default) and the SpatialCalibration property is not Nothing, then the computed distance is calibrated. Note that for a calibration with an McSpatialCalib.AspectRatio of other than 1, the calibrated distance will depend on feature orientation as well as its shape. If False, then the computed distance is given in pixel units. Note that the TargetX and TargetY arguments are always given in pixel coordinates, irrespective of the state of this argument.

Remarks

This method determines the distance from the start of a given McLines feature line or the start of a given McRegions feature boundary up to a given vertex and then beyond that to a given point.

The distance that the DistanceToFeaturePoint method computes is needed as an argument for the McProfileEdges.AddEdges method.

The reciprocal computation (that is computing the vertex and point at a given a distance along a line or boundary) is done by the FeaturePointAtDistanceFromStart method. However usually, the FeatureIndex of the line or boundary feature, the vertex index up to which the distance is summed, and the point beyond that vertex will all have been computed by a call to the PointClosestToPoint method.

See PointClosestToPoint for an example using FeaturePointAtDistanceFromStart.