/// <summary> /// Finds bus stops matching the area specified by center location and radius. /// </summary> /// <param name="pos">Position</param> /// <param name="radius">Rectangular search "radius" in kilometers</param> /// <returns>Array of Stop objects</returns> public static async Task <Stop[]> FindStopsByLocationAsync(BasicPosition pos, int radius) { var box = MapExtensions.GetBoundingBox(pos, radius); var left = (int)(box.MinPoint.Longitude * 3600000); var right = (int)(box.MaxPoint.Longitude * 3600000); var top = (int)(box.MaxPoint.Latitude * 3600000); var bottom = (int)(box.MinPoint.Latitude * 3600000); var content = new StringContent("left=" + left + "&bottom=" + bottom + "&right=" + right + "&top=" + top); var response = await _client.PostAsync(_geoUrl, content); var locationInfo = await DeserializeAsync <LocationInfo>(response); return(locationInfo.Stops); }
public static Position FromBasic(BasicPosition basic) { return(new Position(basic)); // accesses private ctor }
public void GivenIHaveANewPositionObjectAt(double x, double y) { bp = new BasicPosition(x, y); }
private Position(BasicPosition basic) : base(basic) { // private ctor }
public void GivenIHaveANewPositionObject() { bp = new BasicPosition(); }