Compare commits

...

2 Commits

Author SHA1 Message Date
徐景良 0927b4ef37 merge 1 week ago
徐景良 0b2686e8e0 merge 1 week ago

@ -1,6 +1,7 @@
import { defHttp } from '@/utils/http/axios';
enum Api {
GetDataList = '/api/DroneDock/GetDroneDockInfos',
DbUpload = '/api/DroneDock/dbupload',
}
export function GetDataList(params) {
@ -8,4 +9,11 @@ export function GetDataList(params) {
url: Api.GetDataList,
params
});
}
export function handlerDbUpload(params) {
return defHttp.get({
url: Api.DbUpload,
params
});
}

@ -1,8 +1,14 @@
<template>
<BasicTable @register="registerTable">
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'flighttaskid'">
<a-tag color="#87d068" v-if="record.flighttaskid"></a-tag>
</template>
<template v-if="column.key === 'action'">
<a-button v-if="!record.tasklist" type="primary" @click="openDraw(record)"></a-button>
<a-button size="small" v-if="!record.tasklist" type="primary" @click="openDraw(record)"></a-button>
<span>&nbsp;</span>
<a-button size="small" v-if="record.flighttaskid" type="primary" @click="packageData(record)"></a-button>
</template>
</template>
</BasicTable>
@ -12,9 +18,10 @@
import { ref, defineProps, onMounted, watch, nextTick } from "vue"
import { BasicTable, useTable, TableAction } from '@/components/Table';
import { columns, searchFormSchema } from './utils'
import { GetDataList } from '@/api/demo/provincetasks'
import { GetDataList,handlerDbUpload } from '@/api/demo/provincetasks'
import { useRouter } from 'vue-router'
import { geometry } from "@turf/turf";
import { message } from 'ant-design-vue';
const router = useRouter()
const [registerTable, { reload, expandAll, getForm,getDataSource,setTableData }] = useTable({
@ -55,10 +62,21 @@ const openDraw = (e) =>{
router.push({
path: '/workmanagement/workplan',
query: {
taskid: e.id
taskid: e.id,
nember:e.dkbh,
geometry:e.dkfw,
}
})
}
const packageData = (record) => {
let res = handlerDbUpload({taskId:record.id});
if(res){
message.success("打包成功!");
}
}
</script>
<style lang="scss" scoped>

@ -27,6 +27,9 @@ export const columns = [
{
title: '备注',
dataIndex: 'bz',
}, {
title: '状态',
dataIndex: 'flighttaskid',
}
];

@ -446,6 +446,7 @@
};
}
GetMediaFile(query).then((res) => {
console.log("res123",res);
showTableData.value = res.items;
tableTypeAfterShow.value = tableType.value;
// -

@ -50,6 +50,7 @@ cameras?.forEach((item,index)=>{
})
})
const checkCamera = (item) => {
item.checked = !item.checked
const result = cameraType.value

@ -221,7 +221,7 @@
</div>
<div class="footer-container">
<div >
<a-button v-if="!paramValue" @click="resetForm" style="width:100%;"></a-button>
<a-button @click="resetForm" style="width:100%;">取消</a-button>
</div>
<div v-if="submitForm.status == 0">
@ -244,6 +244,7 @@ import { PlusOutlined,LeftOutlined,DeleteOutlined,MoreOutlined } from '@ant-desi
import { addTask,editTask,getWorkspaceList,getAirLine } from "@/api/sys/workplan";
import axios from 'axios';
import JSZip from 'jszip';
import { GetMediaFile } from '@/api/demo/mediaLibrary';
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
import { Modal, message } from 'ant-design-vue';
import { useRoute,useRouter } from 'vue-router'
@ -293,7 +294,7 @@ const props = defineProps({
"uploadedFileCount": 0,
"flightId": null,
"reason": null,
"externalTaskId": null
"externalTaskId": "0959e6bf-918f-4465-9708-d2da2cd3fcf3"
})
},
"editMode":{
@ -336,7 +337,7 @@ const submitForm = ref({
"uploadedFileCount": 0,
"flightId": null,
"reason": null,
"externalTaskId": null,
"externalTaskId": "0959e6bf-918f-4465-9708-d2da2cd3fcf3"
})
// workspace
@ -345,6 +346,11 @@ const workspaceList = ref([]);
const loadWorkspaceList = async () => {
let res = await getWorkspaceList({isjoin:0});
workspaceList.value = res;
if(res){
submitForm.value.workspaceId = res[0].Id
}
}
loadWorkspaceList();
@ -398,9 +404,13 @@ const handlerDisplayCronTime = ()=>{
}
//
const toImageList = () => {
console.log("formData",props.formData.id);
const toImageList =async () => {
// let imageList = await handlerGetImageList(props.formData.id);
// emit("loadResultImageList",imageList)
// return null;
routerer.push({
path: '/system/mediaLibrary',
@ -410,6 +420,24 @@ const toImageList = () => {
});
}
//
const handlerGetImageList = async (planId) => {
let queryParams = {
taskId:planId,
page:1,
limit:99999,
objectKeyExist:1
}
let res = await GetMediaFile(queryParams);
return res.items;
}
//
//
if(props.formData){
handlerDisplayCronTime();
@ -483,7 +511,7 @@ watch(
"uploadedFileCount": 0,
"flightId": null,
"reason": null,
"externalTaskId": null,
"externalTaskId": "0959e6bf-918f-4465-9708-d2da2cd3fcf3"
};
}
},
@ -509,7 +537,7 @@ watch(
}
)
const emit = defineEmits(['selectAriLine','cancleCraete',"selectAircraft","successCreatePlan","intelligentPatrol","startEditAirLine"]);
const emit = defineEmits(['selectAriLine','cancleCraete',"selectAircraft","successCreatePlan","intelligentPatrol","startEditAirLine",'loadResultImageList']);
const removeAirLine = ()=>{
props.checkedAriLine.value = {};
@ -600,6 +628,7 @@ const rules = {
const onSubmit = () => {
isSubmit.value = true;
formRef.value.validate().then(
@ -622,7 +651,8 @@ const onSubmit = () => {
//
let data = {...submitForm.value}
let res = editTask(data);
// let res = editTask(data);
let res = addTask(data);
if(res){
message.success("操作成功!");
emit("successCreatePlan");

@ -297,9 +297,11 @@
} else if (props.airLineForm.airLineType == 'mapping2d') {
handlerEditPolygonAirLine();
}
}
},
);
}
}
)
watch(
() => props.polygonArea,
@ -460,6 +462,7 @@
handlerDrawCamera(currentAirPoint.value);
};
///////////////////////////////////////////////////////////////////////////
let map: mars3d.Map; //
@ -488,6 +491,19 @@
// 线
let lineGroundPointLayer: mars3d.layer.GraphicLayer;
//
let imageStickGroundPointLayer: mars3d.layer.GraphicLayer;
// 线
let imageLineGroundPointLayer: mars3d.layer.GraphicLayer;
//
let imageResultPointLayer: mars3d.layer.GraphicLayer;
//
//
let homeStartGraphic;
@ -556,6 +572,7 @@
centerObj.heading = 2;
centerObj.pitch = -86;
}
initMap();
EventBus.on('closeTranslation', (val: any) => {
@ -838,6 +855,35 @@
} else if (props.airLineForm.airLineType == 'mapping2d') {
handlerEditPolygonAirLine();
}
}else if(props.editMode == 'autoAdd'){ // 线
// handlerEditPolygonAirLine();
let geojson = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[118.30155473, 35.13429214999999],
[118.30155473, 35.135213541900015],
[118.30068670230001, 35.135213541900015],
[118.30068670230001, 35.13429214999999],
[118.30155473, 35.13429214999999]
]
]
}
}
]
};
handlerDrawPolygon(geojson);
// console.log("templateKmlConfig123",props.templateKmlConfig)
}
//
@ -940,6 +986,12 @@
map.addLayer(layer);
};
/////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
// [lng,lat,alt]
@ -1043,38 +1095,113 @@
});
//
const handlerDrawPolygon = async () => {
const graphic = await polygonGraphicLayer.startDraw({
type: 'polygon',
style: {
color: '#408eff',
opacity: 0.3,
outline: true,
outlineColor: '#408eff',
outlineWidth: 3.0,
clampToGround: true,
},
});
let coordinates = graphic.toJSON().positions;
coordinates.push(coordinates[0]);
polygonGeoJson.value = coordinates;
let polygon = turf.polygon([coordinates]);
let polygonWkt = GeojsonToWkt(polygon['geometry']);
props.airLineForm.flyToFirstPointMode = polygonWkt;
// 线
let spceing = parseFloat(polygonCalculateParams.value?.spacing) / 10000;
//
let direction = props.templateKmlConfig.Folder.Placemark.direction
? props.templateKmlConfig.Folder.Placemark.direction
: 0;
// 线
let lines = generateScanLines(polygon, spceing, direction);
// 线
CalculateAreaInfo(polygon, lines);
// 线
handlerDrawPolygonLine(lines);
//
handlerGetPolygonBorderInfo(polygonGeoJson.value);
const handlerDrawPolygon = async (geojson:any = null) => {
if(geojson!=null){
//
let takeoffArray = props.templateKmlConfig.missionConfig.takeOffRefPoint.split(',');
takeOffPointPosition.value = [
parseFloat(takeoffArray[1]),
parseFloat(takeoffArray[0]),
parseFloat(takeoffArray[2]),
];
polygonAirForm.value.startingPoint = [
parseFloat(takeoffArray[1]),
parseFloat(takeoffArray[0]),
parseFloat(takeoffArray[2]),
];
takeOffPointGraphicLayer ? takeOffPointGraphicLayer.clear() : null;
let startFlyGraphic = new mars3d.graphic.BillboardEntity({
position: takeOffPointPosition.value,
style: {
image: '/map/start.png',
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
label: {
text: '参考起飞点',
font_size: 16,
color: '#ffffff',
outline: true,
outlineColor: '#000000',
pixelOffsetY: -50,
},
clampToGround: true,
},
});
takeOffPointGraphicLayer.addGraphic(startFlyGraphic);
polygonGraphicLayer.loadGeoJSON(geojson, {
type: 'polygon',
flyTo: true,
style: {
color: '#408eff',
opacity: 0.3,
outline: true,
outlineColor: '#408eff',
outlineWidth: 3.0,
clampToGround: true,
},
});
let coordinates = geojson.features[0].geometry[0];
polygonGeoJson.value = coordinates;
let polygon = turf.polygon([coordinates]);
let polygonWkt = GeojsonToWkt(polygon['geometry']);
// props.airLineForm.flyToFirstPointMode = polygonWkt;
// // 线
// let spceing = parseFloat(polygonCalculateParams.value?.spacing) / 10000;
// //
// let direction = props.templateKmlConfig.Folder.Placemark.direction ? props.templateKmlConfig.Folder.Placemark.direction : 0;
// // 线
// let lines = generateScanLines(polygon, spceing, direction);
// // 线
// CalculateAreaInfo(polygon, lines);
// // 线
// handlerDrawPolygonLine(lines);
// //
// handlerGetPolygonBorderInfo(polygonGeoJson.value);
} else {
const graphic = await polygonGraphicLayer.startDraw({
type: 'polygon',
style: {
color: '#408eff',
opacity: 0.3,
outline: true,
outlineColor: '#408eff',
outlineWidth: 3.0,
clampToGround: true,
},
});
let coordinates = graphic.toJSON().positions;
coordinates.push(coordinates[0]);
polygonGeoJson.value = coordinates;
let polygon = turf.polygon([coordinates]);
let polygonWkt = GeojsonToWkt(polygon['geometry']);
props.airLineForm.flyToFirstPointMode = polygonWkt;
// 线
let spceing = parseFloat(polygonCalculateParams.value?.spacing) / 10000;
//
let direction = props.templateKmlConfig.Folder.Placemark.direction ? props.templateKmlConfig.Folder.Placemark.direction : 0;
// 线
let lines = generateScanLines(polygon, spceing, direction);
// 线
CalculateAreaInfo(polygon, lines);
// 线
handlerDrawPolygonLine(lines);
//
handlerGetPolygonBorderInfo(polygonGeoJson.value);
}
};
//
const handlerDrawPolygonPatrol = async () => {
@ -1515,10 +1642,10 @@
// 线
// 线
const handlerEditPolygonAirLine = async () => {
//
let takeoffArray = props.templateKmlConfig.missionConfig.takeOffRefPoint.split(',');
takeOffPointPosition.value = [
parseFloat(takeoffArray[1]),
parseFloat(takeoffArray[0]),

@ -21,12 +21,28 @@
<!-- 工作计划列表 -->
<div v-if="planListShow" style="width:360px;height: calc( 100vh - 144px);flex:1;">
<planList ref="planListRef" :planListShow="planListShow" @planDetail="planDetail" @createWorkPlan="toCreateWorkPlan" ></planList>
<planList ref="planListRef"
:planListShow="planListShow"
@planDetail="planDetail"
@createWorkPlan="toCreateWorkPlan"
></planList>
</div>
<!-- 创建计划 -->
<div v-if="workPlanFormShow" style="width:360px;height: calc( 100vh - 144px);flex:1;">
<createWorkPlan :workPlanStatus="workPlanStatus" :formData="formData" @successCreatePlan="successCreatePlan" @cancleCraete="cancleCraete" @selectAircraft="selectAircraft" @selectAriLine="selectAriLine" :checkedAriLine="checkedAriLine" :checkedDronePort="checkedDronePort" @intelligentPatrol="changePatrolShow" @startEditAirLine="startEditAirLine"></createWorkPlan>
<createWorkPlan
:workPlanStatus="workPlanStatus"
:formData="formData"
@successCreatePlan="successCreatePlan"
@cancleCraete="cancleCraete"
@selectAircraft="selectAircraft"
@selectAriLine="selectAriLine"
:checkedAriLine="checkedAriLine"
:checkedDronePort="checkedDronePort"
@intelligentPatrol="changePatrolShow"
@startEditAirLine="startEditAirLine"
@loadResultImageList="loadResultImageList"
></createWorkPlan>
</div>
<!-- 智能巡检 -->
<div v-if="patrolShow" class="patrol-box">
@ -77,17 +93,52 @@ import createWorkPlan from './components/createWorkPlan.vue';
import createAirLine from './components/createAirLine.vue'
import Map from './components/map.vue'
import AirPolygon from './components/airPolygon.vue';
import {getAirLine} from '@/api/sys/workplan';
import {getAirLine,uploadXmlFile,addAirLine,editAirLine} from '@/api/sys/workplan';
import { Patrol } from '../flightoperation/index';
import JSZip from 'jszip';
import axios from 'axios';
import { GeojsonToWkt, WktToGeojson } from '@/components/MapboxMaps/src/WktGeojsonTransform';
import { XMLParser, XMLBuilder } from 'fast-xml-parser';
import { message } from 'ant-design-vue';
import { useRoute } from 'vue-router'
const router = useRoute()
const paramValue = router.query.taskid
// 线
import Mapping2d from './lib/generateMapping2d';
const formData = ref({
"id": null,
"taskName": "",
"taskType": 0,
"taskAirLineName": null,
"taskDronePortName": null,
"taskDronePort": null,
"taskAirLine": null,
"returnAltitude": 90,
"lossOfControlAction": 1,
"continuationMode": 0,
"aiInspection": null,
"status": 0,
"periodicFormula": null,
"airLineId": null,
"createId": 0,
"createTime": "",
"waylinePrecisionType": 0,
"scheduledStartTime": "",
"scheduledEndTime": "",
"executeTime": "",
"completedTime": "",
"planExecuteDuration": 0,
"actualExecuteDuration": 0,
"workspaceId": null,
"expectedFileCount": 0,
"uploadedFileCount": 0,
"flightId": null,
"reason": null,
"externalTaskId": ""
});
const airLineForm = ref({
"id": null,
@ -181,7 +232,6 @@ const checkDronePort = (item)=>{
}
}
const formData = ref(null);
const toCreateWorkPlan = (data)=> {
formData.value = data;
@ -193,6 +243,10 @@ const toCreateWorkPlan = (data)=> {
}
}
const loadResultImageList = (imageLists) => {
console.log("loadResultImageList",imageLists)
}
// 线
const handlerCreateAirLine = ()=>{
createAirLineShow.value = true;
@ -232,8 +286,6 @@ const exitDraw = ()=>{
}
// 线
const wayline = ref({});
const waylineInfo = ref(null)
@ -248,12 +300,15 @@ const previewAirLine =async (line,type) => {
// 线 add edit detail
const editMode = ref("add");
// 线template.kml
const templateKmlConfig = ref({})
// 线wayline.wpml
const waylineWpmlConfig = ref({})
// 线
const startEditAirLine = (data,form,type) => {
// 线template.kml
@ -272,6 +327,9 @@ const startEditAirLine = (data,form,type) => {
const workPlanStatus = ref("");
// 线
const planDetail =async (item) => {
formData.value = item;
@ -326,12 +384,121 @@ const extractKmz = async (kmzBlob)=>{
throw new Error('KMZ文件中未找到WMPL文件');
}
// 线
const loadDefaultAirlineParams = async (info) => {
//
let coordinatesString = "";
if(info.geometry){
let geojson = WktToGeojson(info.geometry)
geojson.coordinates[0].pop();
let coordinatesArray = geojson.coordinates[0];
coordinatesArray?.forEach((item,index)=>{
if(index != coordinatesArray.length-1){
coordinatesString += item.join(",")+",70"+"\n"
}else{
coordinatesString += item.join(",")+",70"
}
})
}else{
message.warning("处理图斑数据失败!");
return null;
}
const {templateKml,waylineWpml} = await import("./waylineConfig/autoPlanMapping2dConfig.ts");
templateKmlConfig.value = templateKml;
templateKmlConfig.value.Folder.Placemark.Polygon.outerBoundaryIs.LinearRing.coordinates = coordinatesString;
waylineWpmlConfig.value = waylineWpml;
let mapping2d = new Mapping2d(templateKmlConfig.value,waylineWpmlConfig.value);
let blob = mapping2d.generateAirLine();
blob.then((blobData)=>{
workPlanStatus.value = "create"
let airLineForm = {
"id": null,
"airLineName": info.nember+"地块规划航线",
"airLineType": "mapping2d",
"uavId": null,
"flyToFirstPointMode": null,
"safeTakeoffAltitude": 0,
"safeTakeoffSpeed": 0,
"globalRouteSpeed": 0,
"taskCompletionAction": null,
"outOfControlOption": null,
"typeOfOutOfControlAction": null,
"globalWayPointType": null,
"ptzControlMode": null,
"aircraftYawAngleMode": null,
"createTime": null,
"wpml": null,
"taskOffLng": 0,
"taskOffLat": 0,
"folder": ""
}
// FormData
const fileFormData = new FormData();
fileFormData.append('xmlFile', blobData,"面状航线.kmz");
let res = uploadXmlFile(airLineForm.folder,fileFormData);
res.then(fileRes=>{
if(fileRes){
airLineForm.wpml = fileRes.path;
let addAirLineResult = addAirLine(airLineForm);
addAirLineResult.then(addAirLineRes=>{
formData.value.taskName = info.nember+"地块飞行任务"
formData.value.externalTaskId = info.taskid
formData.value.airLineId = addAirLineRes.id
formData.value.airLineId = addAirLineRes;
formData.value.taskAirLineName = info.nember+"地块规划航线"
})
}
})
})
}
onMounted(()=>{
let element = window.document.getElementsByClassName("mars3d-locationbar")[0] as HTMLElement;
element.style.bottom = '40px';
// id
if(router.query.taskid){
let autoPlanAirLienInfo = {
taskid:router.query.taskid,
nember:router.query.nember,
geometry:router.query.geometry,
}
// editMode.value = "autoAdd";
loadDefaultAirlineParams(autoPlanAirLienInfo);
}
})
</script>

@ -1,25 +1,906 @@
/**
* 线
* 线线
*
* template.jsonwayline.json
*
* kmz线Blob
*
*/
class Mapping2d {
import { XMLBuilder } from 'fast-xml-parser';
import JSZip from "jszip";
import { saveAs } from "file-saver";
import { calculateGsd,calculateSpacing,calculateInterval,uavModel } from './calculateAirLine'
export default class Mapping2d {
/**
*
*
*/
private templateKmlConfig;
private waylineWpmlConfig;
private gsd;
/**
*
*
*/
constructor(templateKmlConfig:Object,waylineWpmlConfig:Object){
this.templateKmlConfig = templateKmlConfig;
this.waylineWpmlConfig = waylineWpmlConfig;
}
/**
*
*/
generateAirLine(){
// 测区
let polygon = this.handlerCalculateParams();
// 根据航线文件中高度计算gsd
this.gsd = calculateGsd(this.templateKmlConfig.Folder.Placemark.height,uavModel['m4td']);
// 间距
let spacing = calculateSpacing(this.gsd,this.templateKmlConfig.Folder.Placemark.overlap.orthoCameraOverlapW/100,uavModel['m4td']);
// 初始化角度
let angle = this.templateKmlConfig.Folder.Placemark.direction ? this.templateKmlConfig.Folder.Placemark.direction : 0;
// 获取航点
let airPoints = this.generateScanLines(polygon,spacing/10000,angle);
// 获取文件
let blob = this.handlerWaylineWpmlConfig(airPoints);
return blob;
}
/**
* 线gsd
*
* gsd 线 线
*
*/
/**
*
*/
handlerCalculateParams(){
let coordinateArray =this.templateKmlConfig.Folder.Placemark.Polygon.outerBoundaryIs.LinearRing.coordinates.split('\n');
let geomtryCoorinate = [];
coordinateArray.forEach((item, index) => {
let trimStr = item.trim();
let arr = trimStr.split(',');
for (let i = 0; i < arr.length; i++) {
arr[i] = parseFloat(arr[i]);
}
geomtryCoorinate.push(arr);
});
geomtryCoorinate.push(geomtryCoorinate[0]);
let geometry = {
type: 'Polygon',
coordinates: [geomtryCoorinate],
};
console.log("geometry123",geometry)
return geometry;
}
/**
* 线
*/
generateScanLines(polygon, spacing, angle = 0) {
if (!turf.booleanValid(polygon)) throw new Error('无效的多边形');
spacing = Math.abs(spacing);
// 获取多边形的旋转边界框
const bbox = turf.bbox(polygon);
const center = turf.center(polygon).geometry.coordinates;
// 计算需要生成的线数量(加缓冲确保完全覆盖)
const diagLength = turf.distance(
turf.point([bbox[0], bbox[1]]),
turf.point([bbox[2], bbox[3]]),
);
const lineCount = Math.ceil(diagLength / spacing) + 2;
// 生成基础水平线
const lines = [];
for (let i = -1; i <= lineCount; i++) {
const y = bbox[1] + i * spacing * 0.11 - spacing * 0.11;
lines.push(
turf.lineString([
[bbox[0] - spacing, y],
[bbox[2] + spacing, y],
]),
);
}
// 旋转线条到指定角度
const rotatedLines = lines.map((line) =>
turf.transformRotate(line, angle - 90, { pivot: center }),
);
// 裁剪线条到多边形内并处理结果
const coverageLines = [];
rotatedLines.forEach((line) => {
try {
const intersection = turf.lineIntersect(line, polygon);
if (intersection.features.length >= 2) {
// 按与线起点距离排序交点
const sortedPoints = intersection.features
.map((f) => f.geometry.coordinates)
.sort(
(a, b) =>
turf.distance(line.geometry.coordinates[0], turf.point(a)) -
turf.distance(line.geometry.coordinates[0], turf.point(b)),
);
// 创建连接最远两个交点的线段
coverageLines.push(
turf.lineString([sortedPoints[0], sortedPoints[sortedPoints.length - 1]]),
);
}
} catch (e) {
console.warn('处理线段时出错:', e);
}
});
let connectedLine = this.connectLinesManual(turf.featureCollection(coverageLines));
// 将航点提取并添加到airPoints
let airPoints = [];
connectedLine.geometry.coordinates?.forEach((item, index) => {
let point = {
id: index,
lng: item[0],
lat: item[1],
alt: item[2],
aircraftHorizontalAngle: 0,
cameraHorizontalAngle: 0,
cameraVerticalAngle: 0,
focalLength: 1,
};
airPoints?.push(point);
});
// 倒数第2个点
let penultimatePoint = JSON.parse(JSON.stringify(airPoints[airPoints.length - 1]));
penultimatePoint.id = penultimatePoint.id + 1;
airPoints?.push(penultimatePoint);
// 添加测区中心点 最后1个点
// let turfPolygon = turf.polygon([polygonGeoJson.value]);
let polygonCenter = turf.centroid(polygon);
let lastPoint = {
id: airPoints[airPoints.length - 1].id + 1,
lng: polygonCenter.geometry.coordinates[0],
lat: polygonCenter.geometry.coordinates[1],
alt: airPoints[airPoints.length - 1].alt,
aircraftHorizontalAngle: 0,
cameraHorizontalAngle: 0,
cameraVerticalAngle: 0,
focalLength: 1,
};
airPoints?.push(lastPoint);
// 添加最后一个点到线数据中
connectedLine.geometry.coordinates.push([lastPoint.lng, lastPoint.lat, lastPoint.alt]);
// return connectedLine;
return airPoints;
}
/**
*
*
*/
connectLinesManual(lines){
// 确保输入是FeatureCollection
if (lines.type !== 'FeatureCollection') {
lines = turf.featureCollection([lines]);
}
// 收集所有坐标点
let allCoords = [];
lines.features.forEach((line, index) => {
// 相对起飞点高度
let relativeHeight = 120;
line.geometry.coordinates?.forEach((item, idx) => {
line.geometry.coordinates[idx].push(relativeHeight);
});
if (line.geometry.type === 'LineString' && index % 2 == 0) {
allCoords = allCoords.concat(line.geometry.coordinates.reverse());
} else {
allCoords = allCoords.concat(line.geometry.coordinates);
}
});
// 移除连续重复的点
const cleanedCoords = [];
if (allCoords.length > 0) {
cleanedCoords.push(allCoords[0]);
for (let i = 1; i < allCoords.length; i++) {
const prev = cleanedCoords[cleanedCoords.length - 1];
if (prev[0] !== allCoords[i][0] || prev[1] !== allCoords[i][1]) {
cleanedCoords.push(allCoords[i]);
}
}
}
return turf.lineString(cleanedCoords);
};
/**
* wayline.json
*/
async handlerWaylineWpmlConfig(airPoints:array){
this.waylineWpmlConfig.Folder.Placemark = [];
airPoints.forEach((item,index)=>{
let point = null;
// 根据高度模式 设置高度
let height = 0;
// 计算间隔时间
let spaceTime = (calculateInterval(this.gsd,this.templateKmlConfig.Folder.Placemark.overlap.orthoCameraOverlapH/100,uavModel['m4td']) / this.templateKmlConfig.Folder.autoFlightSpeed) * 2
// 起飞点高度
let heightArr = this.templateKmlConfig.missionConfig.takeOffRefPoint.split(",");
height = heightArr[2]
// 处理第1个航点
if(index == 0){
point = {
"Point": {
"coordinates":"\n"+item.lng+","+item.lat+"\n"
},
"index": item.id,
"executeHeight": this.templateKmlConfig.Folder.Placemark.height,
"waypointSpeed": this.templateKmlConfig.Folder.autoFlightSpeed,
"waypointHeadingParam": {
"waypointHeadingMode": "followWayline",
"waypointHeadingAngle": -96.9990577342362,
"waypointPoiPoint": "0.000000,0.000000,0.000000",
"waypointHeadingAngleEnable": 1,
"waypointHeadingPathMode": "followBadArc",
"waypointHeadingPoiIndex": 0
},
"waypointTurnParam": {
"waypointTurnMode": "toPointAndStopWithDiscontinuityCurvature",
"waypointTurnDampingDist": 0
},
"useStraightLine": 1,
"actionGroup": [
{
"actionGroupId": 0,
"actionGroupStartIndex": item.id,
"actionGroupEndIndex": airPoints.length - 2,
"actionGroupMode": "sequence",
"actionTrigger": {
"actionTriggerType": "betweenAdjacentPoints"
},
"action": [
{
"actionId": 0,
"actionActuatorFunc": "gimbalAngleLock"
},
{
"actionId": 1,
"actionActuatorFunc": "gimbalRotate",
"actionActuatorFuncParam": {
"gimbalHeadingYawBase": "aircraft",
"gimbalRotateMode": "absoluteAngle",
"gimbalPitchRotateEnable": 1,
"gimbalPitchRotateAngle": -90,
"gimbalRollRotateEnable": 0,
"gimbalRollRotateAngle": 0,
"gimbalYawRotateEnable": 0,
"gimbalYawRotateAngle": 0,
"gimbalRotateTimeEnable": 0,
"gimbalRotateTime": 10,
"payloadPositionIndex": 0
}
},
{
"actionId": 2,
"actionActuatorFunc": "startTimeLapse",
"actionActuatorFuncParam": {
"payloadPositionIndex": 0,
"useGlobalPayloadLensIndex": 0,
"payloadLensIndex": "visable",
"minShootInterval":spaceTime
}
}
]
},
{
"actionGroupId": 1,
"actionGroupStartIndex": item.id,
"actionGroupEndIndex": airPoints.length - 2,
"actionGroupMode": "sequence",
"actionTrigger": {
"actionTriggerType": "multipleTiming",
"actionTriggerParam": 2
},
"action": {
"actionId": 0,
"actionActuatorFunc": "gimbalRotate",
"actionActuatorFuncParam": {
"gimbalHeadingYawBase": "aircraft",
"gimbalRotateMode": "absoluteAngle",
"gimbalPitchRotateEnable": 1,
"gimbalPitchRotateAngle": -90,
"gimbalRollRotateEnable": 0,
"gimbalRollRotateAngle": 0,
"gimbalYawRotateEnable": 0,
"gimbalYawRotateAngle": 0,
"gimbalRotateTimeEnable": 0,
"gimbalRotateTime": 10,
"payloadPositionIndex": 0
}
}
}
],
"waypointGimbalHeadingParam": {
"waypointGimbalPitchAngle": 0,
"waypointGimbalYawAngle": 0
},
"isRisky": 0,
"waypointWorkType": 0
}
}else if(index == airPoints.length -1){ // 处理最后1个航点
point = {
"Point": {
"coordinates":"\n"+item.lng+","+item.lat +"\n"
},
"index": item.id,
"executeHeight": this.templateKmlConfig.Folder.Placemark.height,
"waypointSpeed": this.templateKmlConfig.Folder.autoFlightSpeed,
"waypointHeadingParam": {
"waypointHeadingMode": "followWayline",
"waypointHeadingAngle": 0,
"waypointPoiPoint": "0.000000,0.000000,0.000000",
"waypointHeadingAngleEnable": 0,
"waypointHeadingPathMode": "followBadArc",
"waypointHeadingPoiIndex": 0
},
"waypointTurnParam": {
"waypointTurnMode": "toPointAndStopWithDiscontinuityCurvature",
"waypointTurnDampingDist": 0
},
"useStraightLine": 1,
"actionGroup": {
"actionGroupId": 6,
"actionGroupStartIndex": item.id,
"actionGroupEndIndex": item.id,
"actionGroupMode": "sequence",
"actionTrigger": {
"actionTriggerType": "reachPoint"
},
"action": [
{
"actionId": 0,
"actionActuatorFunc": "stopTimeLapse",
"actionActuatorFuncParam": {
"payloadPositionIndex": 0,
"payloadLensIndex": "visable"
}
},
{
"actionId": 1,
"actionActuatorFunc": "gimbalAngleUnlock"
}
]
},
"waypointGimbalHeadingParam": {
"waypointGimbalPitchAngle": 0,
"waypointGimbalYawAngle": 0
},
"isRisky": 0,
"waypointWorkType": 0
}
}else if(index == airPoints.length -2){ // 处理倒数第2个航点
point = {
"Point": {
"coordinates":"\n"+ (item.lng+0.00001)+","+(item.lat+0.00001)+"\n"
},
"index": item.id,
"executeHeight": this.templateKmlConfig.Folder.Placemark.height,
"waypointSpeed": this.templateKmlConfig.Folder.autoFlightSpeed,
"waypointHeadingParam": {
"waypointHeadingMode": "followWayline",
"waypointHeadingAngle": -120.875268753987,
"waypointPoiPoint": "0.000000,0.000000,0.000000",
"waypointHeadingAngleEnable": 1,
"waypointHeadingPathMode": "followBadArc",
"waypointHeadingPoiIndex": 0
},
"waypointTurnParam": {
"waypointTurnMode": "toPointAndStopWithDiscontinuityCurvature",
"waypointTurnDampingDist": 0
},
"useStraightLine": 1,
"actionGroup": [
{
"actionGroupId": 3,
"actionGroupStartIndex": item.id,
"actionGroupEndIndex": item.id,
"actionGroupMode": "sequence",
"actionTrigger": {
"actionTriggerType": "reachPoint"
},
"action": [
{
"actionId": 0,
"actionActuatorFunc": "gimbalRotate",
"actionActuatorFuncParam": {
"gimbalHeadingYawBase": "aircraft",
"gimbalRotateMode": "absoluteAngle",
"gimbalPitchRotateEnable": 1,
"gimbalPitchRotateAngle": -45,
"gimbalRollRotateEnable": 0,
"gimbalRollRotateAngle": 0,
"gimbalYawRotateEnable": 1,
"gimbalYawRotateAngle": 0,
"gimbalRotateTimeEnable": 0,
"gimbalRotateTime": 10,
"payloadPositionIndex": 0
}
},
{
"actionId": 1,
"actionActuatorFunc": "hover",
"actionActuatorFuncParam": {
"hoverTime": 0.5
}
}
]
},
{
"actionGroupId": 4,
"actionGroupStartIndex": item.id,
"actionGroupEndIndex": item.id+1,
"actionGroupMode": "sequence",
"actionTrigger": {
"actionTriggerType": "multipleTiming",
"actionTriggerParam": 2
},
"action": {
"actionId": 0,
"actionActuatorFunc": "gimbalRotate",
"actionActuatorFuncParam": {
"gimbalHeadingYawBase": "aircraft",
"gimbalRotateMode": "absoluteAngle",
"gimbalPitchRotateEnable": 1,
"gimbalPitchRotateAngle": -45,
"gimbalRollRotateEnable": 0,
"gimbalRollRotateAngle": 0,
"gimbalYawRotateEnable": 0,
"gimbalYawRotateAngle": 0,
"gimbalRotateTimeEnable": 0,
"gimbalRotateTime": 10,
"payloadPositionIndex": 0
}
}
},
{
"actionGroupId": 5,
"actionGroupStartIndex": item.id,
"actionGroupEndIndex": item.id+1,
"actionGroupMode": "sequence",
"actionTrigger": {
"actionTriggerType": "betweenAdjacentPoints"
},
"action": [
{
"actionId": 0,
"actionActuatorFunc": "gimbalAngleLock"
},
{
"actionId": 1,
"actionActuatorFunc": "gimbalRotate",
"actionActuatorFuncParam": {
"gimbalHeadingYawBase": "aircraft",
"gimbalRotateMode": "absoluteAngle",
"gimbalPitchRotateEnable": 1,
"gimbalPitchRotateAngle": -45,
"gimbalRollRotateEnable": 0,
"gimbalRollRotateAngle": 0,
"gimbalYawRotateEnable": 0,
"gimbalYawRotateAngle": 0,
"gimbalRotateTimeEnable": 0,
"gimbalRotateTime": 10,
"payloadPositionIndex": 0
}
},
{
"actionId": 2,
"actionActuatorFunc": "startTimeLapse",
"actionActuatorFuncParam": {
"payloadPositionIndex": 0,
"useGlobalPayloadLensIndex": 0,
"payloadLensIndex": "visable",
"minShootInterval": spaceTime
}
}
]
}
],
"waypointGimbalHeadingParam": {
"waypointGimbalPitchAngle": 0,
"waypointGimbalYawAngle": 0
},
"isRisky": 0,
"waypointWorkType": 0
};
let point2 = {
"Point": {
"coordinates":(item.lng+0.00001)+","+(item.lat+0.00001)
},
"index": item.id,
"executeHeight": this.templateKmlConfig.Folder.Placemark.height,
"waypointSpeed": this.templateKmlConfig.Folder.autoFlightSpeed,
"waypointHeadingParam": {
"waypointHeadingMode": "followWayline",
"waypointHeadingAngle": -44.6751949389683,
"waypointPoiPoint": "0.000000,0.000000,0.000000",
"waypointHeadingAngleEnable": 1,
"waypointHeadingPathMode": "followBadArc",
"waypointHeadingPoiIndex": 0
},
"waypointTurnParam": {
"waypointTurnMode": "toPointAndStopWithDiscontinuityCurvature",
"waypointTurnDampingDist": 0
},
"useStraightLine": 1,
"actionGroup": [
{
"actionGroupId": 3,
"actionGroupStartIndex": item.id,
"actionGroupEndIndex": item.id,
"actionGroupMode": "sequence",
"actionTrigger": {
"actionTriggerType": "reachPoint"
},
"action": [
{
"actionId": 0,
"actionActuatorFunc": "gimbalRotate",
"actionActuatorFuncParam": {
"gimbalHeadingYawBase": "aircraft",
"gimbalRotateMode": "absoluteAngle",
"gimbalPitchRotateEnable": 1,
"gimbalPitchRotateAngle": -45,
"gimbalRollRotateEnable": 0,
"gimbalRollRotateAngle": 0,
"gimbalYawRotateEnable": 1,
"gimbalYawRotateAngle": 0,
"gimbalRotateTimeEnable": 0,
"gimbalRotateTime": 10,
"payloadPositionIndex": 0
}
},
{
"actionId": 1,
"actionActuatorFunc": "hover",
"actionActuatorFuncParam": {
"hoverTime": 0.5
}
}
]
},
{
"actionGroupId": 4,
"actionGroupStartIndex": item.id,
"actionGroupEndIndex": item.id+1,
"actionGroupMode": "sequence",
"actionTrigger": {
"actionTriggerType": "multipleTiming",
"actionTriggerParam": 2
},
"action": {
"actionId": 0,
"actionActuatorFunc": "gimbalRotate",
"actionActuatorFuncParam": {
"gimbalHeadingYawBase": "aircraft",
"gimbalRotateMode": "absoluteAngle",
"gimbalPitchRotateEnable": 1,
"gimbalPitchRotateAngle": -45,
"gimbalRollRotateEnable": 0,
"gimbalRollRotateAngle": 0,
"gimbalYawRotateEnable": 0,
"gimbalYawRotateAngle": 0,
"gimbalRotateTimeEnable": 0,
"gimbalRotateTime": 10,
"payloadPositionIndex": 0
}
}
},
{
"actionGroupId":5,
"actionGroupStartIndex": item.id,
"actionGroupEndIndex": item.id+1,
"actionGroupMode": "sequence",
"actionTrigger": {
"actionTriggerType": "betweenAdjacentPoints"
},
"action": [
{
"actionId": 0,
"actionActuatorFunc": "gimbalAngleLock"
},
{
"actionId": 1,
"actionActuatorFunc": "gimbalRotate",
"actionActuatorFuncParam": {
"gimbalHeadingYawBase": "aircraft",
"gimbalRotateMode": "absoluteAngle",
"gimbalPitchRotateEnable": 1,
"gimbalPitchRotateAngle": -45,
"gimbalRollRotateEnable": 0,
"gimbalRollRotateAngle": 0,
"gimbalYawRotateEnable": 0,
"gimbalYawRotateAngle": 0,
"gimbalRotateTimeEnable": 0,
"gimbalRotateTime": 10,
"payloadPositionIndex": 0
}
},
{
"actionId": 2,
"actionActuatorFunc": "startTimeLapse",
"actionActuatorFuncParam": {
"payloadPositionIndex": 0,
"useGlobalPayloadLensIndex": 0,
"payloadLensIndex": "visable",
"minShootInterval": spaceTime
}
}
]
},
],
"waypointGimbalHeadingParam": {
"waypointGimbalPitchAngle": 0,
"waypointGimbalYawAngle": 0
},
"isRisky": 0,
"waypointWorkType": 0
}
}else if(index == airPoints.length -3){
point = {
"Point": {
"coordinates":"\n"+item.lng+","+item.lat+"\n"
},
"index": item.id,
"executeHeight": this.templateKmlConfig.Folder.Placemark.height,
"waypointSpeed": this.templateKmlConfig.Folder.autoFlightSpeed,
"waypointHeadingParam": {
"waypointHeadingMode": "followWayline",
"waypointHeadingAngle": -90.9999957673264,
"waypointPoiPoint": "0.000000,0.000000,0.000000",
"waypointHeadingAngleEnable": 1,
"waypointHeadingPathMode": "followBadArc",
"waypointHeadingPoiIndex": 0
},
"waypointTurnParam": {
"waypointTurnMode": "toPointAndStopWithDiscontinuityCurvature",
"waypointTurnDampingDist": 0
},
"useStraightLine": 1,
"actionGroup": {
"actionGroupId": 2,
"actionGroupStartIndex": item.id,
"actionGroupEndIndex": item.id,
"actionGroupMode": "sequence",
"actionTrigger": {
"actionTriggerType": "reachPoint"
},
"action": [
{
"actionId": 0,
"actionActuatorFunc": "stopTimeLapse",
"actionActuatorFuncParam": {
"payloadPositionIndex": 0,
"payloadLensIndex": "visable"
}
},
{
"actionId": 1,
"actionActuatorFunc": "gimbalAngleUnlock"
}
]
},
"waypointGimbalHeadingParam": {
"waypointGimbalPitchAngle": 0,
"waypointGimbalYawAngle": 0
},
"isRisky": 0,
"waypointWorkType": 0
}
}else{ // 处理中间航点
point = {
"Point": {
"coordinates":"\n"+item.lng+","+item.lat+"\n"
},
"index": item.id,
"executeHeight": this.templateKmlConfig.Folder.Placemark.height,
"waypointSpeed": this.templateKmlConfig.Folder.autoFlightSpeed,
"waypointHeadingParam": {
"waypointHeadingMode": "followWayline",
"waypointHeadingAngle": -96.9993404112147,
"waypointPoiPoint": "0.000000,0.000000,0.000000",
"waypointHeadingAngleEnable": 1,
"waypointHeadingPathMode": "followBadArc",
"waypointHeadingPoiIndex": 0
},
"waypointTurnParam": {
"waypointTurnMode": "coordinateTurn",
"waypointTurnDampingDist": 10
},
"useStraightLine": 1,
"waypointGimbalHeadingParam": {
"waypointGimbalPitchAngle": 0,
"waypointGimbalYawAngle": 0
},
"isRisky": 0,
"waypointWorkType": 0
}
}
this.waylineWpmlConfig.Folder.Placemark.push(point);
})
return await this.generateKmzFile();
}
/**
* kmz线
*/
async generateKmzFile(){
// 将template中的 missionConfig 赋值 给wayline
this.waylineWpmlConfig.missionConfig = JSON.parse(JSON.stringify(this.templateKmlConfig.missionConfig))
const builder = new XMLBuilder({
format: true, // 启用换行和缩进
indentBy: " ", // 缩进字符默认2空格可自定义为 \t 等)
suppressEmptyNode: true, // 可选:是否忽略空节点
});
// 带wpml前缀的 template json数据
let templateJson = {kml:{Document:this.templateKmlConfig}}
let templateWpmlJson = this.handlerPrefixWpml(templateJson);
let templateXmlStr = builder.build(templateWpmlJson);
let templateXmlStrTemp = templateXmlStr.replace(/<\/?\d+>/g, "")
let templateXml = templateXmlStrTemp.replace("<kml>",`<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://www.opengis.net/kml/2.2" xmlns:wpml="http://www.dji.com/wpmz/1.0.6">`)
let waylineJosn = {kml:{Document:this.waylineWpmlConfig}}
let waylienWpmlJson = this.handlerPrefixWpml(waylineJosn);
let waylineXmlStr = builder.build(waylienWpmlJson);
let waylineXmlStrTemp = waylineXmlStr.replace(/<\/?\d+>/g, "")
let waylineXml = waylineXmlStrTemp.replace("<kml>",`<?xml version="1.0" encoding="UTF-8"?><kml xmlns="http://www.opengis.net/kml/2.2" xmlns:wpml="http://www.dji.com/wpmz/1.0.6">`)
// 创建压缩文件
return await this.handlerCreateFile(templateXml,waylineXml);
}
/**
*
*/
handlerPrefixWpml(obj){
for (const key in obj) {
if (typeof obj[key] === 'object' && obj[key] !== null && !Array.isArray(obj[key])) { // 如果是对象
this.handlerPrefixWpml(obj[key]); // 递归处理嵌套对象
const newAttrs = {};
for (const attrName in obj[key] ) {
// 检查属性名是否首字母小写
if (/^[a-z]/.test(attrName) && attrName != 'outerBoundaryIs' && attrName != 'coordinates') {
newAttrs[`wpml:${attrName}`] = obj[key][attrName];
} else {
newAttrs[attrName] = obj[key][attrName];
}
}
obj[key] = newAttrs;
}else if(typeof obj[key] === 'object' && obj[key] !== null && Array.isArray(obj[key])){ // 如果是数组
this.handlerPrefixWpml(obj[key]); // 递归处理嵌套对象
const newAttrs = [];
for (const attrName in obj[key]) {
// 检查属性名是否首字母小写
if (/^[a-z]/.test(attrName)) {
newAttrs[`wpml:${attrName}`] = obj[key][attrName];
} else {
newAttrs[attrName] = obj[key][attrName];
}
}
obj[key] = newAttrs;
}
}
return obj;
}
/**
*
*/
async handlerCreateFile(templateXml,waylineXml){
const blob = await this.convertXmlToKmz(templateXml,waylineXml);
return blob;
}
/**
* xml kmlwpml
*/
async convertXmlToKmz(templateXml,waylineXml){
}
const zip = new JSZip();
// 1. 创建 "wmpz" 文件夹
const wmpzFolder = zip.folder("wpmz");
// 2. 向文件夹中添加文件
wmpzFolder.file("waylines.wpml", waylineXml);
wmpzFolder.file("template.kml", templateXml);
// 3. 生成 KMZ (ZIP) 文件
const kmzBlob = await zip.generateAsync({ type: "blob" });
// 下载航线文件
saveAs(kmzBlob, "output.kmz");
return kmzBlob;
}
export { Mapping2d }
}

@ -152,7 +152,6 @@ export const airPointActions = {
}
}
},
"startRecord":{ // 开始录像
"name":"开始录像",
"value":"startRecord",
@ -167,7 +166,6 @@ export const airPointActions = {
}
}
},
"stopRecord":{ // 结束录像
"name":"结束录像",
"value":"stopRecord",
@ -180,8 +178,6 @@ export const airPointActions = {
}
}
},
"multipleTiming":{ // 开始等时间间隔拍照
"name":"开始等时间间隔拍照",
"value":"multipleTiming",
@ -206,7 +202,6 @@ export const airPointActions = {
}
}
},
"multipleDistance":{ // 开始等距离间隔拍照
"name":"开始等距离间隔拍照",
"value":"multipleDistance",
@ -231,7 +226,6 @@ export const airPointActions = {
}
}
},
"multipleStop":{
"name":"停止间隔拍照",
"value":"multipleStop",

@ -0,0 +1,258 @@
// 面状航线默认template.kml数据
export const templateKml123 = {
"author": 17861857725,
"createTime": 1749689844431,
"updateTime": 1753241338101,
"missionConfig": {
"flyToWaylineMode": "pointToPoint",
"finishAction": "goHome",
"exitOnRCLost": "goContinue",
"executeRCLostAction": "goBack",
"takeOffSecurityHeight": 20,
"takeOffRefPoint": "35.134383,118.302109,74.787731",
"takeOffRefPointAGLHeight": 4.169064385,
"globalTransitionalSpeed": 15,
"globalRTHHeight": 100,
"droneInfo": {
"droneEnumValue": 100,
"droneSubEnumValue": 1
},
"autoRerouteInfo": {
"transitionalAutoRerouteMode": 1,
"missionAutoRerouteMode": 1
},
"waylineAvoidLimitAreaMode": 0,
"payloadInfo": {
"payloadEnumValue": 99,
"payloadSubEnumValue": 0,
"payloadPositionIndex": 0
}
},
"Folder": {
"templateType": "mapping2d",
"templateId": 0,
"overlapRate":{
"lateral":70,
"heading":80
},
"waylineCoordinateSysParam": {
"coordinateMode": "WGS84",
"heightMode": "EGM96",
"globalShootHeight": 90,
"surfaceFollowModeEnable": 1,
"isRealtimeSurfaceFollow": 0,
"surfaceRelativeHeight": 90,
"dsmFile": "wpmz/res/dsm/wgs84_ASTGTMV003_N35E118_dem_7.tif"
},
"autoFlightSpeed": 12.7,
"Placemark": {
"caliFlightEnable": 0,
"elevationOptimizeEnable": 1,
"smartObliqueEnable": 0,
"quickOrthoMappingEnable": 0,
"facadeWaylineEnable": 0,
"isLookAtSceneSet": 0,
"shootType": "time",
"direction": 0,
"margin": 0,
"efficiencyFlightModeEnable": 0,
"overlap": {
"orthoCameraOverlapH": 80,
"orthoCameraOverlapW": 70,
"inclinedCameraOverlapH": 80,
"inclinedCameraOverlapW": 70
},
"Polygon": {
"outerBoundaryIs": {
"LinearRing": {
"coordinates": "118.295025 35.135105,0\n 118.296057 35.135105,0\n 118.295971 35.134423,0\n 118.295054 35.134485,0"
}
}
},
"ellipsoidHeight": 56.20,
"height": 56.20
},
"payloadParam": {
"payloadPositionIndex": 0,
"focusMode": "firstPoint",
"meteringMode": "average",
"returnMode": "singleReturnStrongest",
"samplingRate": 240000,
"scanningMode": "repetitive",
"imageFormat": "visable",
"photoSize": ""
}
}
}
export const templateKml = {
"author": 17861857725,
"createTime": 1755572150708,
"updateTime": 1755572150708,
"missionConfig": {
"flyToWaylineMode": "pointToPoint",
"finishAction": "goHome",
"exitOnRCLost": "goContinue",
"executeRCLostAction": "goBack",
"takeOffSecurityHeight": 20,
"takeOffRefPoint": "35.134588,118.296655,69.9",
"takeOffRefPointAGLHeight": 4.169064385,
"globalTransitionalSpeed": 15,
"globalRTHHeight": 100,
"droneInfo": {
"droneEnumValue": 100,
"droneSubEnumValue": 1
},
"autoRerouteInfo": {
"transitionalAutoRerouteMode": 1,
"missionAutoRerouteMode": 1
},
"waylineAvoidLimitAreaMode": 0,
"payloadInfo": {
"payloadEnumValue": 99,
"payloadSubEnumValue": 0,
"payloadPositionIndex": 0
}
},
"Folder": {
"templateType": "mapping2d",
"templateId": 0,
"waylineCoordinateSysParam": {
"coordinateMode": "WGS84",
"heightMode": "relativeToStartPoint",
"globalShootHeight": 90
},
"autoFlightSpeed": 12.7,
"Placemark": {
"caliFlightEnable": 0,
"elevationOptimizeEnable": 1,
"smartObliqueEnable": 0,
"quickOrthoMappingEnable": 0,
"facadeWaylineEnable": 0,
"isLookAtSceneSet": 0,
"shootType": "time",
"direction": 0,
"margin": 0,
"efficiencyFlightModeEnable": 0,
"overlap": {
"orthoCameraOverlapH": 80,
"orthoCameraOverlapW": 70,
"inclinedCameraOverlapH": 80,
"inclinedCameraOverlapW": 70
},
"Polygon": {
"outerBoundaryIs": {
"LinearRing": {
"coordinates": "118.295025,35.135105,69.2\n 118.296057,35.135105,70.8\n 118.295971,35.134423,71.6\n 118.295054,35.134485,70.1"
}
}
},
"ellipsoidHeight": 56.20,
"height": 56.20
},
"payloadParam": {
"payloadPositionIndex": 0,
"focusMode": "firstPoint",
"meteringMode": "average",
"returnMode": "singleReturnStrongest",
"samplingRate": 240000,
"scanningMode": "repetitive",
"imageFormat": "visable",
"photoSize": ""
}
}
}
// 面状航线默认wayline.wpml数据
export const waylineWpml = {
"missionConfig": {
"flyToWaylineMode": "pointToPoint",
"finishAction": "goHome",
"exitOnRCLost": "goContinue",
"executeRCLostAction": "goBack",
"takeOffSecurityHeight": 20,
"globalTransitionalSpeed": 15,
"globalRTHHeight": 100,
"droneInfo": {
"droneEnumValue": 100,
"droneSubEnumValue": 1
},
"autoRerouteInfo": {
"transitionalAutoRerouteMode": 1,
"missionAutoRerouteMode": 1
},
"waylineAvoidLimitAreaMode": 0,
"payloadInfo": {
"payloadEnumValue": 99,
"payloadSubEnumValue": 0,
"payloadPositionIndex": 0
}
},
"Folder": {
"templateId": 0,
"executeHeightMode": "relativeToStartPoint",
"waylineId": 0,
"distance": 1259.17163085938,
"duration": 145.652896165848,
"autoFlightSpeed": 12.7,
"startActionGroup": {
"action": [
{
"actionId": 0,
"actionActuatorFunc": "gimbalRotate",
"actionActuatorFuncParam": {
"gimbalHeadingYawBase": "aircraft",
"gimbalRotateMode": "absoluteAngle",
"gimbalPitchRotateEnable": 1,
"gimbalPitchRotateAngle": -90,
"gimbalRollRotateEnable": 0,
"gimbalRollRotateAngle": 0,
"gimbalYawRotateEnable": 1,
"gimbalYawRotateAngle": 0,
"gimbalRotateTimeEnable": 0,
"gimbalRotateTime": 10,
"payloadPositionIndex": 0
}
},
{
"actionId": 1,
"actionActuatorFunc": "hover",
"actionActuatorFuncParam": {
"hoverTime": 0.5
}
},
{
"actionId": 2,
"actionActuatorFunc": "setFocusType",
"actionActuatorFuncParam": {
"cameraFocusType": "manual",
"payloadPositionIndex": 0
}
},
{
"actionId": 3,
"actionActuatorFunc": "focus",
"actionActuatorFuncParam": {
"focusX": 0,
"focusY": 0,
"focusRegionWidth": 0,
"focusRegionHeight": 0,
"isPointFocus": 0,
"isInfiniteFocus": 1,
"payloadPositionIndex": 0,
"isCalibrationFocus": 0
}
},
{
"actionId": 4,
"actionActuatorFunc": "hover",
"actionActuatorFuncParam": {
"hoverTime": 1
}
}
]
},
"Placemark": []
}
}
Loading…
Cancel
Save