nearestVertex static method

ProximityResult? nearestVertex({
  1. required Geometry geometry,
  2. required ArcGISPoint point,
})

Returns a ProximityResult that describes the nearest vertex in the input geometry to the input point.

Input geometry of type Envelope is not supported. To find the nearest vertex on an Envelope, convert it to a Polygon first.

If the specified geometry is a polyline or polygon, the nearest vertex is the closest ending position of the line segment that comprises the geometry. It may not necessarily be the closest point of the line segment. If you want to obtain the closest point in the polyline or polygon use GeometryEngine.nearestCoordinate.

Input geometries with true curves (where Geometry.hasCurves is true) are supported, although curve segments do not affect the return value.

Parameters:

  • geometry — A geometry object.
  • point — The point of interest.

Return Value: A struct containing the results of the operation.

Implementation

static ProximityResult? nearestVertex({
  required Geometry geometry,
  required ArcGISPoint point,
}) {
  _initializeArcGISEnvironmentIfNeeded();
  final objectHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_GeometryEngine_nearestVertex(
      geometry._handle,
      point._handle,
      errorHandler,
    );
  });
  return ProximityResult._fromHandle(
    objectHandle,
  );
}