Skip to main content
Version: 7.2.0

triangleGrid

描述

¥Description

创建三角形多边形网格。

¥Creates a grid of triangular polygons.

参数

¥Parameters

名称类型描述
bboxBBox按 [minX, minY, maxX, maxY] 顺序排列的网格范围
cellSidenumber每个网格单元的尺寸。每个单元格中都会创建两个三角形。
options?对象可选参数(默认 {})
options.units?单位用于计算 cellSide。支持所有有效的 Turf 单位(默认为 'kilometers')
options.mask?特性<多边形>如果传递的是多边形或多多边形,则网格点将仅在其内部创建。
options.properties?对象传递给网格的每个点(默认 {})

返回

¥Returns

FeatureCollection<多边形> 多边形网格

¥FeatureCollection<Polygon> grid of polygons

示例

¥Examples

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

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

安装

¥Installation

$ npm install @turf/triangle-grid

import { triangleGrid } from "@turf/triangle-grid";
const result = triangleGrid(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.triangleGrid(...);