densifyOrNull

fun densifyOrNull(geometry: Geometry, maxSegmentLength: Double): Geometry?

Densifies the input geometry by inserting additional vertices along the geometry at an interval defined by maxSegmentLength. Additional vertices are not inserted on segments of the input Envelope, Polygon, or Polyline that are shorter than maxSegmentLength.

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

Return

The densified geometry, or null if an error occurs.

Since

200.1.0

Parameters

geometry

An Envelope, Polygon, or Polyline geometry.

maxSegmentLength

The maximum distance between vertices when the input geometry is densified. The linear unit is assumed to be that of the input geometry's spatial reference (decimal degrees for a geometry with a geographic spatial reference, meters for geometry with a Mercator spatial reference, and so on). Use SpatialReference.unit to determine the unit used by a specific spatial reference.