pointGrid
描述
🌐 Description
创建点网格
🌐 Creates a grid of points
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| bbox | BBox | 网格范围,按 [minX, minY, maxX, maxY] 顺序 |
| cellSide | number | 点与点之间的距离 |
| options? | Object | 可选参数 (默认 {}) |
| options.units? | Units | cellSide 值的单位。支持所有有效的 Turf Units (默认 'kilometers') |
| options.mask? | Feature<Polygon | MultiPolygon> | 如果传入的是多边形或多多边形,网格点将只在其内部创建 |
| options.properties? | Object | 传递到网格的每个点 (默认 {}) |
返回
🌐 Returns
FeatureCollection<Point> 点的网格
示例
🌐 Examples
var extent = [-70.823364, -33.553984, -70.473175, -33.302986];
var cellSide = 3;
var options = { units: "miles" };
var grid = turf.pointGrid(extent, cellSide, options);
安装
🌐 Installation
$ npm install @turf/point-grid
import { pointGrid } from "@turf/point-grid";
const result = pointGrid(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.pointGrid(...);