首页 / 浏览问题 / 云GIS / 问题详情
errorMsg: "IllegalArgumentException"
22EXP 2019年11月07日
使用产品:iserver 8c 操作系统:win10 x64
数据类型: 文件型
问题详细描述:把官网上的泛克吕金页面换成自己发布的地图调用接口返回errorMsg: "IllegalArgumentException"
问题重现步骤: 1.将官网示例的泛克吕金的地址路径及数据集修改成自己的后,调用以下接口,返回errorMsg: "IllegalArgumentException",麻烦看下是什么原因。

Request URL:

http://localhost:8090/iserver/services/spatialAnalysis-China/restjsr/spatialanalyst/datasets/New_Point@China/interpolation/kriging.json?returnContent=true

1个回答

您好,这个异常说的是不合法的参数异常,检查下你写的参数有没有问题
818EXP 2019年11月07日
你好,我这边是按着案例上只是修改了数据集和地址参数,想问下

//存储用于进行插值分析的字段名称
zValueFieldName: "AVG_TMP",   是不是双精度类型?

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title data-i18n="resources.title_interpolationAnalystServiceKrigingUniversal"></title>
<script type="text/javascript" src="../js/include-web.js"></script>
<script type="text/javascript" src="../../dist/openlayers/include-openlayers.js"></script>
</head>
<body style=" margin: 0;overflow: hidden;background: #fff;width: 100%;height:100%">
<div id="map" style="width: 100%;height:100%"></div>
<script type="text/javascript">
    var map, options, interpolationAnalystResult,
        baseUrl = (window.isLocal ? window.server : "http://localhost:8090")+"/iserver/services/map-China/rest/maps/China",
        serviceUrl = (window.isLocal ? window.server : "http://localhost:8090")+"/iserver/services/spatialAnalysis-China/restjsr/spatialanalyst";
    var extent = [-2640403.63, 1873792.1, 3247669.39, 5921501.4];
    var projection = new ol.proj.Projection({
        code:'',
        extent: extent,
        units: 'm'
    });
    new ol.supermap.MapService(baseUrl).getMapInfo(function (serviceResult) {
        var mapJSONObj = serviceResult.result;
        map = new ol.Map({
            target: 'map',
            controls: ol.control.defaults({attributionOptions: {collapsed: false}})
                .extend([new ol.supermap.control.Logo()]),
            view: new ol.View({
                center: [531762, 3580330],
                zoom: 1,
                projection: projection
            })
        });
        options = ol.source.TileSuperMapRest.optionsFromMapJSON(baseUrl, mapJSONObj);
        options.layersID = "[0,1,2]";
        var layer = new ol.layer.Tile({
            source: new ol.source.TileSuperMapRest(options)
        });
        map.addLayer(layer);
        interpolationAnalystProcess();
    });

    function interpolationAnalystProcess() {
        //创建点密度插值分析参数实例
        var interpolationAnalystParameters = new SuperMap.InterpolationKrigingAnalystParameters({
            // 用于做插值分析的数据源中数据集的名称
            dataset: "New_Point@China",
            // 插值分析结果数据集的名称
            outputDatasetName: "UniversalKriging_Result",
            // 插值分析结果数据源的名称
            outputDatasourceName: "China",
            // 结果栅格数据集存储的像素格式
            pixelFormat: SuperMap.PixelFormat.DOUBLE,
            // 属性过滤条件
            filterQueryParameter: {
                attributeFilter: ""
            },
            //存储用于进行插值分析的字段名称
            zValueFieldName: "AVG_TMP",
            searchRadius: "0",
            //克吕金插值的类型
            type: "UniversalKriging",
            //克吕金类型中旋转角度值
            angle: 0,
            //克吕金类型中块金效应值
            nugget: 0,
            //克吕金类型中自相关阈值,单位与原数据集单位相同
            range: 0,
            //克吕金类型中基台值
            sill: 0,
            //克吕金插值时的半变函数类型
            variogramMode: "SPHERICAL",
            searchMode: "KDTREE_FIXED_COUNT",
            bounds: [-2640403.63, 1873792.1, 3247669.39, 5921501.4]
        });

        new ol.supermap.SpatialAnalystService(serviceUrl).interpolationAnalysis(interpolationAnalystParameters, function (serviceResult) {
            interpolationAnalystResult = serviceResult.result;
            //用栅格专题图展示分析结果
            showAnalysisResult_ThemeGridRange();
        });

        //构造栅格专题图
        function showAnalysisResult_ThemeGridRange() {
            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),
                color6 = new SuperMap.ServerColor(20, 142, 53),
                color7 = new SuperMap.ServerColor(85, 144, 55),
                color8 = new SuperMap.ServerColor(171, 168, 38),
                color9 = new SuperMap.ServerColor(235, 165, 9),
                color10 = new SuperMap.ServerColor(203, 89, 2),
                color11 = new SuperMap.ServerColor(157, 25, 1),
                color12 = new SuperMap.ServerColor(118, 15, 3),
                color13 = new SuperMap.ServerColor(112, 32, 7),
                color14 = new SuperMap.ServerColor(106, 45, 12),
                color15 = new SuperMap.ServerColor(129, 80, 50),
                color16 = new SuperMap.ServerColor(160, 154, 146),
                color17 = new SuperMap.ServerColor(107, 47, 14),
                color18 = new SuperMap.ServerColor(125, 75, 44),
                color19 = new SuperMap.ServerColor(146, 110, 88),
                color20 = new SuperMap.ServerColor(166, 153, 146);

            var themeGridRangeIteme1 = new SuperMap.ThemeGridRangeItem({
                    start: -5,
                    end: -3.4,
                    color: color1
                }),
                themeGridRangeIteme2 = new SuperMap.ThemeGridRangeItem({
                    start: -3.4,
                    end: -1.8,
                    color: color2
                }),
                themeGridRangeIteme3 = new SuperMap.ThemeGridRangeItem({
                    start: -1.8,
                    end: -0.2,
                    color: color3
                }),
                themeGridRangeIteme4 = new SuperMap.ThemeGridRangeItem({
                    start: -0.2,
                    end: 1.4,
                    color: color4
                }),
                themeGridRangeIteme5 = new SuperMap.ThemeGridRangeItem({
                    start: 1.4,
                    end: 3,
                    color: color5
                }),
                themeGridRangeIteme20 = new SuperMap.ThemeGridRangeItem({
                    start: 25.4,
                    end: 27,
                    color: color20
                });

            var themeGridRange = new SuperMap.ThemeGridRange({
                reverseColor: false,
                rangeMode: SuperMap.RangeMode.EQUALINTERVAL,
                //栅格分段专题图子项数组
                items: [themeGridRangeIteme1, themeGridRangeIteme2,
                    themeGridRangeIteme3, themeGridRangeIteme4,
                    themeGridRangeIteme5, themeGridRangeIteme6,
                    themeGridRangeIteme7, themeGridRangeIteme8,
                    themeGridRangeIteme9, themeGridRangeIteme10,
                    themeGridRangeIteme11, themeGridRangeIteme12,
                    themeGridRangeIteme13, themeGridRangeIteme14,
                    themeGridRangeIteme15, themeGridRangeIteme16,
                    themeGridRangeIteme17, themeGridRangeIteme18,
                    themeGridRangeIteme19, themeGridRangeIteme20
                ]
            });

            var themeParameters = new SuperMap.ThemeParameters({
                //制作专题图的数据集
                datasetNames: [interpolationAnalystResult.dataset.split('@')[0]],
                dataSourceNames: ["China"],
                joinItems: null,
                themes: [themeGridRange]
            });

            new ol.supermap.ThemeService(baseUrl).getThemeInfo(themeParameters, function (serviceResult) {
                var result = serviceResult.result;
                if (result && result.newResourceID) {
                    var themeLayer = new ol.layer.Tile({
                        source: new ol.source.TileSuperMapRest({
                            url: baseUrl,
                            noWrap: true,
                            cacheEnabled: false,
                            layersID: result.newResourceID,
                            tileGrid: new ol.tilegrid.TileGrid({
                                extent: extent,
                                resolutions: options.tileGrid.getResolutions()
                            }),
                            transparent: true
                        })
                    });
                    map.addLayer(themeLayer);
                }
            });
        }
    }
</script>
</body>
</html>
不支持文本类型的字段,你可以直接在桌面上进行分析,看看你的数据有问题没有,如果可以,iserver上直接填写参数,看看能不能分析出来
好的,谢谢了
...