# bboxClip

Takes a Feature and a bbox and clips the feature to the bbox using lineclip. May result in degenerate edges when clipping Polygons.
获取一个Feature和一个bbox,并使用lineclip将该Feature裁切到bbox。在裁剪多边形时可能导致退化边缘。

参数

参数 类型 描述
feature Feature <(LineString|MultiLineString|Polygon|MultiPolygon)> feature to clip to the bbox
bbox BBox extent in minX, minY, maxX, maxY order

返回

Feature <(LineString|MultiLineString|Polygon|MultiPolygon)> - clipped Feature

示例

var bbox = [0, 0, 10, 10];
var poly = turf.polygon([[[2, 2], [8, 4], [12, 8], [3, 7], [2, 2]]]);

var clipped = turf.bboxClip(poly, bbox);
Last Updated: 1/19/2021, 10:59:20 AM