clip static method

Geometry clip(
  1. {required Geometry geometry,
  2. required Envelope envelope}
)

Constructs the portion of a geometry that intersects an envelope.

If the Geometry intersects the Envelope, the portion of the Geometry contained within the Envelope is returned. If no part of the Geometry lies within the Envelope, an empty Geometry is returned. If the Geometry lies completely within the Envelope, the entire Geometry is returned.

Supports true curves.

Parameters:

  • geometry — The geometry to be clipped by the given envelope.
  • envelope — The envelope that clips the given geometry.

Return Value: A geometry object that represents the portion of a geometry that intersects an envelope.

Implementation

static Geometry clip(
    {required Geometry geometry, required Envelope envelope}) {
  _initializeArcGISEnvironmentIfNeeded();
  final objectHandle = _withThrowingErrorHandler((errorHandler) {
    return runtimecore.RT_GeometryEngine_clip(
        geometry._handle, envelope._handle, errorHandler);
  });
  return Geometry._fromHandle(objectHandle)!;
}