Merge branch 'main' of http://123.132.248.154:10000/HC_YFZX/CaiYuanYiTiHua
commit
8c7ded2b50
|
|
@ -24,6 +24,7 @@ enum Api {
|
|||
GetGeom = "/api/ShpLayerSource/GetShapeData",
|
||||
CalTubanArea = "/api/DroneCaseInfoSingle/CalTubanArea",
|
||||
SplitAndCalTubanArea = "/api/DroneCaseInfoSingle/SplitAndCalTubanArea",
|
||||
SplitTubanBackYuan = "/api/DroneCaseInfoSingle/SplitTubanBackYuan",
|
||||
GetPermCode = '/getPermCode',
|
||||
TestRetry = '/testRetry',
|
||||
Login = '/api/Check/Login',
|
||||
|
|
@ -135,6 +136,14 @@ export function splitAndCalTubanArea(params:CalTubanAreaModel){
|
|||
}
|
||||
|
||||
|
||||
export function splitTubanBackYuan(params:CalTubanAreaModel){
|
||||
return defHttp.post(
|
||||
{
|
||||
url: Api.SplitTubanBackYuan,
|
||||
params,
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
export function getConfig(params) {
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@
|
|||
|
||||
<!-- <p class="split-panel-item" >地类图斑分割</p> -->
|
||||
|
||||
<a-dropdown>
|
||||
<!-- <a-dropdown>
|
||||
<p @click.prevent>地类图斑分割 <DownOutlined /></p>
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
|
|
@ -121,13 +121,12 @@
|
|||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
</a-dropdown> -->
|
||||
</div>
|
||||
</template>
|
||||
<div class="split-line" ></div>
|
||||
</a-popover>
|
||||
|
||||
|
||||
<a-tooltip>
|
||||
<template #title>线分割图斑</template>
|
||||
</a-tooltip>
|
||||
|
|
@ -338,7 +337,7 @@
|
|||
import { message, Modal } from 'ant-design-vue';
|
||||
import { useCloudQueryStore } from '@/store/modules/cloudquery';
|
||||
// 地类分割
|
||||
import { splitAndCalTubanArea } from '@/api/sys/layerManagement';
|
||||
import { splitAndCalTubanArea,splitTubanBackYuan } from '@/api/sys/layerManagement';
|
||||
import { CalTubanAreaModel } from '@/api/sys/model/layerModel';
|
||||
|
||||
import { AddDroneTask, LoadLandType, AddDroneLandTask, LoadCloudQueryByCaseNo } from '@/api/demo/cloudQuery';
|
||||
|
|
@ -366,7 +365,6 @@
|
|||
|
||||
let geojson = JSON.parse(JSON.stringify(res))
|
||||
|
||||
|
||||
// 绘制导入的shapgefile图斑
|
||||
handlerDetails(
|
||||
res,
|
||||
|
|
@ -419,6 +417,29 @@
|
|||
caseid:null,
|
||||
})
|
||||
|
||||
//
|
||||
|
||||
function splitMultiPolygons(str) {
|
||||
|
||||
let hadnlerStr = str.replace(",MULTIPOLYGON","-MULTIPOLYGON");
|
||||
let result = hadnlerStr.split("-");
|
||||
// 移除开头的 "MULTIPOLYGON" 和多余的括号
|
||||
// const cleanedStr = str.replace(/^MULTIPOLYGON\(/, '').replace(/\)+$/, '');
|
||||
|
||||
|
||||
// // 使用正则表达式分割多个多边形
|
||||
// const polygonStrings = cleanedStr.split(/\)\),\s*MULTIPOLYGON\(\(/);
|
||||
|
||||
// // 重新构建每个 MULTIPOLYGON
|
||||
// const result = polygonStrings.map(poly => {
|
||||
// // 确保每个多边形有正确的括号结构
|
||||
// const fixedPoly = poly.startsWith('((') ? poly : `((${poly}`;
|
||||
// return `MULTIPOLYGON(${fixedPoly}))`;
|
||||
// });
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
// 地类分割图斑
|
||||
const handlerSelectLandType = (type)=>{
|
||||
|
||||
|
|
@ -433,6 +454,59 @@
|
|||
"type":type
|
||||
}
|
||||
|
||||
splitTubanBackYuan(calAreaParams).then(res=>{
|
||||
|
||||
let geojson = {
|
||||
type:"FeatureCollection",
|
||||
features:[]
|
||||
};
|
||||
|
||||
|
||||
let wktArray = splitMultiPolygons(res.gengdituban);
|
||||
|
||||
|
||||
|
||||
if(wktArray.length>0){
|
||||
|
||||
wktArray?.forEach((item,index)=>{
|
||||
console.log("item",item);
|
||||
let feature = {
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"id": generateUUID()
|
||||
},
|
||||
"geometry": WktToGeojson(item)
|
||||
}
|
||||
geojson.features.push(feature);
|
||||
})
|
||||
}else{
|
||||
|
||||
//
|
||||
let feature = {
|
||||
"type": "Feature",
|
||||
"properties": {
|
||||
"id": generateUUID()
|
||||
},
|
||||
"geometry": WktToGeojson(res.gengdituban)
|
||||
}
|
||||
}
|
||||
|
||||
console.log("splitTubanBackYuan",geojson)
|
||||
|
||||
splitFeatureByMultiFill(geojson);
|
||||
|
||||
handlerDetails(
|
||||
{type:"FeatureCollection",features:[]},
|
||||
'shapefileSource',
|
||||
'shapefileLayer',
|
||||
{
|
||||
lineStyle: { 'line-color': '#ff0000', 'line-width': 3 },
|
||||
fillStyle: { 'fill-color': '#ff0000', 'fill-opacity': 0.1 },
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
return null;
|
||||
splitAndCalTubanArea(calAreaParams).then(res=>{
|
||||
if(res){
|
||||
|
||||
|
|
@ -1154,6 +1228,7 @@
|
|||
projection: 'equirectangular', // wgs84参考系
|
||||
style: MapboxDefaultStyle,
|
||||
// maxZoom: props.mapConfig.maxZoom ? props.mapConfig.maxZoom:18,
|
||||
maxZoom:50,
|
||||
minZoom: props.mapConfig.minZoom ? props.mapConfig.minZoom : 1,
|
||||
zoom: props.mapConfig.zoom ? props.mapConfig.zoom : 10,
|
||||
pitch: props.mapConfig.angle ? props.mapConfig.angle : 0,
|
||||
|
|
@ -1280,6 +1355,8 @@
|
|||
};
|
||||
// shapefile多面分割数据
|
||||
const splitFeatureByMultiFill = (geojson)=>{
|
||||
|
||||
|
||||
let splitPolygon = currentGeoJson.value;
|
||||
splitPolygonByMultiFill(geojson.features,JSON.parse(JSON.stringify(editGeoJson.value))).then(features=>{
|
||||
if(features){
|
||||
|
|
|
|||
|
|
@ -344,7 +344,7 @@ export async function splitPolygonByMultiFill(drawPolygons,outerPolygon){
|
|||
// 处理精度后绘制图斑
|
||||
let turfPolygon = turf.truncate(splitPolygonItem,dealOptions);
|
||||
//console.log("💩第4步:处理精度后绘制图斑",turfPolygon);
|
||||
|
||||
console.log("求交集的处理数据:",turf.featureCollection([featuresArray[0],turfPolygon]));
|
||||
// 取交集
|
||||
let intersection = turf.intersect(turf.featureCollection([featuresArray[0],turfPolygon]),dealOptions);
|
||||
|
||||
|
|
@ -354,11 +354,12 @@ export async function splitPolygonByMultiFill(drawPolygons,outerPolygon){
|
|||
//console.log("💩第5步:交集"+index+":",intersection)
|
||||
splitFeaturesArray.push(turfPolygon);
|
||||
}catch(e){
|
||||
//console.log(e);
|
||||
console.log(e);
|
||||
}
|
||||
})
|
||||
|
||||
// 取差集
|
||||
console.log("求差集的处理数据:",turf.featureCollection(featuresArray.concat(splitFeaturesArray)));
|
||||
var difference = turf.difference(turf.featureCollection(featuresArray.concat(splitFeaturesArray)));
|
||||
//console.log("💩第6步:差集",difference);
|
||||
if(difference){
|
||||
|
|
|
|||
|
|
@ -3,16 +3,14 @@ import { wktToGeoJSON,geojsonToWKT } from "@terraformer/wkt"
|
|||
|
||||
|
||||
const wktCollectionToGeoJson = (wktStr) => {
|
||||
alert(999);
|
||||
console.log("wktStr",wktStr);
|
||||
let geojson = WKT.parse(wktStr);
|
||||
console.log("geojson",geojson);
|
||||
alert(123);
|
||||
}
|
||||
|
||||
const WktToGeojson = (wktData)=> {
|
||||
// return WKT.parse(wktData)
|
||||
console.log("wktData",wktToGeoJSON(wktData));
|
||||
console.log("wktData",wktData);
|
||||
return wktToGeoJSON(wktData);
|
||||
}
|
||||
|
||||
|
|
@ -51,7 +49,9 @@ const removeZM = (geoJSON) => {
|
|||
default:
|
||||
throw new Error(`Unsupported geometry type: ${geoJSON.type}`);
|
||||
}
|
||||
|
||||
return geoJSON;
|
||||
|
||||
}
|
||||
|
||||
export {WktToGeojson,GeojsonToWkt,removeZM,wktCollectionToGeoJson}
|
||||
|
|
@ -27,27 +27,30 @@
|
|||
<LayerControl @handlerLayerButtonClick="handlerLayerButtonClick"></LayerControl>
|
||||
|
||||
|
||||
<div class="data-container" v-show="true">
|
||||
<div class="open-button" @click="changeUavContaienrShow">
|
||||
<ShrinkOutlined v-if="uavContaienrShow" />
|
||||
<ArrowsAltOutlined v-else />
|
||||
</div>
|
||||
<!-- tif list -->
|
||||
<!-- <TifList v-if="drawState" ref="TifListComponent" @changeTifLayer="changeTifLayer"></TifList> -->
|
||||
<!-- case list -->
|
||||
<!-- <CaseList v-show="false" @handlerLayerButtonClick="handlerLayerButtonClick" @toPosition="toPosition"></CaseList> -->
|
||||
<!-- uav -->
|
||||
<UAV v-show="uavContaienrShow" @toPosition="toPosition" @handlerUpdateUavLayerData="handlerUpdateUavLayerData" @handlerLayerButtonClick="handlerLayerButtonClick"></UAV>
|
||||
</div>
|
||||
<!-- monitor -->
|
||||
<!-- <Monitor :currentMonitor="monitorInfo" @register="registerModal" /> -->
|
||||
<!-- TCVideo -->
|
||||
<div class="TC-videoi-container" v-if="showTCLPlayer" v-drag>
|
||||
<div class="close-button" @click="showTCLPlayer = false;">
|
||||
<CloseOutlined></CloseOutlined>
|
||||
<div class="right-container">
|
||||
|
||||
<div class="data-container" v-show="true">
|
||||
<div class="open-button" @click="changeUavContaienrShow">
|
||||
<ShrinkOutlined v-if="uavContaienrShow" />
|
||||
<ArrowsAltOutlined v-else />
|
||||
</div>
|
||||
<!-- tif list -->
|
||||
<!-- <TifList v-if="drawState" ref="TifListComponent" @changeTifLayer="changeTifLayer"></TifList> -->
|
||||
<!-- case list -->
|
||||
<!-- <CaseList v-show="false" @handlerLayerButtonClick="handlerLayerButtonClick" @toPosition="toPosition"></CaseList> -->
|
||||
<!-- uav -->
|
||||
<UAV v-show="uavContaienrShow" @toPosition="toPosition" @handlerUpdateUavLayerData="handlerUpdateUavLayerData" @handlerLayerButtonClick="handlerLayerButtonClick"></UAV>
|
||||
</div>
|
||||
<!-- monitor -->
|
||||
<!-- <Monitor :currentMonitor="monitorInfo" @register="registerModal" /> -->
|
||||
<!-- TCVideo -->
|
||||
<div class="TC-videoi-container" v-if="showTCLPlayer" v-drag>
|
||||
<div class="close-button" @click="showTCLPlayer = false;">
|
||||
<CloseOutlined></CloseOutlined>
|
||||
|
||||
</div>
|
||||
<TCVideo v-if="showTCLPlayer" :play-url="'12334344'"></TCVideo>
|
||||
</div>
|
||||
<TCVideo v-if="showTCLPlayer" :play-url="'12334344'"></TCVideo>
|
||||
</div>
|
||||
|
||||
<!-- layer center -->
|
||||
|
|
@ -282,14 +285,18 @@ onMounted(() => {
|
|||
background: url('/videosupervision/main-bottom.png');
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.right-container{
|
||||
width:418px;
|
||||
min-height:200px;
|
||||
position: absolute;
|
||||
bottom:32px;
|
||||
right: 24px;
|
||||
}
|
||||
.data-container {
|
||||
width: 418px;
|
||||
height:300px;
|
||||
position: absolute;
|
||||
bottom:-100px;
|
||||
right: 24px;
|
||||
transform: translate(0, -50%);
|
||||
z-index:9999999;
|
||||
position: relative;
|
||||
.open-button{
|
||||
width:30px;
|
||||
height:30px;
|
||||
|
|
@ -388,9 +395,8 @@ onMounted(() => {
|
|||
}
|
||||
|
||||
.TC-videoi-container{
|
||||
position: absolute;
|
||||
bottom:48px;
|
||||
right:38px;
|
||||
margin-top:16px;
|
||||
position: relative;
|
||||
width:418px;
|
||||
height:300px;
|
||||
.close-button{
|
||||
|
|
|
|||
|
|
@ -13,9 +13,8 @@
|
|||
</div>
|
||||
|
||||
<div class="home-button" @click="handlerInitialize">
|
||||
<HomeOutlined />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -1291,13 +1290,12 @@ const handlerInitialize = ()=>{
|
|||
}
|
||||
|
||||
.home-button{
|
||||
width:100px;
|
||||
height:100px;
|
||||
width:40px;
|
||||
height:40px;
|
||||
background:url(/map/home-btn.png);
|
||||
background-size: 100% 100%;
|
||||
float:right;
|
||||
position:relative;
|
||||
top:-25px;
|
||||
line-height:100px;
|
||||
text-align:center;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue