Appearance
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
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?
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
返回
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];