bufferGeodetic static method
- {required Geometry geometry,
- required double distance,
- LinearUnit? distanceUnit,
- required double maxDeviation,
- required GeodeticCurveType curveType}
Creates a buffer polygon at the specified distance around the given geometry, calculated using a geodetic curve.
Geodetic buffers account for the actual shape of the earth. Distances are calculated between points on a curved surface (the geoid) as opposed to points on a flat surface (the Cartesian plane).
Negative distance can be used to create a buffer inside a Polygon or an Envelope. Using a negative buffer distance shrinks the geometry's boundary by the distance specified. Note that if the negative buffer distance is large enough, the geometry may collapse to an empty polygon.
Supports true curves as input, and may produce a densified curve as output.
Parameters:
geometry
— A geometry object.distance
— The distance to buffer the geometry.distanceUnit
— The unit of measure for the distance.maxDeviation
— The maximum deviation between points. If NaN then a maximum deviation of up to 0.2% of the buffer distance, with a maximum of 0.01 meters, aiming to give an output geometry with a smooth boundary.curveType
— The GeodeticCurveType used to calculate the buffer.
Return Value: The geodetic buffer.
Implementation
static Polygon bufferGeodetic(
{required Geometry geometry,
required double distance,
LinearUnit? distanceUnit,
required double maxDeviation,
required GeodeticCurveType curveType}) {
_initializeArcGISEnvironmentIfNeeded();
final objectHandle = _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_GeometryEngine_bufferGeodetic(
geometry._handle,
distance,
distanceUnit?._handle ?? ffi.nullptr,
maxDeviation,
curveType.coreValue,
errorHandler);
});
return Polygon._fromHandle(objectHandle)!;
}