bboxClip
描述
🌐 Description
使用lineclip将Feature和边界框裁剪到边界框内。裁剪多边形时可能会产生退化的边。
🌐 Takes a Feature and a bbox and clips the feature to the bbox using lineclip. May result in degenerate edges when clipping Polygons.
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| feature | Feature<LineString | MultiLineString | Polygon | MultiPolygon> | 将功能裁剪到边界框 |
| bbox | BBox | 范围按 [minX, minY, maxX, maxY] 顺序 |
返回
🌐 Returns
Feature<LineString | MultiLineString | Polygon | MultiPolygon> 剪辑特性
示例
🌐 Examples
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);