首页 / 浏览问题 / WebGIS / 问题详情
插值分析出结果(专题图)后无法显示在地图上
6EXP 2021年07月26日

使用产品:iserver 10i 操作系统:win10 x64
数据类型: 文件型
问题详细描述:反距离权重插值
问题重现步骤: 

1.按照官方iclient for leaflet 的插值例子去模拟

 themeService.getThemeInfo(themeParameters, function (getThemeInfoServiceResult) {

            var result = getThemeInfoServiceResult.result;

            console.log(result);

            if (result && result.newResourceID) {

                themeLayer = L.supermap.tiledMapLayer(baseUrl, {

                    layersID: result.newResourceID,

                }).addTo(map);

            }

        });

2.最终插值完成后打印object结果     console.log(result);

官方:

  1. newResourceID: "0dcb7140600345b7a488c2c9f86f0538_611fd101b7f94ecc9e232604b02da771"
  2. newResourceLocation: "http://localhost:8090/iserver/services/map-temperature/rest/maps/全国温度变化图/tempLayersSet/0dcb7140600345b7a488c2c9f86f0538_611fd101b7f94ecc9e232604b02da771.json"
  3. postResultType: "CreateChild"
  4. succeed: true
  5. __proto__: Object    

我的:

  1. newResourceID: "0dcb7140600345b7a488c2c9f86f0538_f9c6617d3d624fbf9328dd275e381934"
  2. newResourceLocation: "http://localhost:8090/iserver/services/map-zuihouyicici/rest/maps/sanjiao1@zuihyici/tempLayersSet/0dcb7140600345b7a488c2c9f86f0538_f9c6617d3d624fbf9328dd275e381934.json"
  3. postResultType: "CreateChild"
  4. succeed: true
  5. __proto__: Object

说明是插值完成了的,就是没办法展示到地图上,试过很多遍了,都是这个样子

1个回答

