length static method

double length(
  1. {required Geometry geometry}
)

Calculates the length of the given geometry.

This planar measurement uses 2D Cartesian mathematics to compute the length. It is based upon the SpatialReference of the input geometry. If the input geometry is not using an 'distance preserving' spatial reference, the result can be inaccurate. You have two options available to calculate a more accurate result:

Supports true curves.

Parameters:

  • geometry — A geometry object.

Return Value: The length of the given geometry.

Implementation

static double length({required Geometry geometry}) {
  _initializeArcGISEnvironmentIfNeeded();
  return _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_GeometryEngine_length(
        geometry._handle, errorHandler);
  });
}