本文主要是介绍SuperMap iClient 3D for WebGL调用spatialanalyst空间分析服务对线数据进行放样,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
作者:kk
前言
本篇博客介绍的是如何在SuperMap iClient 3D for WebGL调用spatialanalyst空间分析服务对线数据进行放样
一、首先需要在iServer发布空间分析服务
操作截图
iServer发布空间分析服务
二、请求参数
代码如下:
var line = [{'x':116.44564437859106,'y':39.90302628980606,'z':15},{'x':116.44897779551044,'y':39.91745799561381,'z':30},{'x':116.4658603735841,'y':39.914008304232816,'z':0}]var geometrySkylineSectorBodyParameter = {"geometry":{"type":"LINE3D", "parts":[1], "points":line},"distance":100,"lonlat":true,"resultType":"BODY","joinType":"ROUND"};var queryData = JSON.stringify(geometrySkylineSectorBodyParameter);
空间分析其他参数设置详情见iServer帮助文档:http://support.supermap.com.cn/DataWarehouse/WebDocHelp/iServer/mergedProjects/SuperMapiServerRESTAPI/root/spatialanalyst/spatialanalyst.htm
三、发起请求
//空间分析服务地址var url = "http://www.supermapol.com/realspace/services/spatialAnalysis-data_all/restjsr/spatialanalyst/geometry/3d/buffer.json";$.ajax({url: url,async: true,data: queryData,method: "POST"}).done(function (data) {$.ajax({url: data.newResourceLocation + ".json",method: "GET"}).done(function (data) {if (data.geometry === null) {console.log(data,'sssssssss')return;}console.log("空间分析完成");})});
此处使用的是官网在线的空间分析服务地址
四、构建体数据
//添加体//将model转换为8 位无符号整数值的类型化数组var u8 = new Uint8Array(data.geometry.model);var ab = u8.buffer;//S3M实例化模型集合构建体s3mInstanceColc.add("resultSkyline", {position: Cesium.Cartesian3.fromDegrees(data.geometry.position.x, data.geometry.position.y, 500),hpr: new Cesium.HeadingPitchRoll(0, 0, 0),color: new Cesium.Color(0, 160 / 255, 233 / 255, 0.5)}, ab,false);
五、结果图
这篇关于SuperMap iClient 3D for WebGL调用spatialanalyst空间分析服务对线数据进行放样的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!