首页 / 浏览问题 / WebGIS / 问题详情
GeometrySurfaceAnalystParameters生成等值面报错
10EXP 2023年04月17日
使用产品:for leaflet 操作系统:win11 x64
数据类型: json
问题详细描述:如下
问题重现步骤:

let pointArr = [[118.48,36.08,1.1],[118.51,36.08,0.8],[118.48,36.11,0.3],[118.51,36.11,0.2],[118.48,36.14,0],[118.51,36.14,0],[118.54,36.14,0],[118.39,36.17,0.3],[118.42,36.17,0.2],[118.45,36.17,0.1],[118.48,36.17,0],[118.51,36.17,0],[118.54,36.17,0],[118.57000000000001,36.17,0],[118.60000000000001,36.17,0],[118.36,36.199999999999996,0.1],[118.39,36.199999999999996,0.1],[118.42,36.199999999999996,0.1],[118.45,36.199999999999996,0],[118.48,36.199999999999996,0],[118.51,36.199999999999996,0],[118.54,36.199999999999996,0],[118.57000000000001,36.199999999999996,0],[118.60000000000001,36.199999999999996,0],[118.33,36.23,0],[118.36,36.23,0],[118.39,36.23,0],[118.42,36.23,0],[118.45,36.23,0],[118.48,36.23,0],[118.51,36.23,0],[118.54,36.23,0],[118.57000000000001,36.23,0],[118.33,36.26,0],[118.36,36.26,0],[118.39,36.26,0],[118.42,36.26,0],[118.45,36.26,0],[118.48,36.26,0],[118.51,36.26,0],[118.54,36.26,0],[118.57000000000001,36.26,0],[118.21000000000001,36.29,0],[118.24000000000001,36.29,0],[118.27,36.29,0],[118.3,36.29,0],[118.33,36.29,0],[118.36,36.29,0],[118.39,36.29,0],[118.42,36.29,0],[118.45,36.29,0],[118.48,36.29,0],[118.51,36.29,0],[118.54,36.29,0],[118.57000000000001,36.29,0],[118.60000000000001,36.29,0],[118.18,36.32,0],[118.21000000000001,36.32,0],[118.24000000000001,36.32,0],[118.27,36.32,0],[118.3,36.32,0],[118.33,36.32,0],[118.36,36.32,0],[118.39,36.32,0],[118.42,36.32,0],[118.45,36.32,0],[118.48,36.32,0],[118.51,36.32,0],[118.54,36.32,0],[118.57000000000001,36.32,0],[118.60000000000001,36.32,0],[118.63,36.32,0],[118.21000000000001,36.35,0],[118.24000000000001,36.35,0],[118.27,36.35,0],[118.3,36.35,0],[118.33,36.35,0],[118.36,36.35,0],[118.39,36.35,0],[118.42,36.35,0],[118.45,36.35,0],[118.48,36.35,0],[118.51,36.35,0],[118.54,36.35,0],[118.57000000000001,36.35,0],[118.60000000000001,36.35,0],[118.63,36.35,0],[118.21000000000001,36.379999999999995,0],[118.24000000000001,36.379999999999995,0],[118.27,36.379999999999995,0],[118.3,36.379999999999995,0],[118.33,36.379999999999995,0],[118.36,36.379999999999995,0],[118.39,36.379999999999995,0],[118.42,36.379999999999995,0],[118.45,36.379999999999995,0],[118.48,36.379999999999995,0],[118.51,36.379999999999995,0],[118.54,36.379999999999995,0],[118.57000000000001,36.379999999999995,0],[118.60000000000001,36.379999999999995,0],[118.63,36.379999999999995,0],[118.66,36.379999999999995,0],[118.24000000000001,36.41,0],[118.27,36.41,0],[118.3,36.41,0],[118.33,36.41,0],[118.36,36.41,0],[118.39,36.41,0],[118.42,36.41,0],[118.45,36.41,0],[118.48,36.41,0],[118.51,36.41,0],[118.54,36.41,0],[118.57000000000001,36.41,0],[118.60000000000001,36.41,0],[118.63,36.41,0],[118.66,36.41,0],[118.69,36.41,0],[118.27,36.44,0],[118.3,36.44,0],[118.33,36.44,0],[118.36,36.44,0],[118.39,36.44,0],[118.42,36.44,0],[118.45,36.44,0],[118.48,36.44,0],[118.51,36.44,0],[118.54,36.44,0.1],[118.57000000000001,36.44,0.1],[118.60000000000001,36.44,0.1],[118.63,36.44,0.1],[118.66,36.44,0.1],[118.69,36.44,0.1],[118.3,36.47,0],[118.33,36.47,0],[118.36,36.47,0],[118.39,36.47,0],[118.42,36.47,0],[118.45,36.47,0],[118.48,36.47,0],[118.51,36.47,0],[118.54,36.47,0.1],[118.57000000000001,36.47,0.1],[118.60000000000001,36.47,0.1],[118.63,36.47,0.1],[118.66,36.47,0.1],[118.69,36.47,0.2],[118.3,36.5,0],[118.33,36.5,0],[118.36,36.5,0],[118.39,36.5,0],[118.42,36.5,0],[118.45,36.5,0],[118.48,36.5,0],[118.51,36.5,0],[118.54,36.5,0.1],[118.57000000000001,36.5,0.1],[118.60000000000001,36.5,0.1],[118.63,36.5,0.1],[118.66,36.5,0.2],[118.69,36.5,0.2],[118.3,36.53,0],[118.33,36.53,0],[118.36,36.53,0],[118.39,36.53,0],[118.42,36.53,0],[118.45,36.53,0],[118.48,36.53,0],[118.51,36.53,0],[118.54,36.53,0],[118.57000000000001,36.53,0.1],[118.60000000000001,36.53,0.1],[118.63,36.53,0.1],[118.66,36.53,0.1],[118.69,36.53,0.2],[118.72,36.53,0.2],[118.75,36.53,0.3],[118.78,36.53,0.3],[118.3,36.56,0],[118.33,36.56,0],[118.36,36.56,0],[118.39,36.56,0],[118.42,36.56,0],[118.45,36.56,0],[118.48,36.56,0],[118.51,36.56,0],[118.54,36.56,0],[118.57000000000001,36.56,0],[118.60000000000001,36.56,0.1],[118.63,36.56,0.1],[118.66,36.56,0.1],[118.69,36.56,0.2],[118.72,36.56,0.2],[118.75,36.56,0.3],[118.78,36.56,0.3],[118.81,36.56,0.3],[118.84,36.56,0.3],[118.33,36.589999999999996,0],[118.36,36.589999999999996,0],[118.39,36.589999999999996,0],[118.42,36.589999999999996,0],[118.45,36.589999999999996,0],[118.48,36.589999999999996,0],[118.51,36.589999999999996,0],[118.54,36.589999999999996,0],[118.57000000000001,36.589999999999996,0],[118.60000000000001,36.589999999999996,0],[118.63,36.589999999999996,0.1],[118.66,36.589999999999996,0.1],[118.69,36.589999999999996,0.1],[118.72,36.589999999999996,0.2],[118.75,36.589999999999996,0.2],[118.78,36.589999999999996,0.2],[118.81,36.589999999999996,0.2],[118.84,36.589999999999996,0.2],[118.87,36.589999999999996,0.2],[118.3,36.62,0],[118.33,36.62,0],[118.36,36.62,0],[118.39,36.62,0],[118.42,36.62,0],[118.45,36.62,0],[118.48,36.62,0],[118.51,36.62,0],[118.54,36.62,0],[118.57000000000001,36.62,0],[118.60000000000001,36.62,0],[118.63,36.62,0],[118.66,36.62,0.1],[118.69,36.62,0.1],[118.72,36.62,0.1],[118.75,36.62,0.1],[118.78,36.62,0.1],[118.81,36.62,0.1],[118.84,36.62,0.1],[118.87,36.62,0.1],[118.3,36.65,0],[118.33,36.65,0],[118.36,36.65,0],[118.39,36.65,0],[118.42,36.65,0],[118.45,36.65,0],[118.48,36.65,0],[118.51,36.65,0],[118.54,36.65,0],[118.57000000000001,36.65,0],[118.60000000000001,36.65,0],[118.63,36.65,0],[118.66,36.65,0],[118.69,36.65,0],[118.72,36.65,0],[118.75,36.65,0],[118.78,36.65,0],[118.81,36.65,0],[118.84,36.65,0],[118.45,36.68,0],[118.48,36.68,0],[118.51,36.68,0],[118.54,36.68,0],[118.57000000000001,36.68,0],[118.60000000000001,36.68,0],[118.63,36.68,0],[118.66,36.68,0],[118.69,36.68,0],[118.72,36.68,0],[118.75,36.68,0],[118.78,36.68,0],[118.81,36.68,0],[118.84,36.68,0],[118.51,36.71,0],[118.66,36.71,0],[118.69,36.71,0],[118.72,36.71,0],[118.75,36.71,0],[118.78,36.71,0],[118.81,36.71,0],[118.84,36.71,0],[118.87,36.71,0],[118.66,36.739999999999995,0],[118.69,36.739999999999995,0],[118.72,36.739999999999995,0],[118.75,36.739999999999995,0],[118.78,36.739999999999995,0],[118.81,36.739999999999995,0],[118.84,36.739999999999995,0],[118.87,36.739999999999995,0],[118.9,36.739999999999995,0],[118.69,36.769999999999996,0],[118.72,36.769999999999996,0],[118.75,36.769999999999996,0],[118.78,36.769999999999996,0],[118.81,36.769999999999996,0],[118.84,36.769999999999996,0],[118.87,36.769999999999996,0],[118.9,36.769999999999996,0],[118.72,36.8,0],[118.75,36.8,0],[118.78,36.8,0],[118.81,36.8,0],[118.84,36.8,0],[118.87,36.8,0],[118.78,36.83,0],[118.81,36.83,0],[118.84,36.83,0],[118.87,36.83,0],[118.9,36.83,0],[118.78,36.86,0],[118.81,36.86,0],[118.84,36.86,0],[118.87,36.86,0],[118.9,36.86,0],[118.93,36.86,0],[118.81,36.89,0.1],[118.84,36.89,0.1],[118.87,36.89,0.1],[118.9,36.89,0],[118.84,36.92,0.2],[118.87,36.92,0.1],[118.9,36.92,0.1],[118.93,36.92,0],[118.84,36.949999999999996,0.2],[118.87,36.949999999999996,0.2],[118.9,36.949999999999996,0.1],[118.93,36.949999999999996,0],[118.96000000000001,36.949999999999996,0],[118.99000000000001,36.949999999999996,0],[119.05,36.949999999999996,0],[119.08,36.949999999999996,0],[118.84,36.98,0.3],[118.87,36.98,0.2]]中,当全部数据为0的情况可以正常加载带等值面,如果修改其中某一个数据比如第一个修改为zValues[0] = 0.1,该情况调用等值面服务的时候,就会直接报错400

