Skip to content

KBE3D / KBCore / turf / triangleGrid

函数: triangleGrid()

triangleGrid<P>(bbox: BBox, cellSide: number, options?: { units?: Units; properties?: P; mask?: Feature<Polygon, GeoJsonProperties>; }): FeatureCollection<Polygon, P>

Function

Creates a grid of triangular polygons.

类型参数

P

P extends GeoJsonProperties = GeoJsonProperties

参数

bbox

BBox

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

cellSide

number

dimension of each grid cell. Two triangles are created in each cell.

options?

Optional parameters

units?

Units

used in calculating cellSide. Supports all valid Turf Units

properties?

P

passed to each point of the grid

mask?

Feature<Polygon, GeoJsonProperties>

if passed a Polygon or MultiPolygon, the grid Points will be created only inside it

返回

FeatureCollection<Polygon, P>

grid of polygons

示例

ts
var bbox = [-95, 30 ,-85, 40];
var cellSide = 50;
var options = {units: 'miles'};

var triangleGrid = turf.triangleGrid(bbox, cellSide, options);

//addToMap
var addToMap = [triangleGrid];

KBE3D @3.0.0 Copyright © 2024-present KBE3D