|
@@ -129,7 +129,7 @@
|
|
|
</div>
|
|
|
<div class="divText">
|
|
|
<div>
|
|
|
- <span style="color: #fff"> 预计征地面积(亩)</span>
|
|
|
+ <span style="color: #fff">分析范围(亩)</span>
|
|
|
</div>
|
|
|
<div>
|
|
|
<span color="#2d8cf0">{{ zdResult.totalZDMJ }}</span>
|
|
@@ -1423,10 +1423,10 @@ export default {
|
|
|
new Cesium.Cartesian3.fromDegreesArray(positions)
|
|
|
),
|
|
|
// positions: new Cesium.Cartesian3.fromDegreesArray(positions),
|
|
|
- material: new Cesium.Color(255 / 255, 211 / 255, 128 / 255, 1),
|
|
|
+ material: Cesium.Color.WHITE.withAlpha(0.3),
|
|
|
outline: true,
|
|
|
- outlineColor: Cesium.Color.BLACK,
|
|
|
- outlineWidth: 1.0,
|
|
|
+ outlineColor: Cesium.Color.RED,
|
|
|
+ outlineWidth: 2.0,
|
|
|
},
|
|
|
});
|
|
|
|
|
@@ -2168,19 +2168,39 @@ export default {
|
|
|
// window.createTooltip.setVisible(false);
|
|
|
debugger;
|
|
|
console.log(result);
|
|
|
- handlerPolygon.polygon.show = true;
|
|
|
- handlerPolygon.polyline.show = true;
|
|
|
- handlerPolygon.polygon.polygon.material.color =
|
|
|
- Cesium.Color.CHARTREUSE.withAlpha(0.5);
|
|
|
- that.positions = [];
|
|
|
+ handlerPolygon.polygon.show = false;
|
|
|
+ handlerPolygon.polyline.show = false;
|
|
|
+
|
|
|
+ var nPositions = [];
|
|
|
for (var pt of result.object.positions) {
|
|
|
var cartographic = Cesium.Cartographic.fromCartesian(pt);
|
|
|
var longitude = Cesium.Math.toDegrees(cartographic.longitude);
|
|
|
var latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
|
|
var height = cartographic.height;
|
|
|
that.regions.push({ x: longitude, y: latitude });
|
|
|
+ nPositions.push(longitude)
|
|
|
+ nPositions.push(latitude)
|
|
|
}
|
|
|
- that.regions.push(that.regions[0]);
|
|
|
+ viewer.entities.removeById('polygon');
|
|
|
+ polygonEntity = new Cesium.Entity({
|
|
|
+ id: 'polygon',
|
|
|
+ // position: Cesium.Cartesian3.fromDegreesArray([
|
|
|
+ // centerX,
|
|
|
+ // centerY,
|
|
|
+ // ]),
|
|
|
+ // classificationType: ClassificationType.TERRAIN,
|
|
|
+ polygon: {
|
|
|
+ hierarchy: new Cesium.PolygonHierarchy(
|
|
|
+ new Cesium.Cartesian3.fromDegreesArray(nPositions)
|
|
|
+ ),
|
|
|
+ // positions: new Cesium.Cartesian3.fromDegreesArray(positions),
|
|
|
+ material: Cesium.Color.WHITE.withAlpha(0.3),
|
|
|
+ outline: true,
|
|
|
+ outlineColor: Cesium.Color.RED,
|
|
|
+ outlineWidth: 2.0,
|
|
|
+ },
|
|
|
+ });
|
|
|
+ viewer.entities.add(polygonEntity)
|
|
|
|
|
|
// that.regions = [];
|
|
|
// that.regions.push(that.positions);
|
|
@@ -2462,196 +2482,9 @@ export default {
|
|
|
return false;
|
|
|
}
|
|
|
});
|
|
|
- // this.kring();
|
|
|
|
|
|
},
|
|
|
- kring() {
|
|
|
-
|
|
|
- //创建阴影查询对象
|
|
|
- var that = this
|
|
|
- var shadowQuery = new Cesium.ShadowQueryPoints(scene);
|
|
|
- var layers = scene.layers._layers
|
|
|
- // layers[0].selectEnabled = false;
|
|
|
- // layers[1].selectEnabled = false;
|
|
|
- // //设置图层的阴影模式
|
|
|
- // layers[0].shadowType = 2;
|
|
|
- // layers[1].shadowType = 2;
|
|
|
-
|
|
|
- var startTime = new Date('2024-07-14');
|
|
|
- startTime.setHours(10);
|
|
|
- shadowQuery.startTime = Cesium.JulianDate.fromDate(startTime);
|
|
|
-
|
|
|
-
|
|
|
- var endTime = new Date('2024-07-14');
|
|
|
- endTime.setHours(14);
|
|
|
- shadowQuery.endTime = Cesium.JulianDate.fromDate(endTime);
|
|
|
-
|
|
|
- shadowQuery.spacing = 10;
|
|
|
- shadowQuery.timeInterval = 60;
|
|
|
- var poisnts = [];
|
|
|
- this.regions.forEach((item) => {
|
|
|
- poisnts.push(item.x)
|
|
|
- poisnts.push(item.y)
|
|
|
- })
|
|
|
- shadowQuery.qureyRegion({
|
|
|
- position: poisnts,
|
|
|
- bottom: 20,
|
|
|
- extend: 5
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- endTime = new Date('2024-07-14');
|
|
|
- endTime.setHours(14);
|
|
|
- viewer.clock.currentTime = Cesium.JulianDate.fromDate(endTime);
|
|
|
- viewer.clock.multiplier = 1;
|
|
|
- viewer.clock.shouldAnimate = true;
|
|
|
- shadowQuery.build();
|
|
|
-
|
|
|
- let params = {
|
|
|
- maxValue: 100,
|
|
|
- krigingModel: 'exponential',//model还可选'gaussian','spherical',exponential
|
|
|
- krigingSigma2: 0,
|
|
|
- krigingAlpha: 100,
|
|
|
- canvasAlpha: 0.75,//canvas图层透明度
|
|
|
- colors: ["rgb(0,0,255)", "rgb(0,217,255)", "rgb(0,255,245)", "rgb(0,255,128)", "rgb(237,255,0)", "rgb(255,214,0)",
|
|
|
- "rgb(255,85,0)", "rgb(255,85,0)"]
|
|
|
- // ["#0000FF", "#7FFF00", "#FFD700", "#FFA500", "#FF4500", "#ffffbf",
|
|
|
- // "#fee08b", "#fdae61", "#f46d43", "#d73027", "#a50026"],
|
|
|
- }
|
|
|
- var temPoinst = [];
|
|
|
- var values = [];
|
|
|
- var lons = [];
|
|
|
- var lats = [];
|
|
|
- shadowQuery.queryPointsEvent.addEventListener(function (points) {
|
|
|
- temPoinst = []
|
|
|
- var values = [];
|
|
|
- lons = [];
|
|
|
- lats = [];
|
|
|
- debugger
|
|
|
- for (var i = 0; i < points.length; i++) {
|
|
|
- var pt = points[i]
|
|
|
-
|
|
|
- var cartographic = Cesium.Cartographic.fromCartesian(pt.position);
|
|
|
- var shadowRadio = shadowQuery.getShadowRadio(cartographic);
|
|
|
- var longitude = Cesium.Math.toDegrees(cartographic.longitude);
|
|
|
- var latitude = Cesium.Math.toDegrees(cartographic.latitude);
|
|
|
-
|
|
|
- temPoinst.push({ x: longitude, y: latitude, z: shadowRadio })
|
|
|
- values.push(shadowRadio)
|
|
|
- lons.push(longitude)
|
|
|
- lats.push(latitude)
|
|
|
- }
|
|
|
|
|
|
- debugger
|
|
|
- // pointArray.push(point([longitude, latitude], { 'shadowRatio': poisnts[i].shadowRatio }))
|
|
|
- let variogram = kriging.train(
|
|
|
- values,
|
|
|
- lons,
|
|
|
- lats,
|
|
|
- params.krigingModel,
|
|
|
- params.krigingSigma2,
|
|
|
- params.krigingAlpha
|
|
|
- )
|
|
|
- debugger
|
|
|
- let polygons = [[]];
|
|
|
-
|
|
|
- var xmin = that.regions[0].x;
|
|
|
- var xmax = that.regions[0].x;
|
|
|
- var ymin = that.regions[0].y;
|
|
|
- var ymax = that.regions[0].y;
|
|
|
- that.regions.forEach((t) => {
|
|
|
- if (xmin > t.x)
|
|
|
- xmin = t.x;
|
|
|
- if (xmax < t.x)
|
|
|
- xmax = t.x;
|
|
|
- if (ymin > t.y)
|
|
|
- ymin = t.y;
|
|
|
- if (ymax < t.y)
|
|
|
- ymax = t.y;
|
|
|
- polygons[0].push([t.x, t.y])
|
|
|
- })
|
|
|
- var extent = [xmin, ymin, xmax, ymax]
|
|
|
- let grid = kriging.grid(polygons, variogram, (xmax - xmin) / 100);
|
|
|
-
|
|
|
- //根据scope边界线,生成范围信息
|
|
|
- var xlim = [xmin, xmax];
|
|
|
- var ylim = [ymin, ymax];
|
|
|
- // var canvas = document.getElementById("CVS")
|
|
|
- // kriging.plot(canvas, grid, xlim, ylim, params.colors)
|
|
|
- // let fc = that.gridFeatureCollection(grid, xlim, ylim);
|
|
|
- // var collection = featureCollection(fc);
|
|
|
- // var breaks = [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0];
|
|
|
- // var obands = isobands(collection, breaks, { zProperty: 'value' });
|
|
|
-
|
|
|
- // // var colors = ["rgb(0,0,255)", "rgb(0,217,255)", "rgb(0,255,245)", "rgb(0,255,128)", "rgb(237,255,0)", "rgb(255,214,0)",
|
|
|
- // // "rgb(255,85,0)", "rgb(255,85,0)"];
|
|
|
- // var colors = [Cesium.Color.fromCssColorString("rgb(0,0,255)"),
|
|
|
- // Cesium.Color.fromCssColorString("rgb(0,217,255)"),
|
|
|
- // Cesium.Color.fromCssColorString("rgb(0,255,245)"),
|
|
|
- // Cesium.Color.fromCssColorString("rgb(0,255,128)"),
|
|
|
- // Cesium.Color.fromCssColorString("rgb(237,255,0)"),
|
|
|
- // Cesium.Color.fromCssColorString("rgb(255,214,0)"),
|
|
|
- // Cesium.Color.fromCssColorString("rgb(255,0,0)"),
|
|
|
- // Cesium.Color.fromCssColorString("rgb(255,0,0)"),
|
|
|
- // Cesium.Color.fromCssColorString("rgb(255,0,0)")];
|
|
|
- // viewer.entities.removeAll()
|
|
|
- // obands.features.forEach((element, index) => {
|
|
|
- // // color = colors[index]
|
|
|
- // let sd;
|
|
|
- // let color;
|
|
|
- // if (index > colors.length)
|
|
|
- // color = colors.splice(colors.length - 1, 1);
|
|
|
- // else
|
|
|
- // color = colors[index]
|
|
|
- // if (element.geometry.coordinates.length != 0) {
|
|
|
- // sd = element.geometry.coordinates[0][0].flat();
|
|
|
- // // color = Cesium.Color.BLUE.withAlpha(0.5)
|
|
|
- // // if (element.properties.value == "0-0.2")
|
|
|
- // // color = Cesium.Color.BLUE
|
|
|
- // // else if (element.properties.value == "0.2-0.4")
|
|
|
- // // color = Cesium.Color.CYAN.withAlpha(0.5)
|
|
|
- // // else if (element.properties.value == "0.4-0.6")
|
|
|
- // // color = Cesium.Color.GREENYELLOW
|
|
|
- // // else if (element.properties.value == "0.6-0.8")
|
|
|
- // // color = Cesium.Color.ORANGERED
|
|
|
- // // else if (element.properties.value == "0.8-1")
|
|
|
- // // color = Cesium.Color.RED
|
|
|
- // var entity = new Cesium.Entity({
|
|
|
- // polygon: {
|
|
|
- // hierarchy: Cesium.Cartesian3.fromDegreesArray(sd),
|
|
|
- // material:color,
|
|
|
- // outline: true,
|
|
|
- // outlineColor: Cesium.Color.BLACK,
|
|
|
- // outlineWidth: 0.5,
|
|
|
- // // Cesium.Color.fromCssColorString(color)
|
|
|
- // },
|
|
|
- // })
|
|
|
- // viewer.entities.add(entity);
|
|
|
- // }
|
|
|
- // });
|
|
|
- // that.holePolygon.deactivate()
|
|
|
- shadowQuery.clear();
|
|
|
- })
|
|
|
-
|
|
|
- // console.log(obands)
|
|
|
- },
|
|
|
- gridFeatureCollection(grid, xlim, ylim) {
|
|
|
- var range = grid.zlim[1] - grid.zlim[0];
|
|
|
- var i, j, x, y, z;
|
|
|
- var n = grid.length;//列数
|
|
|
- var m = grid[0].length;//行数
|
|
|
- var pointArray = [];
|
|
|
- for (i = 0; i < n; i++)
|
|
|
- for (j = 0; j < m; j++) {
|
|
|
- x = (i) * grid.width + grid.xlim[0];
|
|
|
- y = (j) * grid.width + grid.ylim[0];
|
|
|
- z = (grid[i][j] - grid.zlim[0]) / range;
|
|
|
- if (z < 0.0) z = 0.0;
|
|
|
- if (z > 1.0) z = 1.0;
|
|
|
- pointArray.push(point([x, y], { value: z }));
|
|
|
- }
|
|
|
- return pointArray;
|
|
|
- },
|
|
|
/**
|
|
|
* 征地计算
|
|
|
*/
|
|
@@ -2863,7 +2696,7 @@ export default {
|
|
|
if (ZDBZ) {
|
|
|
|
|
|
//征地面积
|
|
|
- that.zdResult.totalZDMJ = parseFloat(totalZDMJ.toFixed(2));
|
|
|
+ that.zdResult.totalZDMJ = 0.00;// parseFloat(totalZDMJ.toFixed(2));
|
|
|
// //总补偿
|
|
|
// that.zdResult.totalPay = parseFloat(
|
|
|
// ((totalZDMJ * ZDBZ.BCBZ.BCHJ) / 10000).toFixed(2)
|
|
@@ -2892,9 +2725,24 @@ export default {
|
|
|
}
|
|
|
that.zdResult.features = features;
|
|
|
that.zdResult.fieldInfos = fieldInfos;
|
|
|
+ that.zdResult.totalZDMJ = parseFloat((that.getRegionArea() / 666.66).toFixed(2));
|
|
|
|
|
|
//<--
|
|
|
},
|
|
|
+ //范围面积
|
|
|
+ getRegionArea() {
|
|
|
+ debugger
|
|
|
+ var points1 = this.regions;
|
|
|
+ var parts1 = [];
|
|
|
+ var poly1;
|
|
|
+ for (var i = 0; i < points1.length; i++) {
|
|
|
+ parts1.push([points1[i].x, points1[i].y]);
|
|
|
+ }
|
|
|
+ poly1 = polygon([parts1]);
|
|
|
+ var textarea = area(poly1) * window.earthRadius;
|
|
|
+ return textarea;
|
|
|
+
|
|
|
+ },
|
|
|
getfldIndex(fieldInfos, fldName) {
|
|
|
var fldIndex = -1;
|
|
|
fieldInfos.forEach((fld, index) => {
|
|
@@ -3171,17 +3019,17 @@ export default {
|
|
|
parts1.push([points1[i].x, points1[i].y]);
|
|
|
}
|
|
|
poly1 = polygon([parts1]);
|
|
|
- var textarea = area(poly1);
|
|
|
+ var textarea = area(poly1) * window.earthRadius;
|
|
|
console.log("分析范围:" + textarea);
|
|
|
for (var i = 0; i < points2.length; i++) {
|
|
|
parts2.push([points2[i].x, points2[i].y]);
|
|
|
}
|
|
|
poly2 = polygon([parts2]);
|
|
|
var isContain = booleanContains(poly1, poly2);
|
|
|
- if (isContain) return area(poly2);
|
|
|
+ if (isContain) return area(poly2) * window.earthRadius;
|
|
|
else {
|
|
|
var intersection = intersect(poly1, poly2);
|
|
|
- return area(intersection);
|
|
|
+ return area(intersection) * window.earthRadius;
|
|
|
}
|
|
|
return 0;
|
|
|
},
|
|
@@ -3191,12 +3039,12 @@ export default {
|
|
|
calculateIntersectArea(Points1, Points2) {
|
|
|
const geometry1 = this.AssemblySurface(Points1);
|
|
|
|
|
|
- var textarea = area(geometry1);
|
|
|
+ var textarea = area(geometry1) * window.earthRadius;
|
|
|
console.log("分析范围:" + textarea);
|
|
|
const geometry2 = this.AssemblySurface(Points2);
|
|
|
let areaPs = intersect(geometry1, geometry2);
|
|
|
if (areaPs) {
|
|
|
- const areadifference = area(areaPs);
|
|
|
+ const areadifference = area(areaPs) * window.earthRadius;
|
|
|
return Number(areadifference.toFixed(2));
|
|
|
} else {
|
|
|
return 0;
|