1个回答

等值面加载方法如下:

//表面分析参数设置类。

    let setOptions = {

        //裁剪面对象,如果不需要对操作结果进行裁剪,可以使用 null 值取代该参数

        clipRegion: clipRegion,

        //提取等值线、提取等值面的基准值

        datumValue: 0,

        //expectedZValues

        //等值距。等值距是两条等值线之间的间隔值

        interval: 2,

        //重采样容限

        resampleTolerance: 0,

        //光滑处理所使用的方法:BSPLINE:B 样条法,POLISH: 磨角法

        smoothMethod: L.supermap.SmoothMethod.BSPLINE,

        //等值线或等值面的边界线的光滑度

        smoothness: 3

    };

    let analystParametersSetting = new L.supermap.SurfaceAnalystParametersSetting(setOptions);

    //输入数组转墨卡托坐标系

    let points: Array<any> = [];

    let zValues: Array<number> = [];

    for (let item of pointArr) {

        points.push(_getMercator({ lat: item[1], lng: item[0] }));

        zValues.push(item[2]);

    }

    //console.log("points", points);

    //console.log("points", points);

    //console.log("points", JSON.stringify(zValues));

    //几何对象表面分析参数类。

    let parameterOptions = {

        //表面分析的坐标点数组

        points: points,

        //表面分析的坐标点的 Z 值数组

        zValues: zValues,

        //获取或设置指定中间结果(栅格数据集)的分辨率

        resolution: 3000,

        //结果返回设置类

        //resultSetting

        //获取或设置表面分析参数

        extractParameter: analystParametersSetting,

        //取或设置表面分析的提取方法:ISOLINE 等值线提取, ISOREGION 等值面提取

        surfaceAnalystMethod: L.supermap.SurfaceAnalystMethod.ISOREGION

    };

    let surfaceAnalystParameters = new L.supermap.GeometrySurfaceAnalystParameters(parameterOptions);
10EXP 2023年04月17日
...