tryBuffer

fun tryBuffer(geometries: Iterable<Geometry>, distances: Iterable<Double>, unionResult: Boolean): List<Polygon>

Creates a buffer or buffers relative to the given collection of geometries. This is a planar buffer operation. Use GeometryEngine.bufferGeodeticOrNull(Geometry, Double, LinearUnit, Double, GeodeticCurveType) to produce geodetic buffers. This planar measurement uses 2D Cartesian mathematics to compute the buffer areas. It is based upon the SpatialReference of the input geometries. If the input geometries do not use an 'area preserving' spatial reference, the results can be inaccurate. You have two options available to calculate a more accurate results:

If unionResult is true, the output collection contains a single result. If geometries is empty, an empty array is returned.

Supports true curves as input, producing a densified curve as output where applicable.

This method allows you to create different-sized buffers for each input in a geometry collection using corresponding values in a distance collection. Typically, there's a one-to-one correspondence of input geometries to the input buffer distances. However, you may have fewer input buffer distances than input geometries. In that case, the last distance value in the buffer distances collection is applied to the remaining geometries. If needed, you could also specify a single buffer value in the input buffer distances collection to apply to all items in the input geometries collection.

Return

A collection of polygons representing buffers at the defined distance(s) relative to the input geometries.

Since

200.1.0