/// <summary> /// 加载单个任务区 根据任务区实体类加载 /// </summary> /// <param name="map"></param> /// <param name="model"></param> public static void LoadSatelliteTaskArea(Core.Map.MapHelper map, Core.Model.TASK_LAYOUT_LIST model) { if (model.TASKTYPE == 0) { ISymbol symbol = map.CreateSimpleSymbol(Color.OrangeRed, 4, esriSimpleMarkerStyle.esriSMSCross); IPoint pPoint = new PointClass(); pPoint.PutCoords(Convert.ToDouble(model.LON), Convert.ToDouble(model.LAT)); //SatelliteResaultAreas = new List<IPolygon>(); //SatelliteResaultAreas.Add(pPolygon); //添加任务区点 map.AddElement(pPoint, symbol, "TaskArea"); map.AddTextElement(pPoint, getTextElement(model.TASKNAME), "TaskAreaMark"); } else { ISymbol symbol = map.CreateSimpleFillSymbol(Color.OrangeRed, 4, esriSimpleFillStyle.esriSFSHollow); string[] points = model.AREASTRING.Split(' '); string polygon = ""; for (int i = 0; i < points.Length - 1; i += 2) { polygon += points[i + 1] + "," + points[i] + ";"; } IPolygon pPolygon = Core.Generic.Convertor.ToPolygon(polygon); SatelliteResaultAreas = new List <IPolygon>(); SatelliteResaultAreas.Add(pPolygon); //添加任务区多边形 map.AddElement(pPolygon, symbol, "TaskArea"); map.AddTextElement(pPolygon, getTextElement(model.TASKNAME), "TaskAreaMark"); } }
/// <summary> /// 加载单个任务区 根据任务区实体类加载 /// </summary> /// <param name="map"></param> /// <param name="model"></param> public static void LoadTaskArea(Core.Map.MapHelper map, Core.Model.TaskAreas model) { ISymbol symbol = map.CreateSimpleFillSymbol(Color.Red, 4, esriSimpleFillStyle.esriSFSHollow); IPolygon pPolygon = Core.Generic.Convertor.ToPolygon(model.PolygonString); TaskAreas = new List <IPolygon>(); TaskAreas.Add(pPolygon); //添加任务区多边形 map.AddElement(pPolygon, symbol, "TaskArea"); map.AddTextElement(pPolygon, getTextElement(model.Name), "TaskAreaMark"); }
public static bool op = false;//fale--单元格数量创建灾区;true--单元格大小创建灾区 /// <summary> /// 生成任务区域 /// </summary> /// <param name="DID">灾区ID</param> /// <param name="GridHeight">单元格高度</param> /// <param name="GridWidth">单元格长度</param> /// <param name="pMapCtr">地图控件</param> public static void GenerateTask(ESRI.ArcGIS.Controls.AxMapControl pMapCtr, int DID, double GridWidth, double GridHeight) { Core.Model.DisaAreaInfo di; Core.DAL.DisaAreaInfo dal = new Core.DAL.DisaAreaInfo(); try { di = dal.GetModel(DID); if (di == null) { throw (new Exception("读取灾区数据时出错")); } IPoint pnt = new ESRI.ArcGIS.Geometry.Point(); pnt.X = di.LON; pnt.Y = di.LAT; Core.Map.MapHelper maphelper = new Core.Map.MapHelper(pMapCtr); System.Drawing.Color color = Color.Blue; ISymbol symbol = maphelper.CreateSimpleFillSymbol(color, 1, esriSimpleFillStyle.esriSFSHollow); double radius = di.AffectedRadius / Core.Generic.SysEnviriment.LengthPerRad; MonitorTask.TaskAreaHelper th = new MonitorTask.TaskAreaHelper(); th.LoadMapData(); th.SetDisasterArea(di.LON - radius, di.LAT - radius, di.LON + radius, di.LAT + radius); th.GenerateTask(GridWidth, GridHeight); InitGrid = th.InitGrids; DataGrid = th.DataGrids; IEnvelope env = new Envelope() as IEnvelope; //foreach (MonitorTask.Geometry.Grid grid in InitGrid) //{ // env = new Envelope() as IEnvelope; // env.XMin = grid.XMin; // env.YMin = grid.YMin; // env.XMax = grid.XMax; // env.YMax = grid.YMax; // maphelper.AddElement(env, symbol, "grid"); //} //color = Color.Brown; //symbol = maphelper.CreateSimpleFillSymbol(color, 1, esriSimpleFillStyle.esriSFSDiagonalCross); //foreach (MonitorTask.Geometry.Grid grid in DataGrid) //{ // env = new Envelope() as IEnvelope; // env.XMin = grid.XMin; // env.YMin = grid.YMin; // env.XMax = grid.XMax; // env.YMax = grid.YMax; // maphelper.AddElement(env, symbol, "grid"); //} } catch (Exception ex) { throw (ex); } }
/// <summary> /// 加载单个任务区 根据任务区实体类加载 /// </summary> /// <param name="map"></param> /// <param name="model"></param> public static void LoadSatelliteResaultArea(Core.Map.MapHelper map, Core.Model.SatelliteResault model) { CoScheduling.Core.Model.ImgLayoutTempTimewindow img = new CoScheduling.Core.Model.ImgLayoutTempTimewindow(); CoScheduling.Core.DAL.ImgLayoutTempTimewindow dal_img = new CoScheduling.Core.DAL.ImgLayoutTempTimewindow(); img = dal_img.GetModel(model.LSTR_SEQID.ToString()); ISymbol symbol = map.CreateSimpleFillSymbol(Color.Blue, 1, esriSimpleFillStyle.esriSFSHollow); IPolygon pPolygon = Core.Generic.Convertor.ToPolygon(model.POLYGONSTRING); SatelliteResaultAreas = new List <IPolygon>(); SatelliteResaultAreas.Add(pPolygon); //添加任务区多边形 map.AddElement(pPolygon, symbol, "TaskArea"); map.AddElement(pPolygon, symbol, "SatResaultInfo|" + img.LSTR_SEQID); //map.AddTextElement(pPolygon, getTextElement(img.SAT_STKNAME+"/"+img.SENSOR_STKNAME), "TaskAreaMark"); }