Converts LineString, MultiLineString, and LinearRing geometries into a MultiLineString by cutting them into parts no longer than the given distance along their length. All other geometry types will be converted to an empty MultiLineString.

LinearRing.cutLines(distances, maxError, proj)Geometry
this: geometryGeometry

Cuts the lines of this geometry.


Distances along each LineString to cut the line into separate pieces, measured in units of the given proj, or meters if proj is unspecified.

maxErrorErrorMargin, default: null

The maximum amount of error tolerated when performing any necessary reprojection.

projProjection, default: null

Projection of the result and distance measurements, or WGS84 if unspecified.


Code Editor (JavaScript)

// Define a LinearRing object.
var linearRing = ee.Geometry.LinearRing(
    [[-122.091, 37.420],
     [-122.085, 37.422],
     [-122.080, 37.430]]);

// Apply the cutLines method to the LinearRing object.
var linearRingCutLines = linearRing.cutLines({'distances': [10, 100], 'maxError': 1});

// Print the result to the console.
print('linearRing.cutLines(...) =', linearRingCutLines);

// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
             {'color': 'black'},
             'Geometry [black]: linearRing');
             {'color': 'red'},
             'Result [red]: linearRing.cutLines');