Appearance
KBE3D / KBCore / turf / pointGrid
函数: pointGrid()
pointGrid<
P>(bbox:BBox,cellSide:number,options?: {units?:Units;mask?:Feature<Polygon|MultiPolygon,GeoJsonProperties>;properties?:P; }):FeatureCollection<Point,P>
Function
Creates a grid of points
类型参数
P
P extends GeoJsonProperties = GeoJsonProperties
参数
bbox
extent of grid in [minX, minY, maxX, maxY] order
cellSide
number
the distance between points
options?
Optional parameters
units?
the units of the cellSide value. Supports all valid Turf Units
mask?
Feature<Polygon | MultiPolygon, GeoJsonProperties>
if passed a Polygon or MultiPolygon, the grid Points will be created only inside it
properties?
P
passed to each point of the grid
返回
grid of points
示例
ts
var extent = [-70.823364, -33.553984, -70.473175, -33.302986];
var cellSide = 3;
var options = {units: 'miles'};
var grid = turf.pointGrid(extent, cellSide, options);
//addToMap
var addToMap = [grid];