有报错信息没,能看一下代码吗
1,000EXP 2021年07月26日
能不能加下联系方式,方便截图,谢谢了
function interpolationAnalystProcess() {

        //创建点密度插值分析参数实例

        interpolationAnalystParameters = new SuperMap.InterpolationIDWAnalystParameters({

            //用于做插值分析的数据源中数据集的名称

            dataset: "sanjiao@zuihyici",

            //插值分析结果数据集的名称

            outputDatasetName: "IDW_result",

            //插值分析结果数据源的名称

            outputDatasourceName: "Interpolation",

            //结果栅格数据集存储的像素格式

            pixelFormat: SuperMap.PixelFormat.DOUBLE,

            //存储用于进行插值分析的字段名称

            zValueFieldName: "O3d",

            // zValueFieldName: "AVG_TMP",

            resolution: 7923.84989108,

            //采取固定点数查找参与运算点的方式

            searchMode: "KDTREE_FIXED_COUNT",

            //固定点数查找方式下,参与差值运算的点数默认为12。

            expectedCount: 12,

            bounds: L.bounds([ 0.0 , 0.0], [122.31 , 33.4 ]),

            // clipParam: new SuperMap.ClipParameter({

            //     clipRegion:region

            // })

        });

        //创建点密度插值分析服务实例

        interpolationAnalystService = L.supermap.spatialAnalystService(serviceUrl);

        interpolationAnalystService.interpolationAnalysis(interpolationAnalystParameters, function (serviceResult) {

            interpolationAnalystResult = serviceResult.result;

            console.log(interpolationAnalystResult);

            if (interpolationAnalystResult && interpolationAnalystResult.dataset) {

                //用栅格专题图展示分析结果

                showAnalysisResult_ThemeGridRange();

                console.log('2');

            } else {

                alert(serviceResult.error.errorMsg);

                console.log('2');

            }

        });

    }

    function showAnalysisResult_ThemeGridRange() {

        

        //创建专题图服务实例

        themeService = L.supermap.themeService(baseUrl);

        var color1 = new SuperMap.ServerColor(170, 240, 233),

            color2 = new SuperMap.ServerColor(176, 244, 188),

            color3 = new SuperMap.ServerColor(218, 251, 178),

            color4 = new SuperMap.ServerColor(220, 236, 145),

            color5 = new SuperMap.ServerColor(96, 198, 66),
、、、

            var themeGridRangeItem1 = new SuperMap.ThemeGridRangeItem({

                start: 60,

                end: 61,

                color: color1

            }),

            themeGridRangeItem2 = new SuperMap.ThemeGridRangeItem({

                start: 61,

                end: 62,

                color: color2

            }),

            themeGridRangeItem3 = new SuperMap.ThemeGridRangeItem({

                start: 62,

                end: 63,

                color: color3

            }),

            themeGridRangeItem4 = new SuperMap.ThemeGridRangeItem({

                start: 63,

                end: 64,

                color: color4

            }),

            themeGridRangeItem5 = new SuperMap.ThemeGridRangeItem({

                start: 64,

                end: 65,

                color: color5

            }),

            themeGridRangeItem6 = new SuperMap.ThemeGridRangeItem({

                start: 65,

                end: 66,

                color: color6

            }),

            themeGridRangeItem7 = new SuperMap.ThemeGridRangeItem({

                start: 66,

                end: 67,

                color: color7

            }),

            themeGridRangeItem8 = new SuperMap.ThemeGridRangeItem({

                start: 67,

                end: 68,

                color: color8

            }),

            themeGridRangeItem9 = new SuperMap.ThemeGridRangeItem({

                start: 68,

                end: 69,

                color: color9

            }),

            themeGridRangeItem10 = new SuperMap.ThemeGridRangeItem({

                start: 69,

                end: 70,

                color: color10

            }),

            themeGridRangeItem11 = new SuperMap.ThemeGridRangeItem({

                start: 70,

                end: 71,

                color: color11

            }),

            themeGridRangeItem12 = new SuperMap.ThemeGridRangeItem({

                start: 71,

                end: 72,

                color: color12

            }),

            themeGridRangeItem13 = new SuperMap.ThemeGridRangeItem({

                start: 72,

                end: 73,

                color: color13

            }),

            themeGridRangeItem14 = new SuperMap.ThemeGridRangeItem({

                start: 73,

                end: 74,

                color: color14

            }),

            themeGridRangeItem15 = new SuperMap.ThemeGridRangeItem({

                start: 74,

                end: 75,

                color: color15

            }),

            themeGridRangeItem16 = new SuperMap.ThemeGridRangeItem({

                start: 75,

                end: 76,

                color: color16

            }),

            themeGridRangeItem17 = new SuperMap.ThemeGridRangeItem({

                start: 76,

                end: 77,

                color: color17

            }),

            themeGridRangeItem18 = new SuperMap.ThemeGridRangeItem({

                start: 77,

                end: 78,

                color: color18

            }),

            themeGridRangeItem19 = new SuperMap.ThemeGridRangeItem({

                start: 78,

                end: 79,

                color: color19

            }),

            themeGridRangeItem20 = new SuperMap.ThemeGridRangeItem({

                start: 79,

                end: 80,

                color: color20

            });

        themeGridRange = new SuperMap.ThemeGridRange({

            reverseColor: false,

            rangeMode: SuperMap.RangeMode.EQUALINTERVAL,

            //栅格分段专题图子项数组

            items: [themeGridRangeItem1, themeGridRangeItem2,

                themeGridRangeItem3, themeGridRangeItem4,

                themeGridRangeItem5, themeGridRangeItem6,

                themeGridRangeItem7, themeGridRangeItem8,

                themeGridRangeItem9, themeGridRangeItem10,

                themeGridRangeItem11, themeGridRangeItem12,

                themeGridRangeItem13, themeGridRangeItem14,

                themeGridRangeItem15, themeGridRangeItem16,

                themeGridRangeItem17, themeGridRangeItem18,

                themeGridRangeItem19, themeGridRangeItem20

            ]

        });

        themeParameters = new SuperMap.ThemeParameters({

            //制作专题图的数据集

            datasetNames: [interpolationAnalystResult.dataset.split('@')[0]],

            dataSourceNames: ["Interpolation"],

            joinItems: null,

            themes: [themeGridRange]

        });

        themeService.getThemeInfo(themeParameters, function (getThemeInfoServiceResult) {

            var result = getThemeInfoServiceResult.result;

            console.log(result);

            L.geoJSON('http://localhost:8090/iserver/services/map-zuihouyicici/rest/maps/sanjiao@zuihyici/tempLayersSet/0dcb7140600345b7a488c2c9f86f0538_68e8f07e2f324f5d8d032478e0970e1a.json', {

                        onEachFeature: function (feature, layer) {

                            // console.log(feature.);

                            // layer.bindPopup("医院" + ":" + feature.properties.NAME);

                            

                        }

                    }).addTo(map);

            if (result && result.newResourceID) {

                themeLayer = L.supermap.tiledMapLayer(baseUrl, {

                    noWrap: true,

                    cacheEnabled: false,

                    transparent: true,

                    layersID: result.newResourceID,

                    alwaysMapCRS:true

                    //opacity: 0.8

                }).addTo(map);

            }

        });

    }
您好,console.log(interpolationAnalystResult);这里的打印结果是怎么样的呢,

     //制作专题图的数据集

     datasetNames: [interpolationAnalystResult.dataset.split('@')[0]],

     dataSourceNames: ["Interpolation"],

这里的设置要与打印的结果相对应
打印结果和例子的一样,

设置我也调过了

就是展示不出来
...