Example #1
0
 protected override void OnClick()
 {
     #region
     try
     {
         EditOwnShip eos = new EditOwnShip()
         {
             WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen
         };
         if (eos.ShowDialog() == true)
         {
             CommonMethod.SetShipAngle();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     #endregion
 }
Example #2
0
        private static void CreateAllDomain(FeatureClass fc_targetShip)
        {
            //创建船周围的船舶领域
            using (Geodatabase gdb = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(GeoDataTool.DefaultProject.DefaultGeodatabasePath))))
            {
                gdb.ApplyEdits(() =>
                {
                    //置空原船舶领域图层
                    FeatureClass shipDomain = gdb.OpenDataset <FeatureClass>(ConstDefintion.ConstFeatureClass_ShipDomianEllipse);
                    FeatureClassDefinition shipDomainDefinition = gdb.GetDefinition <FeatureClassDefinition>(ConstDefintion.ConstFeatureClass_ShipDomianEllipse);
                    shipDomain.DeleteRows(new QueryFilter()
                    {
                        WhereClause = "OBJECTID >= 1"
                    });

                    using (RowCursor rowCursor = fc_targetShip.Search(null, false))
                    {
                        while (rowCursor.MoveNext())
                        {
                            using (Row row = rowCursor.Current)
                            {
                                Feature ship    = row as Feature;
                                MapPoint p_ship = ship.GetShape() as MapPoint;

                                double asemi               = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_asemi]) / 2;
                                double bsemi               = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_bsemi]) / 2;
                                double aoffset             = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_aoffset]) / 2;
                                double boffset             = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_boffset]) / 2;
                                double DDV                 = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_CollisionRisk]);
                                double cog                 = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_cog]);
                                cog                        = CommonMethod.GIScoord2ShipCoord(cog);
                                Coordinate2D ellipseCenter = new Coordinate2D()
                                {
                                    X = p_ship.X,
                                    Y = p_ship.Y
                                };
                                GeodesicEllipseParameter geodesic = new GeodesicEllipseParameter()
                                {
                                    Center          = ellipseCenter,
                                    SemiAxis1Length = asemi,
                                    SemiAxis2Length = bsemi,
                                    LinearUnit      = LinearUnit.Meters,
                                    OutGeometryType = GeometryType.Polygon,
                                    AxisDirection   = AngularUnit.Degrees.ConvertToRadians(cog),
                                    VertexCount     = 800
                                };
                                Geometry ellipse       = GeometryEngine.Instance.GeodesicEllipse(geodesic, SpatialReferenceBuilder.CreateSpatialReference(3857));
                                double moveX           = (aoffset * Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog)) + boffset * Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog)));
                                double moveY           = (aoffset * Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog)) - boffset * Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog)));
                                Geometry moved_ellipse = GeometryEngine.Instance.Move(ellipse, moveX, moveY);
                                using (RowBuffer rowBuffer = shipDomain.CreateRowBuffer())
                                {
                                    // Either the field index or the field name can be used in the indexer.
                                    rowBuffer[ConstDefintion.ConstFieldName_asemi]         = asemi;
                                    rowBuffer[ConstDefintion.ConstFieldName_bsemi]         = bsemi;
                                    rowBuffer[ConstDefintion.ConstFieldName_aoffset]       = aoffset;
                                    rowBuffer[ConstDefintion.ConstFieldName_CollisionRisk] = DDV;
                                    rowBuffer[shipDomainDefinition.GetShapeField()]        = moved_ellipse;
                                    using (Feature feature = shipDomain.CreateRow(rowBuffer))
                                    {
                                        feature.Store();
                                    }
                                }
                            }
                        }
                    }
                });
            }
        }
