- 开始使用
- MEASUREMENT
- COORDINATE MUTATION
- TRANSFORMATION
- FEATURE CONVERSION
- MISC
- HELPER
- RANDOM
- DATA
- INTERPOLATION
- JOINS
- GRIDS
- CLASSIFICATION
- AGGREGATION
- META
- ASSERTIONS
- BOOLEANS
- UNIT CONVERSION
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
随机线段
Returns a random linestring.
返回一个随机的LineString
> npm install @turf/random
参数
参数 | 类型 | 描述 |
---|---|---|
count | number | how many geometries will be generated |
options | Object | 可选参数:见下文 |
options选项
属性 | 类型 | 默认值 | 描述 |
---|---|---|---|
bbox | Array | [-180,-90,180,90] | a bounding box inside of which geometries are placed. |
num_vertices | number | 10 | is how many coordinates each LineString will contain. |
max_length | number | 0.0001 | is the maximum number of decimal degrees that a vertex can be from its predecessor |
max_rotation | number | Math.PI/8 | is the maximum number of radians that a line segment can turn from the previous segment. |
返回
FeatureCollection <Point> - GeoJSON FeatureCollection of points
示例
var lineStrings = turf.randomLineString(25, {bbox: [-180, -90, 180, 90]})
//=lineStrings
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论