* @function GeometryAnalysis.prototype.smooth * @version 11.2.0 * @description 线要素光滑分析。 * @param {GeoJSONFeature} feature - 线要素。 * @param {number} [smoothness=2] - 有效范围为大于等于2,设置为小于2的值会抛出异常,光滑系数越大,线对象节点数越多,也就越光滑。 建议取值范围为[2,10]。 * @returns {GeoJSONFeature} 光滑处理后的线要素。
(feature, smoothness = 2)
| 407 | * @returns {GeoJSONFeature} 光滑处理后的线要素。 |
| 408 | */ |
| 409 | smooth(feature, smoothness = 2) { |
| 410 | if (getType(feature) !== 'LineString') { |
| 411 | throw new Error("only feature type is LineString supported"); |
| 412 | } |
| 413 | |
| 414 | const ugFeature = geojson2UGGeometry(feature); |
| 415 | const result = this.module._UGCWasm_Geometrist_Smooth(ugFeature, smoothness); |
| 416 | return { |
| 417 | type: "Feature", |
| 418 | geometry: ugGeometry2Geojson(result) |
| 419 | }; |
| 420 | } |
| 421 | |
| 422 | /** |
| 423 | * @function GeometryAnalysis.prototype.computeGeodesicDistance |
no test coverage detected