segment

Returns a segment from a line geometry as a simple line geometry.

Parameter 1 - the line geometry from which to take the segment.

Parameter 2 - the index of the first vertex of the line segment to extract, or 0 for the last segment.

Returns: a simple line segment based on two consecutive vertices or null if parameter 1 is not a line geometry.

Note: This function does not currently fully support 3D geometries. Any 3D geometries will be projected down to 2 dimensions.