Example #3
0
        public static async Task CreateKeyPoints(string maskName, string unionMaskName, string keyPointName, double factor)
        {
            await QueuedTask.Run(() =>
            {
                StreamReader sr = new StreamReader(System.Environment.CurrentDirectory + ConstDefintion.ConstPath_TimeFilterConfig, Encoding.Default);
                String line;
                //读取状态
                line = sr.ReadLine();
                string filterStatus = line;
                line            = sr.ReadLine();
                int filterValue = Convert.ToInt32(line);
                sr.Close();
                using (Geodatabase gdb = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(GeoDataTool.DefaultProject.DefaultGeodatabasePath))))
                {
                    gdb.ApplyEdits(() =>
                    {
                        //置空原船舶领域图层
                        FeatureClass fc_targetShip = gdb.OpenDataset <FeatureClass>(ConstDefintion.ConstFeatureClass_TargetShip);
                        FeatureClass voyageMask    = gdb.OpenDataset <FeatureClass>(maskName);
                        FeatureClassDefinition voyageMaskDefinition = gdb.GetDefinition <FeatureClassDefinition>(maskName);
                        FeatureClass fc_ownShip             = gdb.OpenDataset <FeatureClass>(ConstDefintion.ConstFeatureClass_OwnShip);
                        FeatureClass TargetShipObstacleLine = gdb.OpenDataset <FeatureClass>(ConstDefintion.ConstFeatureClass_TargetShipObstacleLine);
                        TargetShipObstacleLine.DeleteRows(new QueryFilter()
                        {
                            WhereClause = "OBJECTID >= 1"
                        });
                        double own_x;
                        double own_y;
                        double own_cog;
                        using (RowCursor rowCursor = fc_ownShip.Search(null, false))
                        {
                            rowCursor.MoveNext();
                            using (Feature row = rowCursor.Current as Feature)
                            {
                                own_x   = (row.GetShape() as MapPoint).X;
                                own_y   = (row.GetShape() as MapPoint).Y;
                                own_cog = Convert.ToDouble(row[ConstDefintion.ConstFieldName_cog]);
                            }
                        }

                        voyageMask.DeleteRows(new QueryFilter()
                        {
                            WhereClause = "OBJECTID >= 1"
                        });
                        using (RowCursor rowCursor = fc_targetShip.Search(null, false))
                        {
                            while (rowCursor.MoveNext())
                            {
                                using (Row row = rowCursor.Current)
                                {
                                    Feature ship         = row as Feature;
                                    MapPoint p_ship      = ship.GetShape() as MapPoint;
                                    double CollisionRisk = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_CollisionRisk]);
                                    double asemi         = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_asemi]) * factor * 0.78;
                                    double bsemi         = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_bsemi]) * factor * 0.78;
                                    double aoffset       = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_aoffset]) * factor;
                                    double boffset       = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_boffset]) * factor;
                                    double cog           = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_cog]);
                                    double sog           = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_sog]);
                                    double tdv1          = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_tdv1]);
                                    double tdv2          = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_tdv2]);
                                    double ddv           = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_ddv]);
                                    double tcr           = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_tcr]);
                                    double tmin          = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_tmin]);
                                    long objectID        = Convert.ToInt64(ship[voyageMaskDefinition.GetObjectIDField()]);
                                    cog = CommonMethod.GIScoord2ShipCoord(cog);
                                    Coordinate2D ellipseCenter = new Coordinate2D()
                                    {
                                        X = p_ship.X,
                                        Y = p_ship.Y
                                    };
                                    if (!(CollisionRisk > 0))
                                    {
                                        continue;
                                    }
                                    //根据时间过滤器
                                    if (filterStatus != ConstDefintion.ConstStr_TimeFilterStatusOFF)
                                    {
                                        int time = filterValue * 60;
                                        if (tdv1 > time)
                                        {
                                            continue;
                                        }
                                        else
                                        {
                                            if (tdv2 > time)
                                            {
                                                tdv2 = time;
                                            }
                                        }
                                    }
                                    //if (CommonMethod.JungeLeft(own_x - ellipseCenter.X, own_y - ellipseCenter.Y, own_cog) && CollisionRisk != 1) continue;
                                    GeodesicEllipseParameter geodesic = new GeodesicEllipseParameter()
                                    {
                                        Center          = ellipseCenter,
                                        SemiAxis1Length = asemi,
                                        SemiAxis2Length = bsemi,
                                        LinearUnit      = LinearUnit.Meters,
                                        OutGeometryType = GeometryType.Polygon,
                                        AxisDirection   = AngularUnit.Degrees.ConvertToRadians(cog),
                                        VertexCount     = 800
                                    };
                                    //创建原始位置的椭圆
                                    Geometry ellipse          = GeometryEngine.Instance.GeodesicEllipse(geodesic, SpatialReferenceBuilder.CreateSpatialReference(3857));
                                    double moveX              = (aoffset *Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog))) + boffset *Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog));
                                    double moveY              = (aoffset *Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog))) - boffset *Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog));
                                    Geometry moved_ellipse    = GeometryEngine.Instance.Move(ellipse, moveX, moveY);
                                    Coordinate2D centerRevise = new Coordinate2D()
                                    {
                                        X = p_ship.X + moveX,
                                        Y = p_ship.Y + moveY
                                    };
                                    //基于TDV创建船舶领域与动界
                                    double moveXs = (tdv1 *sog *ConstDefintion.ConstDouble_mpersTOkn *Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog)));
                                    double moveYs = (tdv1 *sog *ConstDefintion.ConstDouble_mpersTOkn *Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog)));
                                    Geometry moved_start_ellipse = GeometryEngine.Instance.Move(moved_ellipse, moveXs, moveYs);
                                    Coordinate2D centerTs        = new Coordinate2D()
                                    {
                                        X = centerRevise.X + moveXs,
                                        Y = centerRevise.Y + moveYs
                                    };
                                    double moveXe = (tdv2 *sog *ConstDefintion.ConstDouble_mpersTOkn *Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog)));
                                    double moveYe = (tdv2 *sog *ConstDefintion.ConstDouble_mpersTOkn *Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog)));
                                    Geometry moved_end_ellipse = GeometryEngine.Instance.Move(moved_ellipse, moveXe, moveYe);
                                    Coordinate2D centerTe      = new Coordinate2D()
                                    {
                                        X = centerRevise.X + moveXe,
                                        Y = centerRevise.Y + moveYe
                                    };

                                    //最终图形由两个椭圆和连接椭圆的长方形组成
                                    Geometry e_s_start    = GeometryEngine.Instance.SimplifyAsFeature(moved_start_ellipse, false);
                                    Geometry e_s_end      = GeometryEngine.Instance.SimplifyAsFeature(moved_end_ellipse, false);
                                    MapPoint p_1          = MapPointBuilder.CreateMapPoint(centerTs.X - (bsemi *Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog))) * 1.29, centerTs.Y + (bsemi *Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog))) * 1.29);
                                    MapPoint p_2          = MapPointBuilder.CreateMapPoint(centerTs.X + (bsemi *Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog))) * 1.29, centerTs.Y - (bsemi *Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog))) * 1.29);
                                    MapPoint p_3          = MapPointBuilder.CreateMapPoint(centerTe.X + (bsemi *Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog))) * 1.29, centerTe.Y - (bsemi *Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog))) * 1.29);
                                    MapPoint p_4          = MapPointBuilder.CreateMapPoint(centerTe.X - (bsemi *Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog))) * 1.29, centerTe.Y + (bsemi *Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog))) * 1.29);
                                    IList <MapPoint> p1_4 = GetInternPoints(p_1, p_4);
                                    IList <MapPoint> p2_3 = GetInternPoints(p_2, p_3);
                                    p2_3 = p2_3.Reverse <MapPoint>().ToList();
                                    List <MapPoint> list2D = new List <MapPoint>();
                                    list2D.Add(p_1);
                                    foreach (MapPoint p in p1_4)
                                    {
                                        list2D.Add(p);
                                    }
                                    list2D.Add(p_4);
                                    list2D.Add(p_3);
                                    foreach (MapPoint p in p2_3)
                                    {
                                        list2D.Add(p);
                                    }
                                    list2D.Add(p_2);
                                    Polygon connect_R = PolygonBuilder.CreatePolygon(list2D, SpatialReferenceBuilder.CreateSpatialReference(3857));
                                    Geometry simple_r = GeometryEngine.Instance.SimplifyAsFeature(connect_R, false);
                                    //融合图形
                                    IList <Geometry> g_List = new List <Geometry>()
                                    {
                                        e_s_start, simple_r, e_s_end
                                    };
                                    Geometry ellInstance = GeometryEngine.Instance.Union(g_List);
                                    using (RowBuffer rowBuffer = voyageMask.CreateRowBuffer())
                                    {
                                        // Either the field index or the field name can be used in the indexer.
                                        rowBuffer[ConstDefintion.ConstFieldName_ddv]      = CollisionRisk;
                                        rowBuffer[ConstDefintion.ConstFieldName_tdv1]     = tdv1;
                                        rowBuffer[ConstDefintion.ConstFieldName_tdv2]     = tdv2;
                                        rowBuffer[ConstDefintion.ConstFieldName_asemi]    = asemi;
                                        rowBuffer[ConstDefintion.ConstFieldName_bsemi]    = bsemi;
                                        rowBuffer[ConstDefintion.ConstFieldName_cog]      = cog;
                                        rowBuffer[ConstDefintion.ConstFieldName_sog]      = sog;
                                        rowBuffer[ConstDefintion.ConstFieldName_centerX1] = centerTs.X;
                                        rowBuffer[ConstDefintion.ConstFieldName_centerY1] = centerTs.Y;
                                        rowBuffer[ConstDefintion.ConstFieldName_centerX2] = centerTe.X;
                                        rowBuffer[ConstDefintion.ConstFieldName_centerY2] = centerTe.Y;
                                        rowBuffer[voyageMaskDefinition.GetShapeField()]   = ellInstance;

                                        using (Feature feature = voyageMask.CreateRow(rowBuffer))
                                        {
                                            feature.Store();
                                        }
                                    }
                                    //创建本船与他船的冲突路径
                                    Coordinate2D ts_location = ellipseCenter;
                                    Coordinate2D ts_Ts       = new Coordinate2D()//目标船冲突起点
                                    {
                                        X = ts_location.X + moveXs,
                                        Y = ts_location.Y + moveYs
                                    };
                                    Coordinate2D ts_Te = new Coordinate2D()//目标船冲突终点
                                    {
                                        X = ts_location.X + moveXe,
                                        Y = ts_location.Y + moveYe
                                    };
                                    List <Coordinate2D> ts_obstaclePointList = new List <Coordinate2D>()
                                    {
                                        ts_Ts, ts_Te
                                    };
                                    Polyline ts_obstacleLine = PolylineBuilder.CreatePolyline(ts_obstaclePointList, SpatialReferenceBuilder.CreateSpatialReference(3857));
                                    double kj_risk           = 0;
                                    if (ddv > 1)
                                    {
                                        kj_risk = 0;
                                    }
                                    else if (ddv < 0.5)
                                    {
                                        kj_risk = 1;
                                    }
                                    else
                                    {
                                        kj_risk = Math.Pow(2 - 2 * ddv, 3.03);
                                    }
                                    using (RowBuffer rowBuffer = TargetShipObstacleLine.CreateRowBuffer())
                                    {
                                        // Either the field index or the field name can be used in the indexer.
                                        rowBuffer[ConstDefintion.ConstFieldName_dcr]   = kj_risk;
                                        rowBuffer[ConstDefintion.ConstFieldName_tcr]   = tcr;
                                        rowBuffer[ConstDefintion.ConstFieldName_risk]  = CollisionRisk;
                                        rowBuffer[ConstDefintion.ConstFieldName_tdv1]  = tdv1;
                                        rowBuffer[ConstDefintion.ConstFieldName_tdv2]  = tdv2;
                                        rowBuffer[ConstDefintion.ConstFieldName_tmin]  = tmin;
                                        rowBuffer[ConstDefintion.ConstFieldName_Shape] = ts_obstacleLine;

                                        using (Feature feature = TargetShipObstacleLine.CreateRow(rowBuffer))
                                        {
                                            feature.Store();
                                        }
                                    }
                                }
                            }
                        }
                    });
                }
            });

            //创建航行位置Mask

            await QueuedTask.Run(async() =>
            {
                //Mask边缘
                //合并要素
                using (Geodatabase gdb = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(GeoDataTool.DefaultProject.DefaultGeodatabasePath))))
                {
                    gdb.ApplyEdits(() =>
                    {
                        using (FeatureClass u_VoyageMask = gdb.OpenDataset <FeatureClass>(unionMaskName))
                        {
                            u_VoyageMask.DeleteRows(new QueryFilter()
                            {
                                WhereClause = "OBJECTID >= 1"
                            });
                            using (FeatureClass voyageMask = gdb.OpenDataset <FeatureClass>(maskName))
                            {
                                IList <Geometry> u_list = new List <Geometry>();
                                FeatureClassDefinition u_voyageMaskDefinition = gdb.GetDefinition <FeatureClassDefinition>(unionMaskName);
                                using (RowCursor rowCursor = voyageMask.Search(null, false))
                                {
                                    while (rowCursor.MoveNext())
                                    {
                                        using (Feature f = rowCursor.Current as Feature)
                                        {
                                            u_list.Add(f.GetShape());
                                        }
                                    }
                                    //赋值
                                    using (RowBuffer rowBuffer = u_VoyageMask.CreateRowBuffer())
                                    {
                                        Geometry geometry = GeometryEngine.Instance.Union(u_list);
                                        rowBuffer[u_voyageMaskDefinition.GetShapeField()] = geometry;
                                        using (Feature feature = u_VoyageMask.CreateRow(rowBuffer))
                                        {
                                            feature.Store();
                                        }
                                    }
                                }
                            }
                        }
                    });
                }
                //运行要素边缘转点
                string inpath = GeoDataTool.DefaultProject.DefaultGeodatabasePath + "\\" + keyPointName;
                var args      = Geoprocessing.MakeValueArray(inpath);
                var result    = await Geoprocessing.ExecuteToolAsync("Delete_management", args, null, null, null);

                string inpath1 = GeoDataTool.DefaultProject.DefaultGeodatabasePath + "\\" + unionMaskName;
                string outpath = GeoDataTool.DefaultProject.DefaultGeodatabasePath + "\\" + keyPointName;
                var args1      = Geoprocessing.MakeValueArray(inpath1, outpath, "ALL");
                var result1    = await Geoprocessing.ExecuteToolAsync("FeatureVerticesToPoints_management", args1, null, null, null);
            });
        }
