pointGrid
描述
¥Description
Creates a grid of points
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
bbox | BBox | extent of grid in [minX, minY, maxX, maxY] order |
cellSide | number | 点间距离 |
options? | 对象 | 可选参数(默认 ) |
options.units? | 单位 | the units of the cellSide value.Supports all valid Turf 单位 (default 'kilometers') |
options.mask? | 特性<多边形 | MultiPolygon> | if passed a Polygon or MultiPolygon, the grid Points will be created only inside it |
options.properties? | 对象 | passed to each point of the grid (default ) |
返回
¥Returns
FeatureCollection<点> 点网格
¥FeatureCollection<Point> grid of points
示例
¥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(...);