首页 / 浏览问题 / 云GIS / 问题详情
等值面分析服务spatialanalyst无法动态使用
10EXP 2023年04月17日
操作系统:win11 x64 数据类型: json 问题详细描述:使用GeometrySurfaceAnalystParameters生成等值面

调用iserver中的等值面分析服务spatialanalyst,当数据变化的情况下,相同的SurfaceAnalystParametersSetting参数interval和GeometrySurfaceAnalystParameters参数resolution,一部分数据能够正常请求,一部分数据无法正常请求,通过手动调整,特定情况下能够调用成功。

查看文档没有任何能够说明这种情况的有用信息。

经试验也未找到任何规律,想要适配动态数据变化的情况,请问能否提供不同参数数据量,0数据和有效数据密度,请问如何能够知道SurfaceAnalystParametersSetting参数interval和GeometrySurfaceAnalystParameters参数resolution如何设置,否则正式环境中无法动态去使用

希望能够提供一个对应关系说明或者有没有办法支持动态数据和不同密度的数据
问题关闭原因: 需要GIS专业,跨行业

1个回答

您好,没有理解您再说的是什么意思, 0数据和有效数据密度不知道您说的是什么?

SurfaceAnalystParametersSetting . interval 、 GeometrySurfaceAnalystParameters .resolution这是两个没有什么关系的参数,

SurfaceAnalystParametersSetting . interval是再进行提取等值线或等值面时的等值间距,

比如提取区域数据最低高程2000,最高高程3000,等值间距250,会每隔250提取一根等值线或等值面,2000、2250、2500、2750、3000。

GeometrySurfaceAnalystParameters .resolution是运算过程中的栅格数据所采用的空间分辨率,通常取决于分析时的范围图幅,

resolution是运算过程中的空间分辨率,即1像素格为实地多少米,所以当空间分辨率不合理时,比如数据本身空间分辨率还要小或者在分析范围内无法分析(如分析范围100*100米,空间分辨率给50,范围被划分为4个像素格,通常情况下是无法提取成功的)。

所以,SurfaceAnalystParametersSetting . interval和GeometrySurfaceAnalystParameters .resolution这两个参数是没有之间作用关联的,需要您根据您本身的数据和业务情况来控制,不是通用分析参数。

等值线或等值线提取本身的逻辑和原理如果您不太清晰了解的话,建议您可以参考一下iDesktop桌面端的文档辅助理解。

https://help.supermap.com/iDesktop/zh/tutorial/Analyst/Raster/SurfaceAnalyst/AoubtSurfaceAnalyst

希望可以帮助到您。

10,588EXP 2023年04月17日
//表面分析参数设置类。

    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);
以上这一段加载等值面的方法,在不同的点集合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
你的第一个点位xy在地形上高度是多少?0.1米吗?

这个z不是随便乱给,如果要给的话,要是这个点位本身对应栅格数据集的正确栅格值(高度)
等值面为降雨等值面,数据为三维数组,第一个参数代表经度,第二个参数代表纬度,第三个参数降雨量,根据要求生成等值面;使用leaflet开发二维地图服务,没有地形高度数据。

z值为动态降雨量,是超图该服务不支持传入真实的降雨量来生成等值面么?

提供的数据是测试数据,我模拟第一个经纬度对应的小区突然发生降雨,降雨值大于0的某个数,测试过0.1、1、2.8、12.999999999等,调用服务均报错,由于回复内容支持的长度不足够让我把完整数据发上来,没有找到上传文件的地方。。。因此提供的数据为满足长度要求的测试数据集

提取等值线等值面是对栅格数据来分析和生成的,根据如果是地形栅格,就是高度来提取的,

这个是一个对栅格数据进行分析的栅格分析表面算子,不是对矢量点位去分析。

降雨量等值面是一种业务数据上的描述,直接的点位本身如果您使用的是栅格地形去分析,提取出来的点位是地形高度的等值面,和您的降水量没有什么关系的。

对于栅格表面分析来说,z值是栅格数据的栅格值,地形栅格就是高度、坡度栅格就是坡度、温度栅格就是温度......

您如果想要分析降水量,那点位和栅格都得是降水量数据,不能降水点位搭地形栅格来分析。

从您刚刚的业务描述上来说,我建议可以了解下栅格数据本身的意义和等值面分析的用处,再来设计实现业务需求,

比如使用您的降水量点位数据,插值成一份栅格数据,使用这份栅格数据提取等值面,某种意义上就是您的降雨量等值面。

业务思路可以参考一下这个流程,

http://support.supermap.com.cn/DataWarehouse/WebDocHelp/iDesktop/GettingStarted/SampleMap/Weather/Precipitation.html

我是做前端js二次开发的,通过文档API来进行开发使用的,不做后端GIS工具使用和数据处理,也就是说需要GIS专业人员才能去使用js进行开发是吧,你说的这些专业术语可能并不适合二开人员
操作在前端还是桌面端都可以,在纯前端一样是这个业务处理逻辑,二次开发实现本身还在桌面直接操作更细致的接口使用之上的。

前端只是用代码和接口实现您这个流程,但是数据和业务逻辑本身您不清楚的不太容易实现开发需求。
【在不考虑任何非js技术的情况下是否能够解决iserver报错的问题】

嗯,我现在就只是通过new L.supermap.SpatialAnalystService调用了一个/restjsr/spatialanalyst的接口

发现相同参数下,不同数据,有的情况下正常,有的情况下报错,其实跟高程还是降水场景无关

我现在无法知道的是如何保证不同数据情况下正常调用,以及不同数据是否跟配置参数有关

修改配置有时候能保证某些特殊情况下可以运行,因此猜测可能跟参数配置有关,但是无法找到规律

不是报错问题或者规律什么的,是您的用法传参不对,z值如果设置,

应该满足可以合理插值出栅格数据,根据数据范围设置合适的空间分辨率,根据最大最小z值设置提取建个。

栅格数据是栅格值提取等值面分析传入的点位数据Z,就是这个点位栅格值,

如果你用业务值(比如降雨量), 那就是这个业务值构造插值出的栅格数据进行提取。

为什么一直在强调栅格数据是地形数据,我没有使用栅格数据,也没有使用高程数据,只是使用了一组经纬度数组,然后给每个经纬度手动设置了一个zValue值,然后当做参数使用new L.supermap.SpatialAnalystService调用了一个/restjsr/spatialanalyst的接口

SpatialAnalystService

空间分析服务类。提供:地区太阳辐射、缓冲区分析、点密度分析、动态分段分析、空间关系分析、插值分析、栅格代数运算、叠加分析、路由定位、路由测量计算、表面分析、地形曲率计算、泰森多边形分析。

是因为我使用的这个方法不正确,无法应用于我的经纬度数组生成等值面场景是么?

是否有可以满足我的应用场景的方法,我替换掉这个

GeometrySurfaceAnalystParameters这个方法是使用您的传进去点xyz构造插值出一份栅格数据,然后对插值出的栅格数据来提取等值线或等值面。

你的点组经纬度+栅格值Z+栅格分辨率,需要能够插值出一份合理的栅格数据,在这份过程栅格数据的基础上,在最小值与最大值之间,以您传的提取间距进行提取,您了解这个接口的逻辑才方便根据自己数据情况设置参数。
...