Example #4
0
        public static async void GetCollisionRisk()
        {
            await CommonMethod.OpenMap(ConstDefintion.ConstMap_EncounterSafety);

            //计算DDV TDV
            await QueuedTask.Run(() =>
            {
                IList <Layer> listLayers   = MapView.Active.Map.GetLayersAsFlattenedList().ToList();
                FeatureLayer l_ownShip     = listLayers.First(l => l.Name == ConstDefintion.ConstLayer_OwnShipLayerName) as FeatureLayer;
                FeatureLayer l_targetShip  = listLayers.First(l => l.Name == ConstDefintion.ConstLayer_TargetShipLayerName) as FeatureLayer;
                FeatureClass fc_ownShip    = l_ownShip.GetFeatureClass();
                FeatureClass fc_targetShip = l_targetShip.GetFeatureClass();

                Feature f_ownShip;
                Feature f_targetShip;
                //获取本船的Feature
                QueryFilter qf = new QueryFilter()
                {
                    ObjectIDs = new List <long>()
                    {
                        1
                    }
                };
                RowCursor rowCursor1 = fc_ownShip.Search(qf, false);

                rowCursor1.MoveNext();
                Row row1 = rowCursor1.Current;

                f_ownShip = row1 as Feature;


                //遍历目标船的Feature
                using (RowCursor rowCursor = fc_targetShip.Search(null, false))
                {
                    while (rowCursor.MoveNext())
                    {
                        using (Row row = rowCursor.Current)
                        {
                            f_targetShip      = row as Feature;
                            long objectid     = f_targetShip.GetObjectID();
                            CollisionRisk ctd = new CollisionRisk(f_ownShip, f_targetShip);
                            if (ctd.Calculate())
                            {
                                using (Geodatabase gdb = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(GeoDataTool.DefaultProject.DefaultGeodatabasePath))))
                                {
                                    gdb.ApplyEdits(() =>
                                    {
                                        Feature target = row as Feature;
                                        target[ConstDefintion.ConstFieldName_asemi]         = ctd.asemi;
                                        target[ConstDefintion.ConstFieldName_bsemi]         = ctd.bsemi;
                                        target[ConstDefintion.ConstFieldName_aoffset]       = ctd.aoffset;
                                        target[ConstDefintion.ConstFieldName_boffset]       = ctd.boffset;
                                        target[ConstDefintion.ConstFieldName_ddv]           = ctd.DDV;
                                        target[ConstDefintion.ConstFieldName_tdv1]          = ctd.TDV1;
                                        target[ConstDefintion.ConstFieldName_tdv2]          = ctd.TDV2;
                                        target[ConstDefintion.ConstFieldName_dcpa]          = ctd.DCPA;
                                        target[ConstDefintion.ConstFieldName_tcpa]          = ctd.TCPA;
                                        target[ConstDefintion.ConstFieldName_tmin]          = ctd.Tmin;
                                        target[ConstDefintion.ConstFieldName_tcr]           = ctd.TCR;
                                        target[ConstDefintion.ConstFieldName_CollisionRisk] = ctd.collisionRisk;

                                        target.Store();
                                    });
                                }
                            }
                        }
                    }
                }
                CreateAllDomain(fc_targetShip);
                //CreateVoyageMaskAsync(fc_targetShip);
            });
        }
