ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / QueryPoint Method / QueryPoint(Segment,SegmentExtensionType,Double,AsRatioOrLength) Method
The segment on which the returned point lies.
Specifies the extension method.
The distance along the curve or the extended curve at which the returned point lies.
Determines whether the distanceAlongCurve is returned as a ratio of the segment length or as length from the start point.
Example

In This Topic
    QueryPoint(Segment,SegmentExtensionType,Double,AsRatioOrLength) Method
    In This Topic
    Constructs a MapPointat a given distance along the curve or the extended curve.
    Syntax

    Parameters

    segment
    The segment on which the returned point lies.
    extensionType
    Specifies the extension method.
    distanceAlongCurve
    The distance along the curve or the extended curve at which the returned point lies.
    asRatioOrLength
    Determines whether the distanceAlongCurve is returned as a ratio of the segment length or as length from the start point.

    Return Value

    The point at the given distance along the curve or extended curve.
    Exceptions
    ExceptionDescription
    segmentis null.
    Spatial reference of segmentis an image coordinate system.
    Remarks
    If the distance is less than the length of the curve, then the returned point is the point at that distance along the curve. If the distance is less than zero, or greater than the length of the curve, then the returned point is on the curve specified by the extension method. The distance may be specified as a fixed unit of measure or a ratio of the length of the curve.
    Example
    QueryPoint
    SpatialReference sr = SpatialReferences.WGS84;
    
    // Horizontal line segment
    Coordinate2D start = new Coordinate2D(1, 1);
    Coordinate2D end = new Coordinate2D(11, 1);
    LineSegment line = LineBuilderEx.CreateLineSegment(start, end, sr);
    
    Polyline polyline = PolylineBuilderEx.CreatePolyline(line);
    
    // Don't extend the segment
    
    MapPoint outPoint = GeometryEngine.Instance.QueryPoint(polyline, SegmentExtensionType.NoExtension, 1.0, AsRatioOrLength.AsLength);
    // outPoint = (2, 1)
    
    // or the segment
    MapPoint outPoint_seg = GeometryEngine.Instance.QueryPoint(line, SegmentExtensionType.NoExtension, 1.0, AsRatioOrLength.AsLength);
    // outPoint_seg = (2, 1)
    
    // Extend infinitely in both directions
    outPoint = GeometryEngine.Instance.QueryPoint(polyline, SegmentExtensionType.ExtendTangents, 1.5, AsRatioOrLength.AsRatio);
    // outPoint = (16, 1)
    outPoint_seg = GeometryEngine.Instance.QueryPoint(line, SegmentExtensionType.ExtendTangents, 1.5, AsRatioOrLength.AsRatio);
    // outPoint_seg = (16, 1)
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also