autoComplete static method
Fills the closed gaps between polygons using polygon boundaries and polylines as the boundary for the new polygons.
The new polygons are created in the closed empty areas bounded by the edges of the existing polygon boundaries and the new boundary polylines. The newly created polygons do not overlap any existing polygons or polylines, and the boundary of a new polygon must contain at least one edge from the polylines. Only polygons that intersect the input polylines participate in the operation, so it makes sense to prefilter the input accordingly.
All geometries in the existingBoundaries collection must have an area. They must be polygons or envelopes.
All geometries in newBoundaries collection must be polylines.
Parameters:
existingBoundaries
— The polygons.newBoundaries
— The polylines.
Return Value: The new polygons that were created. If either existingBoundaries or newBoundaries is empty, returns an empty array.
Implementation
static List<Polygon> autoComplete({
required List<Polygon> existingBoundaries,
required List<Polyline> newBoundaries,
}) {
_initializeArcGISEnvironmentIfNeeded();
final coreExistingBoundaries = existingBoundaries.toMutableArray(
valueType: _ElementType.geometry,
);
final coreNewBoundaries = newBoundaries.toMutableArray(
valueType: _ElementType.geometry,
);
final arrayHandle = _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_GeometryEngine_autoComplete(
coreExistingBoundaries._handle,
coreNewBoundaries._handle,
errorHandler,
);
});
return arrayHandle.toList();
}