当前位置:网站首页>How to obtain the coordinates of the aircraft passing through both ends of the radar
How to obtain the coordinates of the aircraft passing through both ends of the radar
2022-07-05 18:13:00 【supermapsupport】
xkf
First, let's talk about the general implementation steps :
- Create a radar scanned entity and define the route of the aircraft ;
- Use the interface of intervisibility analysis to find the position coordinates of the aircraft entering and exiting the radar detection range ;
- Use coordinates to build line entities , The radar range is red , Green outside the range .
1. Create a radar scanned entity and define the route of the aircraft
First, create a radar scanning entity , Add radar entities by adding entities .
The main codes are as follows :
let sensorEntity = viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(116.45093826887725, 39.90558654617389, 14.3030),
rectangularSensor: new Cesium.RectangularSensorGraphics({
radius: new Cesium.CallbackProperty(function () {
return +self.radius;
}, false),
slice: 120,// Degree of segmentation
xHalfAngle: new Cesium.CallbackProperty(function () {
return Cesium.Math.toRadians(self.xHalfAngle);
}, false),// Angle between left and right
yHalfAngle: new Cesium.CallbackProperty(function () {
return Cesium.Math.toRadians(self.yHalfAngle);
}, false),// Angle between top and bottom
lineColor: new Cesium.CallbackProperty(function () {
return Cesium.Color.fromCssColorString(self.lineColor);
}, false),// Line color
material: new Cesium.Color(0.0, 1.0, 1.0, 1),// Uniform material
showScanPlane: new Cesium.CallbackProperty(function () {
return self.scanPlane;
}, false),// Display scanning surface
scanPlaneColor: new Cesium.CallbackProperty(function () {
return Cesium.Color.fromCssColorString(self.scanPlaneColor);
}, false),// Scanning surface color
scanPlaneMode: new Cesium.CallbackProperty(function () {
return self.scanPlaneMode ? 'vertical' : 'horizontal';
}, false),// Vertical scan mode
scanPlaneRate: new Cesium.CallbackProperty(function () {
return self.scanPlaneRate;
}, false),// Scanning rate
showIntersection: true,// Whether to display the scanning line with the earth
showThroughEllipsoid: false// Whether to cross the Earth shows
})
});
Then create an aircraft flight path , Let the plane fly along the line . It uses the clock function to make the aircraft fly along the line .
Main code :
// The plane flew along the line
var startTime = Cesium.JulianDate.fromDate(new Date(2019, 2, 25, 16));
var startPosition = Cesium.Cartesian3.fromDegrees(116.47326309033961, 39.90512322998635, 600);
var endTime = Cesium.JulianDate.addSeconds(startTime, 1000, new Cesium.JulianDate());
var endPosition = Cesium.Cartesian3.fromDegrees(116.4189181104128, 39.903026132659456, 600);
viewer.clock.startTime = startTime.clone();
viewer.clock.stopTime = endTime.clone();
viewer.clock.currentTime = startTime.clone();
viewer.clock.clockRange = Cesium.ClockRange.LOOP_STOP; //Loop at the end
viewer.clock.multiplier = 10;
viewer.timeline.zoomTo(startTime, endTime);
var carPositionProperty = new Cesium.SampledPositionProperty();
carPositionProperty.addSample(startTime, startPosition);
carPositionProperty.addSample(endTime, endPosition);
var carPosition = carPositionProperty.getValue(viewer.clock.currentTime);
var heading = Cesium.Math.toRadians(-3);
var pitch = 0;
var roll = 0;
var hpr = new Cesium.HeadingPitchRoll(heading, pitch, roll);
var orientation = Cesium.Transforms.headingPitchRollQuaternion(carPosition, hpr);
var carModel = viewer.entities.add({
name: "gltf",
position: new Cesium.CallbackProperty(function () {
return carPosition;
}, false),
orientation: orientation,
model: {
uri: "./SampleData/gltf/ The airliner model / The airliner model .gltf",
scale: 60
},
viewFrom: new Cesium.Cartesian3(35, 70, 30)
});
viewer.clock.onTick.addEventListener(function () {
var currentTime = Cesium.JulianDate.clone(viewer.clock.currentTime);
carPosition = carPositionProperty.getValue(currentTime);
});
2. Use the interface of intervisibility analysis to find the position coordinates of the aircraft entering and exiting the radar detection range
Use intervisibility analysis to analyze from the takeoff point to the end point to obtain the coordinates of the first obstacle point close to the takeoff point ; Then, the intervisibility analysis is carried out in turn to obtain the coordinates of the second obstacle point away from the takeoff point :
Main code :
// Coordinates of aircraft take-off end position :
takeOffposition = [116.47326309033961, 39.90512322998635, 560]
finishposition = [116.4189181104128, 39.903026132659456, 560]
setTimeout(function () {
// Intervisibility analysis to judge the point position .
sightline.build();
sightline.lineWidth = 3
// Set observation point
sightline.viewPosition = takeOffposition;
// Set the target point
var flag = sightline.addTargetPoint({
position: finishposition,
name: "point0"
});
}, 200)
// The method of obtaining the obstacle points delays the operation , Because intervisibility analysis takes time
setTimeout(function () {
sightline.getBarrierPoint("point0", function (e) {
positions.fisrtObstacle = e.position
})
// Clear the first intervisibility analysis result .
sightline.removeAllTargetPoint();
sightline.viewPosition = finishposition;
var flag1 = sightline.addTargetPoint({
position: takeOffposition,
name: "point1"
});
}, 300)
setTimeout(function () {
sightline.getBarrierPoint("point1", function (e) {
positions.secondObstacle = e.position
})
sightline.removeAllTargetPoint();
}, 380)
3. Use coordinates to build line entities , The radar range is red , Green outside the range .
This is relatively simple and directly attached with code :
// End position to the second entity out of radar range
viewer.entities.add({
id: "test1",
polyline: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights([positions.secondObstacle.longitude * (180 / Math.PI), positions.secondObstacle.latitude * (180 / Math.PI), positions.secondObstacle.height, finishposition[0], finishposition[1], finishposition[2]]),
width: 4.0,
material: Cesium.Color.GREEN.withAlpha(0.9),
depthFailMaterial: Cesium.Color.GREEN.withAlpha(0.9)
}
});
// Start position to enter the radar range entity
viewer.entities.add({
id: "test2",
polyline: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights([positions.fisrtObstacle.longitude * (180 / Math.PI), positions.fisrtObstacle.latitude * (180 / Math.PI), positions.fisrtObstacle.height, takeOffposition[0], takeOffposition[1], takeOffposition[2]]),
width: 4.0,
material: Cesium.Color.GREEN.withAlpha(0.9),
depthFailMaterial: Cesium.Color.GREEN.withAlpha(0.9)
}
});
// Construct a line entity found between two points
viewer.entities.add({
id: "test3",
polyline: {
positions: Cesium.Cartesian3.fromDegreesArrayHeights([positions.secondObstacle.longitude * (180 / Math.PI), positions.secondObstacle.latitude * (180 / Math.PI), positions.secondObstacle.height, positions.fisrtObstacle.longitude * (180 / Math.PI), positions.fisrtObstacle.latitude * (180 / Math.PI), positions.fisrtObstacle.height]),
width: 4.0,
material: Cesium.Color.RED.withAlpha(0.9),
depthFailMaterial: Cesium.Color.RED.withAlpha(0.9)
}
});
The end result is as follows :
边栏推荐
- Le cours d'apprentissage de la machine 2022 de l'équipe Wunda arrive.
- OpenShift常用管理命令杂记
- 从类生成XML架构
- What are the requirements for PMP certification? How much is it?
- 彻底理解为什么网络 I/O 会被阻塞?
- 【pm2详解】
- 破解湖+仓混合架构顽疾,星环科技推出自主可控云原生湖仓一体平台
- Access the database and use redis as the cache of MySQL (a combination of redis and MySQL)
- Notes on common management commands of openshift
- 星环科技重磅推出数据要素流通平台Transwarp Navier,助力企业实现隐私保护下的数据安全流通与协作
猜你喜欢
Let more young people from Hong Kong and Macao know about Nansha's characteristic cultural and creative products! "Nansha kylin" officially appeared
Tupu software digital twin | visual management system based on BIM Technology
Elk log analysis system
Isprs2022 / Cloud Detection: Cloud Detection with Boundary nets Boundary Networks Based Cloud Detection
buuctf-pwn write-ups (9)
记录Pytorch中的eval()和no_grad()
RSE2020/云检测:基于弱监督深度学习的高分辨率遥感图像精确云检测
Privacy computing helps secure data circulation and sharing
Sophon base 3.1 launched mlops function to provide wings for the operation of enterprise AI capabilities
Find the first k small element select_ k
随机推荐
Simulate the hundred prisoner problem
Introduction to Resampling
What are the changes in the 2022 PMP Exam?
记录Pytorch中的eval()和no_grad()
Sophon KG升级3.1:打破数据间壁垒,解放企业生产力
Sophon CE Community Edition is online, and free get is a lightweight, easy-to-use, efficient and intelligent data analysis tool
Leetcode exercise - 206 Reverse linked list
Nacos distributed transactions Seata * * install JDK on Linux, mysql5.7 start Nacos configure ideal call interface coordination (nanny level detail tutorial)
Elk log analysis system
修复漏洞 - mysql 、es
Eliminate the writing of 'if () else{}'
检查命名空间和类
钉钉开放平台小程序API的缓存接口都有哪些内容?
【在優麒麟上使用Electron開發桌面應】
RSE2020/云检测:基于弱监督深度学习的高分辨率遥感图像精确云检测
Xiaobai getting started with NAS - quick building private cloud tutorial series (I) [easy to understand]
[performance test] full link voltage test
Unicode processing in response of flash interface
[BeanShell] there are many ways to write data locally
Binder开辟线程数过多导致主线程ANR异常