pointGrid
描述
🌐 Description
创建点网格
🌐 Creates a grid of points
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| bbox | BBox | 网格的范围,按 [minX, minY, maxX, maxY] 顺序 |
| cellSide | 数字 | 点与点之间的距离 |
| options? | 对象 | 可选参数 (默认 {}) |
| options.units? | 单位 | cellSide 值的单位。支持所有有效的 Turf 单位 (默认 'kilometers') |
| options.mask? | 特性<多边形 | 多多边形> | 如果传入的是多边形或多多边形,则网格点只会在其内部创建 |
| options.properties? | 对象 | 传递给网格的每个点 (默认 {}) |
返回
🌐 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(...);