//Called when creating a birdgroup to correct the boat's heading to the transect heading public Azimuth NormalizedAzimuth(GpsPoint gpsData) { if (gpsData == null) throw new ArgumentNullException("gpsData"); CoordinateCollection vertices = GetTwoClosestVertices(Shape, gpsData.Location); Azimuth heading = GetAzimuthFromVertices(vertices); //heading will be off by 180 degrees off if traveling from finish to start heading = OrientateHeading(heading, gpsData.Bearing); return heading; }
private static GpsPoint FromFeature(Feature feature) { if (feature == null) return null; if (!feature.IsEditing) feature.StartEditing(); var gpsPoint = new GpsPoint { Feature = feature }; gpsPoint.LoadAttributes(); GpsPoints[gpsPoint.Guid] = gpsPoint; return gpsPoint; }
internal static Observation FromGpsPoint(GpsPoint gpsPoint) { if (gpsPoint == null) throw new ArgumentNullException("gpsPoint"); //May throw an exception, but should never return null var observation = FromFeature(MobileUtilities.CreateNewFeature(FeatureSource)); observation.GpsPoint = gpsPoint; return observation; }