# length
Takes a GeoJSON and measures its length in the specified units, (Multi)Point 's distance are ignored.
接受一个GeoJSON并测量其在指定单位下的长度,忽略MultiPoint的距离。
参数
| 参数 | 类型 | 描述 |
|---|---|---|
| geojson | GeoJSON | GeoJSON to measure |
| options | Object | 可选参数:见下文 |
options选项
| 属性 | 类型 | 默认值 | 描述 |
|---|---|---|---|
| units | string | kilometers | 可以是度、弧度、英里或公里 |
返回
number - length of GeoJSON
示例
var line = turf.lineString([[115, -32], [131, -22], [143, -25], [150, -34]]);
var length = turf.length(line, {units: 'miles'});