ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Core.Geometry Namespace / GeometryEngine Class / QueryPoint Method / QueryPoint(Multipart,SegmentExtensionType,Double,AsRatioOrLength) Method
The multipart 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(Multipart,SegmentExtensionType,Double,AsRatioOrLength) Method
    In This Topic
    Constructs a MapPointat a given distance along the curve or the extended curve.
    Syntax

    Parameters

    multipart
    The multipart 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
    multipartis null or empty.
    Spatial reference of multipartis 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