问题1.参考http://iclient.supermap.io/examples/classic/editor.html#analysis_surfaceAnalyst生成等值线过程,结合http://ask.supermap.com/49263问题回答,将用http://iclient.supermap.io/examples/classic/editor.html#analysis_surfaceAnalyst这个范例里面替换DatasetSurfaceAnalystParameters接口修改为SuperMap.REST.GeometrySurfaceAnalystParameters接口,运用的是自己的数据,结果生成不了等值面。
问题2:DatasetSurfaceAnalystParameters接口用到是自己发布的数据分析服务,并设置里面的参数dataset和zValueFieldName,但是GeometrySurfaceAnalystParameters接口points参数和 zValues参数,points参数和 zValues参数是本地数据,就生成不了等值面图,请问这个是为什么呢???
示例数据:
[
{"x": "103.88333", "y": "36.05", "z": "11"},
{"x": "105", "y": "35.38333", "z": "4"},
{"x": "107.98333", "y": "39.1", "z": "8"},
{"x": "111.15", "y": "39.38333", "z": "9"},
{"x": "113.51667", "y": "38.95", "z": "-1"},
{"x": "106.21667", "y": "38.48333", "z": "10"},
{"x": "109.7", "y": "38.23333", "z": "9"},
{"x": "112.71667", "y": "38.73333", "z": "10"},
{"x": "114.41667", "y": "38.03333", "z": "14"},
{"x": "105.66667", "y": "37.48333", "z": "10"},
{"x": "107.4", "y": "37.78333", "z": "9"},
{"x": "108.16667", "y": "36.91667", "z": "9"},
{"x": "111.1", "y": "37.5", "z": "10"},
{"x": "112.55", "y": "37.78333", "z": "12"},
{"x": "112.98333", "y": "37.06667", "z": "10"},
{"x": "114.5", "y": "37.06667", "z": "15"},
{"x": "109.5", "y": "36.6", "z": "11"},
{"x": "111.93333", "y": "37.05", "z": "11"},
{"x": "111.5", "y": "36.06667", "z": "13"},
{"x": "114.36667", "y": "36.11667", "z": "15"},
{"x": "106.66667", "y": "35.55", "z": "9"},
{"x": "107.63333", "y": "35.73333", "z": "9"},
{"x": "109.06667", "y": "35.08333", "z": "11"},
{"x": "111.01667", "y": "35.03333", "z": "15"},
{"x": "112.4", "y": "35.48333", "z": "12"},
{"x": "113.88333", "y": "35.31667", "z": "15"},
{"x": "117.18333", "y": "39.1", "z": "13"},
{"x": "115.51667", "y": "38.85", "z": "14"},
{"x": "116.83333", "y": "38.33333", "z": "13"},
{"x": "116.31667", "y": "37.43333", "z": "14"},
{"x": "117.51667", "y": "37.5", "z": "13"},
{"x": "120.26667", "y": "37.61667", "z": "13"},
{"x": "115.58333", "y": "36.03333", "z": "14"},
{"x": "117.05", "y": "36.6", "z": "15"},
{"x": "117.1", "y": "36.25", "z": "6"},
{"x": "118.15", "y": "36.18333", "z": "13"},
{"x": "119.18333", "y": "36.75", "z": "13"},
{"x": "115.43333", "y": "35.25", "z": "14"},
{"x": "116.85", "y": "35.56667", "z": "14"},
{"x": "118.35", "y": "35.05", "z": "14"},
{"x": "119.53333", "y": "35.43333", "z": "14"},
{"x": "104.01667", "y": "34.43333", "z": "6"},
{"x": "104.91667", "y": "33.4", "z": "15"},
{"x": "104.51667", "y": "32.41667", "z": "15"},
{"x": "104.68333", "y": "31.46667", "z": "17"},
{"x": "104.01667", "y": "30.66667", "z": "17"},
{"x": "105.75", "y": "34.58333", "z": "12"},
{"x": "107.13333", "y": "34.35", "z": "14"},
{"x": "108.93333", "y": "34.3", "z": "15"},
{"x": "110.08333", "y": "34.48333", "z": "7"},
{"x": "111.03333", "y": "34.05", "z": "13"},
{"x": "112.46667", "y": "34.63333", "z": "12"},
{"x": "113.65", "y": "34.71667", "z": "15"},
{"x": "107.03333", "y": "33.06667", "z": "15"},
{"x": "112.58333", "y": "33.03333", "z": "15"},
{"x": "114.51667", "y": "33.78333", "z": "15"},
{"x": "108.03333", "y": "32.06667", "z": "15"},
{"x": "109.03333", "y": "32.71667", "z": "16"},
{"x": "110.76667", "y": "32.03333", "z": "15"},
{"x": "111.66667", "y": "32.38333", "z": "16"},
{"x": "112.75", "y": "32.15", "z": "16"},
{"x": "114.01667", "y": "33", "z": "15"},
{"x": "114.05", "y": "32.13333", "z": "16"},
{"x": "105.96667", "y": "31.58333", "z": "17"},
{"x": "106.76667", "y": "31.58333", "z": "17"},
{"x": "107.5", "y": "31.2", "z": "17"},
{"x": "109.5", "y": "31.05", "z": "17"},
{"x": "112.56667", "y": "31.16667", "z": "17"},
{"x": "115.01667", "y": "31.18333", "z": "17"},
{"x": "106.1", "y": "30.78333", "z": "17"},
{"x": "107.8", "y": "30.68333", "z": "17"},
{"x": "109.46667", "y": "30.28333", "z": "16"},
{"x": "111.3", "y": "30.7", "z": "17"},
{"x": "112.18333", "y": "30.33333", "z": "17"},
{"x": "114.13333", "y": "30.61667", "z": "17"},
{"x": "117.15", "y": "34.28333", "z": "15"},
{"x": "119.11667", "y": "34.83333", "z": "14"},
{"x": "115.76667", "y": "33.86667", "z": "15"},
{"x": "119.03333", "y": "33.6", "z": "15"},
{"x": "115.81667", "y": "32.91667", "z": "16"},
{"x": "115.66667", "y": "32.16667", "z": "16"},
{"x": "117.38333", "y": "32.95", "z": "16"},
{"x": "118.8", "y": "32", "z": "16"},
{"x": "116.31667", "y": "31.4", "z": "16"},
{"x": "117.23333", "y": "31.86667", "z": "17"},
{"x": "118.58333", "y": "31.15", "z": "16"},
{"x": "117.05", "y": "30.53333", "z": "17"},
{"x": "118.15", "y": "30.13333", "z": "8"},
{"x": "115.98333", "y": "29.58333", "z": "12"},
];
程序代码:
function surfaceAnalystProcess() {
widgets.alert.clearAlert();
resultLayer.removeAllFeatures();
var
surfaceAnalystService = new SuperMap.REST.SurfaceAnalystService(url2),
surfaceAnalystParameters = new SuperMap.REST.SurfaceAnalystParametersSetting({
datumValue: 0,
// interval: 2,
interval: 1,
resampleTolerance: 0,
smoothMethod: SuperMap.REST.SmoothMethod.BSPLINE,
smoothness: 3,
clipRegion: region
// clipRegion: null
}),
// params = new SuperMap.REST.DatasetSurfaceAnalystParameters({
// extractParameter: surfaceAnalystParameters,
// dataset: "SamplesP@Interpolation",
// resolution: 3000,
// zValueFieldName: "AVG_TMP"
// });
params = SuperMap.REST.GeometrySurfaceAnalystParameters({
points: pointsArray,
zValues: zvalues,
resolution: 3000,
extractParameter: surfaceAnalystParameters,
surfaceAnalystMethod: SuperMap.REST.SurfaceAnalystMethod.ISOREGION
});
surfaceAnalystService.events.on({
"processCompleted": surfaceAnalystCompleted,
"processFailed": surfaceAnalystFailed
});
surfaceAnalystService.processAsync(params);
}