Beispiel #1
0
        public static int GetZone_(PointLatLng point, double Radius, int TakeoffSurfaceDirection, PointLatLng RunwayBegin, PointLatLng RunwayEnd)
        {
            double RunwayLength = GetDistance(RunwayBegin, RunwayEnd);

            List <PointLatLng> Plane1 = new List <PointLatLng>();

            Plane1.Add(CMGeoBase.OtstupVPP(Radius, 1, RunwayBegin));
            Plane1.Add(CMGeoBase.OtstupVPP(Radius, 1, RunwayEnd));
            Plane1.Add(CMGeoBase.OtstupVPP(Radius, 3, RunwayEnd));
            Plane1.Add(CMGeoBase.OtstupVPP(Radius, 3, RunwayBegin));
            // ShowPolygonPoints(Plane1);
            if (CMGeoBase.IsPointInPolygon(Plane1, point))
            {
                return(2);
            }
            else
            {
                PointLatLng pointx    = CMGeoBase.OtstupVPP(RunwayLength / 2, TakeoffSurfaceDirection, RunwayBegin);
                PointLatLng LineBegin = CMGeoBase.OtstupVPP(Radius, 1, pointx);
                PointLatLng LineEnd   = CMGeoBase.OtstupVPP(Radius, 3, pointx);

                double dec = LineSide(point, LineBegin, LineEnd);

                if (dec <= 0)
                {
                    return(TakeoffSurfaceDirection == 2 ? 3 : 1);
                }
                else
                {
                    return(TakeoffSurfaceDirection == 2 ? 1 : 3);
                }
            }
        }
Beispiel #2
0
        public static int GetZone(CMGeoPoint point, double Radius, int TakeoffSurfaceDirection, CMRunwayThreshold RunwayBegin, CMRunwayThreshold RunwayEnd)
        {
            double RunwayLength = GetDistance(RunwayBegin, RunwayEnd);



            List <PointLatLng> Plane1 = new List <PointLatLng>();

            Plane1.Add(CMGeoBase.GetCoordinate(RunwayBegin, RunwayBegin.BackTrueCourse - 90, Radius).Coordinates);
            Plane1.Add(CMGeoBase.GetCoordinate(RunwayEnd, RunwayEnd.BackTrueCourse + 90, Radius).Coordinates);
            Plane1.Add(CMGeoBase.GetCoordinate(RunwayEnd, RunwayEnd.BackTrueCourse - 90, Radius).Coordinates);
            Plane1.Add(CMGeoBase.GetCoordinate(RunwayBegin, RunwayBegin.BackTrueCourse + 90, Radius).Coordinates);

            //Plane1.Add(CMGeoBase.OtstupVPP(Radius, 1, RunwayBegin.Coordinates));
            //Plane1.Add(CMGeoBase.OtstupVPP(Radius, 1, RunwayEnd.Coordinates));
            //Plane1.Add(CMGeoBase.OtstupVPP(Radius, 3, RunwayEnd.Coordinates));
            //Plane1.Add(CMGeoBase.OtstupVPP(Radius, 3, RunwayBegin.Coordinates));

            // ShowPolygonPoints(Plane1);
            if (CMGeoBase.IsPointInPolygon(Plane1, point.Coordinates))
            {
                return(2);
            }
            else
            {
                //CMGeoPoint pointx = CMGeoBase.GetCoordinate(RunwayBegin,RunwayBegin.
                PointLatLng pointx = CMGeoBase.GetCoordinate(RunwayBegin.Coordinates, RunwayBegin.TrueCourse, RunwayLength / 2);

                PointLatLng LineBegin = CMGeoBase.GetCoordinate(pointx, RunwayBegin.TrueCourse + 90, Radius);
                PointLatLng LineEnd   = CMGeoBase.GetCoordinate(pointx, RunwayBegin.TrueCourse - 90, Radius);

                //PointLatLng pointx_ = CMGeoBase.OtstupVPP(RunwayLength / 2, TakeoffSurfaceDirection, RunwayBegin.Coordinates);
                //PointLatLng LineBegin_ = CMGeoBase.OtstupVPP(Radius, 1, pointx);
                //PointLatLng LineEnd_ = CMGeoBase.OtstupVPP(Radius, 3, pointx);

                double dec = LineSide(point.Coordinates, LineBegin, LineEnd);

                if (dec <= 0)
                {
                    return(TakeoffSurfaceDirection == 2 ? 3 : 1);
                }
                else
                {
                    return(TakeoffSurfaceDirection == 2 ? 1 : 3);
                }
            }
        }
Beispiel #3
0
        public static byte ZoneChecker(PointLatLng Input, List <PointLatLng> Poligon)
        {
            byte dec = 1;
            List <PointLatLng> TempPoligon = new List <PointLatLng>(5);

            TempPoligon = TempPoligon.Concat(Poligon.GetRange(0, 2).ToList()).Concat(Poligon.GetRange(Poligon.Count - 2, 2).ToList()).ToList();
            //ShowPolygonPoints(TempPoligon);
            if (CMGeoBase.IsPointInPolygon(TempPoligon, Input))
            {
                return(dec);
            }
            else
            {
                TempPoligon.Clear();
                TempPoligon = TempPoligon.Concat(Poligon.GetRange(1, Poligon.Count - 2).ToList()).ToList();
                dec        += ZoneChecker(Input, TempPoligon);
            }

            TempPoligon.Clear();
            return(dec);
        }