nearestCoordinateGeodetic static method

ProximityResult? nearestCoordinateGeodetic(
  1. {required Geometry geometry,
  2. required ArcGISPoint point,
  3. required double maxDeviation,
  4. LinearUnit? deviationUnit}
)

Determines the nearest point in the input geometry to the input point, by using a shape preserving geodetic approximation of the input geometry.

Supports true curves.

Parameters:

  • geometry — A geometry object on which to calculate the nearest coordinate to the point parameter.
  • point — The point from which to calculate the nearest coordinate on the geometry parameter.
  • maxDeviation — The maximum distance that the geodetic geometry can deviate from the original, in the units of the deviationUnit parameter.
  • deviationUnit — The unit of measure for the maxDeviation parameter. If null, the units of maxDeviation are assumed to be meters.

Return Value: A ProximityResult containing the results of the operation, where the ProximityResult.distance is returned in meters. Returns null if the input geometry is empty. ProximityResult.distance is zero if the point lies inside an input polygon, polyline, or envelope.

Implementation

static ProximityResult? nearestCoordinateGeodetic(
    {required Geometry geometry,
    required ArcGISPoint point,
    required double maxDeviation,
    LinearUnit? deviationUnit}) {
  _initializeArcGISEnvironmentIfNeeded();
  final objectHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_GeometryEngine_nearestCoordinateGeodetic(
        geometry._handle,
        point._handle,
        maxDeviation,
        deviationUnit?._handle ?? ffi.nullptr,
        errorHandler);
  });
  return ProximityResult._fromHandle(objectHandle);
}