Example #5
0
        internal static async Task CreateEvaluatePointsAsync()
        {
            await QueuedTask.Run(() =>
            {
                using (Geodatabase gdb = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(GeoDataTool.DefaultProject.DefaultGeodatabasePath))))
                {
                    gdb.ApplyEdits(() =>
                    {
                        //置空原船舶领域图层
                        FeatureClass fc_targetShip                = gdb.OpenDataset <FeatureClass>(ConstDefintion.ConstFeatureClass_TargetShip);
                        FeatureClass fc_ownShip                   = gdb.OpenDataset <FeatureClass>(ConstDefintion.ConstFeatureClass_OwnShip);
                        FeatureClass fc_evaluatePoints            = gdb.OpenDataset <FeatureClass>(ConstDefintion.ConstFeatureClass_VoyageRiskEvaluatePoint);
                        FeatureClassDefinition fcd_evaluatePoints = gdb.GetDefinition <FeatureClassDefinition>(ConstDefintion.ConstFeatureClass_VoyageRiskEvaluatePoint);
                        fc_evaluatePoints.DeleteRows(new QueryFilter()
                        {
                            WhereClause = "OBJECTID >= 1"
                        });
                        double own_x;
                        double own_y;
                        double own_cog;
                        using (RowCursor rowCursor = fc_ownShip.Search(null, false))
                        {
                            rowCursor.MoveNext();
                            using (Feature row = rowCursor.Current as Feature)
                            {
                                own_x   = (row.GetShape() as MapPoint).X;
                                own_y   = (row.GetShape() as MapPoint).Y;
                                own_cog = Convert.ToDouble(row[ConstDefintion.ConstFieldName_cog]);
                            }
                        }
                        using (RowCursor rowCursor = fc_targetShip.Search(null, false))
                        {
                            while (rowCursor.MoveNext())
                            {
                                using (Row row = rowCursor.Current)
                                {
                                    Feature ship         = row as Feature;
                                    MapPoint p_ship      = ship.GetShape() as MapPoint;
                                    double CollisionRisk = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_CollisionRisk]);
                                    double asemi         = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_asemi]);
                                    double bsemi         = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_bsemi]);
                                    double aoffset       = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_aoffset]);
                                    double boffset       = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_boffset]);
                                    double cog           = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_cog]);
                                    double sog           = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_sog]);
                                    double tdv1          = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_tdv1]);
                                    double tdv2          = Convert.ToDouble(ship[ConstDefintion.ConstFieldName_tdv2]);
                                    long objectID        = Convert.ToInt64(ship["OBJECTID"]);
                                    //真北转坐标北
                                    cog = CommonMethod.GIScoord2ShipCoord(cog);
                                    Coordinate2D ellipseCenter = new Coordinate2D()
                                    {
                                        X = p_ship.X,
                                        Y = p_ship.Y
                                    };
                                    if (!(objectID == 6))
                                    {
                                        continue;
                                    }
                                    if (!(CollisionRisk > 0))
                                    {
                                        continue;
                                    }
                                    if (CommonMethod.JungeLeft(own_x - ellipseCenter.X, own_y - ellipseCenter.Y, own_cog) && CollisionRisk != 1)
                                    {
                                        continue;
                                    }
                                    for (int i = 0; i < 21; i++)
                                    {
                                        //创建原始位置的椭圆 动界中心
                                        double moveX = (aoffset *Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog))) + boffset *Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog));
                                        double moveY = (aoffset *Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog))) - boffset *Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog));
                                        //换算第i个点位的瞬时位置椭圆中心
                                        moveX *= i * 0.05;
                                        moveY *= i * 0.05;
                                        Coordinate2D centerRevise = new Coordinate2D()
                                        {
                                            X = p_ship.X + moveX,
                                            Y = p_ship.Y + moveY
                                        };
                                        //起长半轴
                                        double angle1 = AngularUnit.Degrees.ConvertToRadians(cog) + Math.PI;
                                        //短半轴
                                        double angle2 = AngularUnit.Degrees.ConvertToRadians(cog) + Math.PI / 2;
                                        double angle3 = AngularUnit.Degrees.ConvertToRadians(cog) - Math.PI / 2;
                                        //基于TDV创建起点与终点椭圆中心
                                        double moveXs         = (tdv1 *sog *ConstDefintion.ConstDouble_mpersTOkn *Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog)));
                                        double moveYs         = (tdv1 *sog *ConstDefintion.ConstDouble_mpersTOkn *Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog)));
                                        Coordinate2D centerTs = new Coordinate2D()
                                        {
                                            X = centerRevise.X + moveXs,
                                            Y = centerRevise.Y + moveYs
                                        };

                                        CreateSemiEvaluatePoint(i, angle1, asemi *i * 0.05, centerTs, fc_evaluatePoints);

                                        CreateSemiEvaluatePoint(i, angle2, bsemi *i * 0.05, centerTs, fc_evaluatePoints);
                                        CreateSemiEvaluatePoint(i, angle3, bsemi *i * 0.05, centerTs, fc_evaluatePoints);
                                        double moveXe         = (tdv2 *sog *ConstDefintion.ConstDouble_mpersTOkn *Math.Cos(AngularUnit.Degrees.ConvertToRadians(cog)));
                                        double moveYe         = (tdv2 *sog *ConstDefintion.ConstDouble_mpersTOkn *Math.Sin(AngularUnit.Degrees.ConvertToRadians(cog)));
                                        Coordinate2D centerTe = new Coordinate2D()
                                        {
                                            X = centerRevise.X + moveXe,
                                            Y = centerRevise.Y + moveYe
                                        };
                                        double angle4 = AngularUnit.Degrees.ConvertToRadians(cog);
                                        CreateSemiEvaluatePoint(i, angle4, asemi *i * 0.05, centerTe, fc_evaluatePoints);
                                        //短半轴
                                        CreateSemiEvaluatePoint(i, angle2, bsemi *i * 0.05, centerTe, fc_evaluatePoints);
                                        CreateSemiEvaluatePoint(i, angle3, bsemi *i * 0.05, centerTe, fc_evaluatePoints);
                                    }
                                }
                            }
                        }
                    });
                }
            });
        }