From 3e1e5ca0d426aa8310500d99ebbf0f3f0a189552 Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期四, 06 四月 2023 18:06:22 +0800 Subject: [PATCH] 地质体模型加载性能优化,数据上传,数据专业优化;底图切花添加1:20万区域地质图 --- src/components/MapView/mapSpacePop.vue | 247 +++++++++++++++++++++++++++++++------------------ 1 files changed, 156 insertions(+), 91 deletions(-) diff --git a/src/components/MapView/mapSpacePop.vue b/src/components/MapView/mapSpacePop.vue index 359ce56..f3a9fa5 100644 --- a/src/components/MapView/mapSpacePop.vue +++ b/src/components/MapView/mapSpacePop.vue @@ -787,91 +787,152 @@ pageIndex: 1, pageSize: res, wkt: this.listdata.wkt, - name: this.listdata.name + name: this.listdata.name, + hasGeom: 1, } const data = await dataQuerySelectByPage(obj) if (data.code != 200) { return } var val = data.result; - for (var i in val) { - this.setShowHistogramLayer(val[i]) - } + // for (var i in val) { + this.setShowHistogramLayer(val) + // } }, async setShowHistogramLayer(res) { - var param = { - gid: res.gid, - name: this.spaceLayer, - } + var gid = []; + for (var i in res) { - const data1 = await dataQuerySelectWktById(param) - if (data1.code != 200) { - this.$message.error("鍒楄〃璋冪敤澶辫触") + gid.push(res[i].exppointid) } - var val1 = decr(data1.result) - var wkt = this.$wkt.parse(val1) - var coord = wkt.coordinates + // var param = { + // gid: res.gid, + // name: this.spaceLayer, + // } + + + // const data1 = await dataQuerySelectWktById(param) + // if (data1.code != 200) { + // this.$message.error("鍒楄〃璋冪敤澶辫触") + // } + // var val1 = decr(data1.result) + // var wkt = this.$wkt.parse(val1) + // var coord = wkt.coordinates var obj = { pageIndex: 1, - pageSize: 10, + pageSize: 100000000, name: 'sexplorationpointstratum', - filter: "exppointid = '" + res.exppointid + "'" + filter: "exppointid in '" + gid.toString() + "'" } var data = await dataQuerySelectByPage(obj) if (data.code != 200) { return } - - if (data.result.length != 0) { - var val = data.result; - // //鍐掓场鎺掑簭 - // for (var i = 0; i < val.length; i++) { - // for (var u = i + 1; u < val.length; u++) { - // if (val[i].botdepth > val[u].botdepth) { - // var num = val[i]; - // val[i] = val[u]; - // val[u] = num; - // } - // } - // } - - var outlineList = this.outlineList - var num = res.elev; - var height = 0; - for (var i = 0; i < val.length; i++) { - var line; - - var geoname = val[i].geoname; - var col = outlineList.filter((res) => { - if (res.name == geoname) { - return res - } - }) - line = col[0].color - var height = num - val[i].botdepth - var layer = Viewer.entities.add({ - position: Cesium.Cartesian3.fromDegrees(coord[0], coord[1]), - tag: 'Histogram', - properties: val[i], - ellipse: { - semiMinorAxis: 1.0, //鐭酱 - semiMajorAxis: 1.0, //闀胯酱 - height: height, //鎷変几楂樺害 elev gwaterdep - extrudedHeight: num, //绂诲湴楂樺害 - rotation: Cesium.Math.toRadians(0), //鏃嬭浆 - fill: true, //鏄惁鏄剧ず鍦嗙殑濉厖 - material: Cesium.Color.fromCssColorString(line), //鍦嗙殑棰滆壊, - outline: false, //鏄惁鏄剧ず鍦嗚疆寤� - - }, - }); - num -= val[i].botdepth; - this.$store.state.histogramLayer.push(layer) - } - } else { + if (data.result.length == 0) { return this.$message('鏌ユ棤鏁版嵁'); + } + for (var i in res) { + this.setHistogramLayer(res[i], data.result) + } + // if (data.result.length != 0) { + // var val = data.result; + // //鍐掓场鎺掑簭 + // for (var i = 0; i < val.length; i++) { + // for (var u = i + 1; u < val.length; u++) { + // if (val[i].botdepth > val[u].botdepth) { + // var num = val[i]; + // val[i] = val[u]; + // val[u] = num; + // } + // } + // } + + + // var num = res.elev; + // var height = 0; + // for (var i = 0; i < val.length; i++) { + // var line; + + // var geoname = val[i].geoname; + // var col = outlineList.filter((res) => { + // if (res.name == geoname) { + // return res + // } + // }) + // line = col[0].color + // var height = num - val[i].botdepth + // var layer = Viewer.entities.add({ + // position: Cesium.Cartesian3.fromDegrees(coord[0], coord[1]), + // tag: 'Histogram', + // properties: val[i], + // ellipse: { + // semiMinorAxis: 1.0, //鐭酱 + // semiMajorAxis: 1.0, //闀胯酱 + // height: height, //鎷変几楂樺害 elev gwaterdep + // extrudedHeight: num, //绂诲湴楂樺害 + // rotation: Cesium.Math.toRadians(0), //鏃嬭浆 + // fill: true, //鏄惁鏄剧ず鍦嗙殑濉厖 + // material: Cesium.Color.fromCssColorString(line), //鍦嗙殑棰滆壊, + // outline: false, //鏄惁鏄剧ず鍦嗚疆寤� + + // }, + // }); + // num -= val[i].botdepth; + // this.$store.state.histogramLayer.push(layer) + // } + // } else { + // + // } + // + }, + setHistogramLayer(res, data) { + + var exppointid = res.exppointid; + + var val1 = decr(res.geom) + var wkt = this.$wkt.parse(val1) + var coord = wkt.coordinates; + + var std = []; + var num = res.elev; + var height = 0; + for (var i in data) { + if (data[i].exppointid == exppointid) { + std.push(data[i]) + } + } + + var outlineList = this.outlineList; + for (var i in std) { + var line; + var geoname = std[i].geoname; + var col = outlineList.filter((ste) => { + if (ste.name == geoname) { + return res + } + }) + line = col[0].color + + var height = num - std[i].botdepth + var layer = Viewer.entities.add({ + position: Cesium.Cartesian3.fromDegrees(coord[0], coord[1]), + tag: 'Histogram', + properties: std[i], + ellipse: { + semiMinorAxis: 1.0, //鐭酱 + semiMajorAxis: 1.0, //闀胯酱 + height: height, //鎷変几楂樺害 elev gwaterdep + extrudedHeight: num, //绂诲湴楂樺害 + rotation: Cesium.Math.toRadians(0), //鏃嬭浆 + fill: true, //鏄惁鏄剧ず鍦嗙殑濉厖 + material: Cesium.Color.fromCssColorString(line), //鍦嗙殑棰滆壊, + outline: false, //鏄惁鏄剧ず鍦嗚疆寤� + + }, + }); + num -= std[i].botdepth; + this.$store.state.histogramLayer.push(layer) } this.$store.state.histLenged = true; }, - @@ -918,47 +979,51 @@ pageIndex: 1, pageSize: this.geobodyCount, wkt: this.listdata.wkt, - name: this.listdata.name + name: this.listdata.name, + hasGeom: 1, } const data = await dataQuerySelectByPage(obj) if (data.code != 200) { return } + var gid = []; var val = data.result; - var std = []; for (var i in val) { - var param = { - gid: val[i].gid, - name: this.spaceLayer, - } + gid.push(val[i].exppointid) + } + var obj = { + pageIndex: 1, + pageSize: 100000000, + name: 'sexplorationpointstratum', + filter: "exppointid in '" + gid.toString() + "'" + } + var data2 = await dataQuerySelectByPage(obj) + debugger + if (data2.code == 200) { + var val2 = data2.result; + var std = []; + for (var i in val) { + var soilLayers = []; - const data1 = await dataQuerySelectWktById(param) - if (data1.code != 200) { - this.$message.error("鍒楄〃璋冪敤澶辫触") - } - var val1 = decr(data1.result) - var wkt = this.$wkt.parse(val1) - var coord = wkt.coordinates - var obj = { - pageIndex: 1, - pageSize: 10, - name: 'sexplorationpointstratum', - filter: "exppointid = '" + val[i].exppointid + "'" - } - var data2 = await dataQuerySelectByPage(obj) - - if (data2.code == 200) { - + for (var j in val2) { + if (val2[j].exppointid == val[i].exppointid) { + soilLayers.push(val2[j]) + } + } + var val1 = decr(val[i].geom) + var wkt = this.$wkt.parse(val1) + var coord = wkt.coordinates std.push({ bh: val[i].exppointid, X: coord[0], Y: coord[1], Z: val[i].elev, - soilLayers: data2.result + soilLayers: soilLayers }) } + this.setLayerByZFBH(std); } - this.setLayerByZFBH(std); + } else { return this.$message('鏈煡璇㈠埌杞瓟鐐规暟鎹�,鏃犳硶鐢熸垚鍦拌川浣�'); } @@ -984,7 +1049,7 @@ }, CreateLayerByZFBH(zfbh, jsonObj, materialColor) { - + debugger var featurePoints = []; var featurePoints1 = []; let points = turf.featureCollection([]); -- Gitblit v1.9.3