Skip to content

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

BBox

extent of grid in [minX, minY, maxX, maxY] order

cellSide

number

the distance between points

options?

Optional parameters

units?

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

返回

FeatureCollection<Point, P>

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];

KBE3D @3.0.0 Copyright © 2024-present KBE3D