MEASUREMENT
COORDINATE MUTATION
TRANSFORMATION
FEATURE_CONVERSION
MISC
HELPER
RANDOM
GRIDS
AGGREGATION
META
ASSERTIONS
BOOLEANS
UNIT CONVERSION
DATA
JOINS
CLASSIFICATION

envelope

描述

envelope 是一个Turf.js方法,用于计算多边形的外接矩形框。返回一个叫做 bbox 的包围盒,它包含了最小的外接矩形框。envelope 支持任何 任何类型的 GeoJSON Feature,包括基准点、线、多边形。

用法

envelope(geojson)

参数

  • geojson: 任何类型的 GeoJSON Feature

返回

  • 返回一个包围盒对象 bbox

示例

var square = turf.polygon([[
  [-75.168, 39.952],
  [-75.168, 39.954],
  [-75.166, 39.954],
  [-75.166, 39.952],
  [-75.168, 39.952]
]]);
var bbox = turf.envelope(square);

// {"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-75.168,39.952],[-75.168,39.954],[-75.166,39.954],[-75.166,39.952],[-75.168,39.952]]]}}

许可证

MIT许可证