Exemplo n.º 1
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);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }