MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / smooth

Method smooth

src/common/util/GeometryAnalysis.js:409–420  ·  view source on GitHub ↗

* @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)

Source from the content-addressed store, hash-verified

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

Callers 1

Calls 3

geojson2UGGeometryFunction · 0.90
ugGeometry2GeojsonFunction · 0.90
getTypeFunction · 0.85

Tested by

no test coverage detected