1.星链数据下载
CelesTrak: Current GP Element Sets
下载二根数就可以。
2.处理数据
下载下来的数据是这样,要将字符串转为 二根数对象
TwoLineElementSet tle = new TwoLineElementSet(tleString);
Sgp4Propagator propagator = new Sgp4Propagator(tle);
3.批量创建卫星 设置名称和轨迹线
var issPoint = new Sgp4Propagator(tleList).CreatePoint();
var satellite = new Platform
{
Name = tleList.Name,
LocationPoint = issPoint,
OrientationAxes = new AxesVehicleVelocityLocalHorizontal(m_earth.FixedFrame, issPoint),
};
satellite.Extensions.Add(new IdentifierExtension(tleList.Name));
var labelExtension = new LabelGraphicsExtension(new LabelGraphics
{
Text = new ConstantCesiumProperty<string>(satellite.Name),
FillColor = new ConstantCesiumProperty<Color>(STKUtil.GetColors(i)),
Font = new ConstantCesiumProperty<string>("10px"),
});
satellite.Extensions.Add(labelExtension);
var markerGraphics = new BillboardGraphics
{
Image = new CesiumResource(GetModelUri("Markers/Satellite.png"), CesiumResourceBehavior.LinkTo),
};
satellite.Extensions.Add(new BillboardGraphicsExtension(markerGraphics));
// Configure a glTF model for the satellite.
satellite.Extensions.Add(new ModelGraphicsExtension(new ModelGraphics
{
// Link to a binary glTF file.
Model = new CesiumResource(GetModelUri("satellite.glb"), CesiumResourceBehavior.LinkTo),
// By default, Cesium plays all animations in the model simultaneously, which is not desirable.
RunAnimations = false,
}));
satellite.Extensions.Add(new PathGraphicsExtension(new PathGraphics
{
Material = new PolylineOutlineMaterialGraphics
{
Color = new ConstantCesiumProperty<Color>(STKUtil.GetColors(i)),
OutlineWidth = new ConstantCesiumProperty<double>(1.0),
OutlineColor = new ConstantCesiumProperty<Color>(Color.Black),
},
Width = 1,
LeadTime = Duration.FromMinutes(20).TotalSeconds,
TrailTime = Duration.FromMinutes(20).TotalSeconds,
}));
4 效果
1000可星轨迹线加名字看着好乱
5.去掉名称和轨迹线
卫星视角
缩小看到的是图片,放大看到的是模型
全量数据不到5000颗卫星。