pt.name2 = TFBH;
pt.dr = dr;
string time = DateTime.Parse(dr["RQSJ"].ToString()).ToString("yy年MM月dd日HH时");
string lon = double.Parse(dr["JD"].ToString()).ToString("F1");
string lat = double.Parse(dr["WD"].ToString()).ToString("F1");
string windPower = dr["GRADE"].ToString();
string maxWindSpeed = dr["ZXFS"].ToString();
string airPress = dr["ZXQY"].ToString();
string moveSpeed = dr["YDSD"].ToString();
string moveDirect = dr["YDFX"].ToString();
string radius7 = dr["RADIUS7"].ToString();
string radius10 = dr["RADIUS10"].ToString();
windPower = windPower.Length > 0 ? windPower + "(级)" : windPower;
maxWindSpeed = maxWindSpeed.Length > 0 ? maxWindSpeed + "(米/秒)" : maxWindSpeed;
airPress = airPress.Length > 0 ? airPress + "(百帕)" : airPress;
moveSpeed = moveSpeed.Length > 0 ? moveSpeed + "(公里/时)" : moveSpeed;
radius7 = radius7.Length > 0 ? radius7 + "(公里)" : radius7;
radius10 = radius10.Length > 0 ? radius10 + "(公里)" : radius10;
pt.Infomation = string.Format(" 时 间:{0}\r\n 经 度:{1}(度)\r\n 纬 度:{2}(度)\r\n 风 力:{3}\r\n 最大风速:{4}\r\n 中心气压:{5}\r\n 移动速度:{6}\r\n 移动风向:{7}\r\n 七级风圈半径:{8}\r\n 十级风圈半径:{9}", time, lon, lat, windPower, maxWindSpeed, airPress, moveSpeed, moveDirect, radius7, radius10);
pt.Visible = true;
pointList.Add(pt);
chain.Add(sp);
}
lsLayer.AddGeometry(line);
DrawTFPathColor(TFBH, dt);
foreach (Geometry geo in pointList)
{
lsLayer.AddGeometry(geo);
}
lsLayer.IsDirty = true;
legendLayer.IsDirty = true;
#endregion
}
2、绘制台风预报路径
public void DrawYBLJPath(string TFBH, DataTable ybData, YBShowType type)
{
Debug.Assert(ybData != null, "台风预报数据不能为空");
#region 清除图元
TrackingLayer ybLayer = MapInstance.Instance.Layers["台风预报路径"] as TrackingLayer;
ybLayer.ClearGeometries();
TrackingLayer fqLayer = MapInstance.Instance.Layers["台风风圈"] as TrackingLayer;
fqLayer.ClearGeometries();
TrackingLayer legendLayer = MapInstance.Instance.Layers["台风点标注"] as TrackingLayer;
#endregion
ColorConverter cc = new ColorConverter();
List<TFPoint> tfPointList = new List<TFPoint>();
List<TFPolyline> tflineList = new List<TFPolyline>();
List<ArrowGeometry> arrowList = new List<ArrowGeometry>();
for (int i = 0; i < ybData.Rows.Count; ++i)
{
DataRow dr = ybData.Rows[i];
double jd = double.Parse(dr["JD"].ToString().Trim());
double wd = double.Parse(dr["WD"].ToString().Trim());
string hourFlag = ybData.Rows[i]["hourFlag"].ToString();
string preHourFlag = string.Empty;
int radius7 = 0;
int radius10 = 0;
if (!int.TryParse(dr["RADIUS7"].ToString(), out radius7))
{
radius7 = 0;
}
if (!int.TryParse(dr["RADIUS10"].ToString(), out radius10))
{
radius10 = 0;
}
double firstJD = double.MinValue;
double firstWD = double.MinValue;
if (i == 0)
{
firstJD = fromLon;
firstWD = fromLat;
preHourFlag = string.Empty;
}
else
{
firstJD = double.Parse(ybData.Rows[i - 1]["JD"].ToString().Trim());
firstWD = double.Parse(ybData.Rows[i - 1]["WD"].ToString().Trim());
preHourFlag = ybData.Rows[i - 1]["hourFlag"].ToString();
<< 上一页 [11] [12] [13] [14] [15] 下一页