public string GetNearestPoint(DateTime startDate, DateTime endDate, LatLong point, int queryFor)
        {
            using (TaxiDataEntities context = new TaxiDataEntities())
            {
                //create the point to look for given by the latlong object
                SqlGeography sqlPoint = CreatePoint(point);

                //initialize return list and the initial distance to search in
                List<QueryDto> returnVal = new List<QueryDto>();
                int initialDistance = 10;

                //starting from the initialDistance search for a trip and expand the search distance until
                //a point is found. The max is 100000 meters which is around 62 miles which is sufficient for this project
                while (returnVal.Count() == 0 && initialDistance < 100000)
                {
                    returnVal = context.NearestPointQuery(startDate, endDate, initialDistance, sqlPoint.ToString(), queryFor)
                                    .Select(x => new QueryDto
                                    {
                                        Pickup = new LatLong
                                        {
                                            Latitude = (double)x.pickup_latitude,
                                            Longitude = (double)x.pickup_longitude
                                        },
                                        Dropoff = new LatLong
                                        {
                                            Latitude = (double)x.dropoff_latitude,
                                            Longitude = (double)x.dropoff_longitude
                                        },
                                        FareTotal = x.total_amount,
                                        TravelTime = x.trip_time_in_secs,
                                        NumOfPassenger = x.passenger_count,
                                        TripDistance = x.trip_distance
                                    }).ToList();

                    initialDistance *= 2;
                }

                return JsonConvert.SerializeObject(new QueryDto[] {returnVal.First()});
            }
        }