turf相关计算方法
- Description:
turf相关计算方法
- Source:
Methods
(static) interPointsByDistance(box, positions, dis) → {Object}
- Description:
在指定四至范围内,按照等距离进行插值,并返回插值后的对象
- Source:
Parameters:
Name | Type | Description |
---|---|---|
box |
Array.<Number> | 范围[west,south,east,north],经纬度坐标 |
positions |
Array.<Array.<Number>> | 待插值的点集,如[[110,23],[120,24]] |
dis |
Number | 插值距离,间距,单位为千米(km) |
Returns:
插值后的对象
- Type
- Object
(static) turfExtent(geojsonopt, peropt) → {Array.<Number>}
- Description:
计算geojson四至,默认微调0.1
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
geojson |
Object |
<optional> |
geojson数据对象 |
|
per |
Number |
<optional> |
0.1
|
微调系数,在获取到四至后,根据该系数进行微调,比如计算后四至为[110,20,120,30],微调系数为0.1,则返回四至为[109,19,121,31]。注:109=110-(120-110)*0.1,121=120+(120-110)*0.1 |
Returns:
当前Geojson数据计算后的四至 => [west,south,east,north]
- Type
- Array.<Number>