private static IList <PolygonPoint> GetPoligonPoints(IncidentModel incident)
        {
            int searchAreaRadius = 1500;
            var center           = new Coordinate(incident.Latitude, incident.Longitude);
            var vertices         = MapPointGenerator.GetVertices(center, searchAreaRadius);

            return(vertices.Select(v => new PolygonPoint {
                Latitude = v.Latitude, Longitude = v.Longitude
            }).ToList());
        }
Пример #2
0
        public static AmbulancePosition GetAmbulancePosition(City city)
        {
            var original          = new Coordinate(city.Latitude, city.Longitude);
            var point             = MapPointGenerator.GetPoint(original, 250);
            var ambulancePosition = new AmbulancePosition
            {
                CityId    = city.Id,
                Latitude  = point.Latitude,
                Longitude = point.Longitude
            };

            return(ambulancePosition);
        }
Пример #3
0
        public static IEnumerable <HeatMapPoint> GetHeatMap(City city)
        {
            var heatMap = new List <HeatMapPoint>();

            for (int i = 0; i < 100; i++)
            {
                var point = MapPointGenerator.GetPoint(new Coordinate {
                    Latitude = city.Latitude, Longitude = city.Longitude
                });
                heatMap.Add(new HeatMapPoint
                {
                    CityId    = city.Id,
                    Longitude = point.Longitude,
                    Latitude  = point.Latitude
                });
            }

            return(heatMap);
        }
Пример #4
0
        public static ResponderRoute GetResponderRoute(Coordinate startPoint)
        {
            var endPoint       = MapPointGenerator.GetPoint(startPoint, routeRadius);
            var routePoints    = RouteGenerator.GetRoute(startPoint, endPoint);
            var responderRoute = new ResponderRoute();

            if (routePoints != null)
            {
                foreach (var r in routePoints)
                {
                    responderRoute.RoutePoints.Add(new RoutePoint
                    {
                        Latitude  = r[0],
                        Longitude = r[1]
                    });
                }
            }

            return(responderRoute);
        }
Пример #5
0
        public static Responder[] GetResponders(City city)
        {
            var original = new Coordinate(city.Latitude, city.Longitude);

            var responders = new[]
            {
                new Responder {
                    CityId = city.Id, ResponderDepartment = DepartmentType.Fire, Status = ResponseStatus.Available
                },
                new Responder {
                    CityId = city.Id, ResponderDepartment = DepartmentType.Ambulance, Status = ResponseStatus.Available
                },
                new Responder {
                    CityId = city.Id, ResponderDepartment = DepartmentType.Police, Status = ResponseStatus.Available
                },
                new Responder {
                    CityId = city.Id, ResponderDepartment = DepartmentType.Ambulance, Status = ResponseStatus.Available
                },
                new Responder {
                    CityId = city.Id, ResponderDepartment = DepartmentType.Fire, Status = ResponseStatus.Available
                },
                new Responder {
                    CityId = city.Id, ResponderDepartment = DepartmentType.Police, Status = ResponseStatus.Available
                }
            };

            foreach (var res in responders)
            {
                var point = MapPointGenerator.GetPoint(original);
                res.Longitude = point.Longitude;
                res.Latitude  = point.Latitude;
                res.Route     = GetResponderRoute(point);
            }

            return(responders);
        }