public void Handle(ProfileCreated evt) { var boundary = new GeoBoundary(evt.Track.Points); var overlappingViews = GetOverlapping(boundary); foreach (var overlappingView in overlappingViews) { overlappingView.OverlapCount++; _db.Update(overlappingView); } var view = new TrackBoundaryView(); view.TrackId = evt.Track.Id; view.North = boundary.NorthEast.Latitude; view.East = boundary.NorthEast.Longitude; view.South = boundary.SouthWest.Latitude; view.West = boundary.SouthWest.Longitude; view.OverlapCount = overlappingViews.Count; _db.Insert(view); }
private TrackBoundary CreateTrackBoundary(TrackBoundaryView view) { return(new TrackBoundary(view.TrackId, new GeoBoundary(new GeoLocation(view.North, view.East), new GeoLocation(view.South, view.West)), view.OverlapCount)); }