Пример #1
0
        public void Apply()
        {
            var vertices     = PolygonVertices.Select(v => WgsUtmConverter.LatLonToUTMXY(v.Location, 0)).ToList();
            var needToRemove = _waypointsService.Waypoints.Where(wpt => !WgsUtmConverter.LatLonToUTMXY(wpt.Location, 0).IsInsidePolygon(vertices)).ToList();

            foreach (var wpt in needToRemove)
            {
                _waypointsService.Waypoints.Remove(wpt);
            }
        }
Пример #2
0
        public void SetupWithGridFrame(GridFrame frame)
        {
            Corner        = new Waypoint("", frame.Corner);
            GridWidth     = frame.GetGridWidthMeters();
            ProfileLength = frame.GetProfileLengthMeters();

            var c  = WgsUtmConverter.LatLonToUTMXY(frame.Corner, 0);
            var a1 = WgsUtmConverter.LatLonToUTMXY(frame.P1, 0);
            var a2 = WgsUtmConverter.LatLonToUTMXY(frame.P2, 0);

            GridAngleDeg    = CalculateAngleDeg(c, a1);
            ProfileAngleDeg = CalculateAngleDeg(c, a2);
        }
Пример #3
0
        public List <Waypoint> ApplyTo(Waypoint waypoint)
        {
            var layout = new List <Waypoint>();

            var xyBase = WgsUtmConverter.LatLonToUTMXY(waypoint.Location, 0);

            foreach (var element in Elements)
            {
                var xy       = xyBase.Shift(element.Offset);
                var location = WgsUtmConverter.UTMXYToLatLon(xy, waypoint.Location.Latitude < 0);
                layout.Add(new Waypoint($"{waypoint.Name}-{element.Name}", location));
            }

            return(layout);
        }
        private void SetMetersRepresentation()
        {
            var utm = WgsUtmConverter.LatLonToUTMXY(Location, 0);

            SetXYRepresentation(utm.X.ToString("F0"), utm.Y.ToString("F0"), utm.Zone.ToString());
        }