使用产品:SuperMap_iClient3D_10i(2020)_for_WebGL_26304
数据类型:文件型
问题详细描述:
空间分析报错:检查请求体时,发现Geometry为空。
error: {code: 400, errorMsg: "在FeatureResults资源中,检查请求体时,发现Geometry为空。"}
succeed: false
问题重现步骤:
1、参考空间分析例子:http://support.supermap.com.cn:8090/webgl/examples/webgl/editor.html#getFeatureByGeometry
2、我的代码:
// 绘制完成事件
handlerLine.drawEvt.addEventListener((result) => {
// 隐藏绘制辅助信息
// this.tooltip.setVisible(false);
handlerLine.polyline.show = false;
// 获取绘制的图形
var positions = result.object.positions;
var geometries = [];
for (var i = 0; i < positions.length; i++) {
var position = positions[i];
var cartographic = Cesium.Cartographic.fromCartesian(position);
var longitude = Cesium.Math.toDegrees(cartographic.longitude);
var latitude = Cesium.Math.toDegrees(cartographic.latitude);
var height = cartographic.height;
if (height < 0) {
height = 0;
}
var queryPoint = { // 查询点对象
x: longitude,
y: latitude,
z: height
};
geometries.push(queryPoint)
}
var queryObj = {
"getFeatureMode": "SPATIAL",
"spatialQueryMode": "CROSS",
"datasetNames": ["pts_3d:line3d19", "pts_3d:line3d20"],
"geometry": {
// id: 0,
// style: null,
// parts: [queryPoints.length],
points: geometries,
type: "POLYLINE"
}
};
let url = 'http://localhost:9092/iserver/services/data-data_3d/rest/data/featureResults.rjson?returnContent=true';
this.svc.spatialQuery(url, JSON.stringify(queryObj)).subscribe(data => {
console.log(data);
}, err => {
console.log(err);
})
});