/// <summary> /// Return a list of photos for a user at a specific latitude, longitude and accuracy. /// </summary> /// <param name="latitude">The latitude whose valid range is -90 to 90. Anything more than 6 decimal places will be truncated.</param> /// <param name="longitude">The longitude whose valid range is -180 to 180. Anything more than 6 decimal places will be truncated.</param> /// <param name="accuracy">Recorded accuracy level of the location information. /// World level is 1, Country is ~3, Region ~6, City ~11, Street ~16. Current range is 1-16. /// Defaults to 16 if not specified.</param> /// <param name="extras"></param> /// <param name="perPage">Number of photos to return per page. If this argument is omitted, it defaults to 100. /// The maximum allowed value is 500.</param> /// <param name="page">The page of results to return. If this argument is omitted, it defaults to 1.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosGeoPhotosForLocationAsync(double latitude, double longitude, GeoAccuracy accuracy, PhotoSearchExtras extras, int perPage, int page, Action <FlickrResult <PhotoCollection> > callback) { CheckRequiresAuthentication(); var parameters = new Dictionary <string, string>(); parameters.Add("method", "flickr.photos.geo.photosForLocation"); parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("accuracy", accuracy.ToString("D")); if (extras != PhotoSearchExtras.None) { parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); } if (perPage > 0) { parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); } if (page > 0) { parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); } GetResponseAsync <PhotoCollection>(parameters, callback); }
public override string ToString() { return("LatLong{" + "latitude=" + _latitude + ", longitude=" + _longitude + ", geoAccuracy=" + _geoAccuracy.ToString() + "}"); }
/// <summary> /// Correct the places hierarchy for all the photos for a user at a given latitude, longitude and accuracy. /// </summary> /// <remarks> /// Batch corrections are processed in a delayed queue so it may take a few minutes before the changes are reflected in a user's photos. /// </remarks> /// <param name="latitude">The latitude of the photos to be update whose valid range is -90 to 90. Anything more than 6 decimal places will be truncated.</param> /// <param name="longitude">The longitude of the photos to be updated whose valid range is -180 to 180. Anything more than 6 decimal places will be truncated.</param> /// <param name="accuracy">Recorded accuracy level of the photos to be updated. World level is 1, Country is ~3, Region ~6, City ~11, Street ~16. Current range is 1-16. Defaults to 16 if not specified.</param> /// <param name="placeId">A Flickr Places ID. (While optional, you must pass either a valid Places ID or a WOE ID.)</param> /// <param name="woeId">A Where On Earth (WOE) ID. (While optional, you must pass either a valid Places ID or a WOE ID.)</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public async Task<FlickrResult<NoResponse>> PhotosGeoBatchCorrectLocationAsync(double latitude, double longitude, GeoAccuracy accuracy, string placeId, string woeId) { CheckRequiresAuthentication(); Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.photos.geo.batchCorrectLocation"); parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("accuracy", accuracy.ToString("D")); parameters.Add("place_id", placeId); parameters.Add("woe_id", woeId); return await GetResponseAsync<NoResponse>(parameters); }
/// <summary> /// Correct the places hierarchy for all the photos for a user at a given latitude, longitude and accuracy. /// </summary> /// <remarks> /// Batch corrections are processed in a delayed queue so it may take a few minutes before the changes are reflected in a user's photos. /// </remarks> /// <param name="latitude">The latitude of the photos to be update whose valid range is -90 to 90. Anything more than 6 decimal places will be truncated.</param> /// <param name="longitude">The longitude of the photos to be updated whose valid range is -180 to 180. Anything more than 6 decimal places will be truncated.</param> /// <param name="accuracy">Recorded accuracy level of the photos to be updated. /// World level is 1, Country is ~3, Region ~6, City ~11, Street ~16. Current range is 1-16. /// Defaults to 16 if not specified.</param> /// <param name="placeId">A Flickr Places ID. (While optional, you must pass either a valid Places ID or a WOE ID.)</param> /// <param name="woeId">A Where On Earth (WOE) ID. (While optional, you must pass either a valid Places ID or a WOE ID.)</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosGeoBatchCorrectLocationAsync(double latitude, double longitude, GeoAccuracy accuracy, string placeId, string woeId, Action <FlickrResult <NoResponse> > callback) { CheckRequiresAuthentication(); var parameters = new Dictionary <string, string>(); parameters.Add("method", "flickr.photos.geo.batchCorrectLocation"); parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("accuracy", accuracy.ToString("D")); parameters.Add("place_id", placeId); parameters.Add("woe_id", woeId); GetResponseAsync <NoResponse>(parameters, callback); }
/// <summary> /// Sets the geo location for a photo. /// </summary> /// <param name="photoId">The ID of the photo to set to location for.</param> /// <param name="latitude">The latitude of the geo location. A double number ranging from -180.00 to 180.00. Digits beyond 6 decimal places will be truncated.</param> /// <param name="longitude">The longitude of the geo location. A double number ranging from -180.00 to 180.00. Digits beyond 6 decimal places will be truncated.</param> /// <param name="accuracy">The accuracy of the photos geo location.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PhotosGeoSetLocationAsync(string photoId, double latitude, double longitude, GeoAccuracy accuracy, Action <FlickrResult <NoResponse> > callback) { var parameters = new Dictionary <string, string>(); parameters.Add("method", "flickr.photos.geo.setLocation"); parameters.Add("photo_id", photoId); parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (accuracy != GeoAccuracy.None) { parameters.Add("accuracy", accuracy.ToString("D")); } GetResponseAsync <NoResponse>(parameters, callback); }
/// <summary> /// Correct the places hierarchy for all the photos for a user at a given latitude, longitude and accuracy. /// </summary> /// <remarks> /// Batch corrections are processed in a delayed queue so it may take a few minutes before the changes are reflected in a user's photos. /// </remarks> /// <param name="latitude">The latitude of the photos to be update whose valid range is -90 to 90. /// Anything more than 6 decimal places will be truncated.</param> /// <param name="longitude">The longitude of the photos to be updated whose valid range is -180 to 180. /// Anything more than 6 decimal places will be truncated.</param> /// <param name="accuracy">Recorded accuracy level of the photos to be updated. /// World level is 1, Country is ~3, Region ~6, City ~11, Street ~16. Current range is 1-16. Defaults to 16 if not specified.</param> /// <param name="placeId">A Flickr Places ID. (While optional, you must pass either a valid Places ID or a WOE ID.)</param> /// <param name="woeId">A Where On Earth (WOE) ID. (While optional, you must pass either a valid Places ID or a WOE ID.)</param> public void PhotosGeoBatchCorrectLocation(double latitude, double longitude, GeoAccuracy accuracy, string placeId, string woeId) { CheckRequiresAuthentication(); if (string.IsNullOrEmpty(placeId) && string.IsNullOrEmpty(woeId)) throw new ArgumentException("You must pass either a placeId or a woeId"); var parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.photos.geo.batchCorrectLocation"); parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("accuracy", accuracy.ToString("D")); parameters.Add("place_id", placeId); parameters.Add("woe_id", woeId); GetResponseNoCache<NoResponse>(parameters); }
/// <summary> /// Suggest a particular location for a photo. /// </summary> /// <param name="photoId">The id of the photo.</param> /// <param name="latitude">The latitude of the location to suggest.</param> /// <param name="longitude">The longitude of the location to suggest.</param> /// <param name="accuracy">The accuracy of the location to suggest.</param> /// <param name="woeId">The WOE ID of the location to suggest.</param> /// <param name="placeId">The Flickr place id of the location to suggest.</param> /// <param name="note">A note to add to the suggestion.</param> public void PhotosSuggestionsSuggestLocation(string photoId, double latitude, double longitude, GeoAccuracy accuracy, string woeId, string placeId, string note) { CheckRequiresAuthentication(); var parameters = new Dictionary <string, string>(); parameters.Add("method", "flickr.photos.suggestions.suggestLocation"); parameters.Add("photo_id", photoId); parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("accuracy", accuracy.ToString("D")); parameters.Add("place_id", placeId); parameters.Add("woe_id", woeId); parameters.Add("note", note); GetResponseNoCache <NoResponse>(parameters); }
/// <summary> /// Sets the geo location for a photo. /// </summary> /// <param name="photoId">The ID of the photo to set to location for.</param> /// <param name="latitude">The latitude of the geo location. A double number ranging from -180.00 to 180.00. /// Digits beyond 6 decimal places will be truncated.</param> /// <param name="longitude">The longitude of the geo location. A double number ranging from -180.00 to 180.00. /// Digits beyond 6 decimal places will be truncated.</param> /// <param name="accuracy">The accuracy of the photos geo location.</param> /// <param name="context">The context of the geolocation data, i.e. Inside or Outside.</param> public void PhotosGeoSetLocation(string photoId, double latitude, double longitude, GeoAccuracy accuracy, GeoContext context) { Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("method", "flickr.photos.geo.setLocation"); parameters.Add("photo_id", photoId); parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (accuracy != GeoAccuracy.None) { parameters.Add("accuracy", accuracy.ToString("D")); } if (context != GeoContext.NotDefined) { parameters.Add("context", context.ToString("D")); } GetResponseNoCache <NoResponse>(parameters); }
/// <summary> /// Correct the places hierarchy for all the photos for a user at a given latitude, longitude and accuracy. /// </summary> /// <remarks> /// Batch corrections are processed in a delayed queue so it may take a few minutes before the changes are reflected in a user's photos. /// </remarks> /// <param name="latitude">The latitude of the photos to be update whose valid range is -90 to 90. /// Anything more than 6 decimal places will be truncated.</param> /// <param name="longitude">The longitude of the photos to be updated whose valid range is -180 to 180. /// Anything more than 6 decimal places will be truncated.</param> /// <param name="accuracy">Recorded accuracy level of the photos to be updated. /// World level is 1, Country is ~3, Region ~6, City ~11, Street ~16. Current range is 1-16. Defaults to 16 if not specified.</param> /// <param name="placeId">A Flickr Places ID. (While optional, you must pass either a valid Places ID or a WOE ID.)</param> /// <param name="woeId">A Where On Earth (WOE) ID. (While optional, you must pass either a valid Places ID or a WOE ID.)</param> public void PhotosGeoBatchCorrectLocation(double latitude, double longitude, GeoAccuracy accuracy, string placeId, string woeId) { CheckRequiresAuthentication(); if (String.IsNullOrEmpty(placeId) && String.IsNullOrEmpty(woeId)) { throw new ArgumentException("You must pass either a placeId or a woeId"); } Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("method", "flickr.photos.geo.batchCorrectLocation"); parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("accuracy", accuracy.ToString("D")); parameters.Add("place_id", placeId); parameters.Add("woe_id", woeId); GetResponseNoCache <NoResponse>(parameters); }
public PlaceCollection PlacesFindByLatLon(double lat, double lon, GeoAccuracy accuracy) { var dictionary = new Dictionary<string, string>(); dictionary.Add("method", "flickr.places.findByLatLon"); dictionary.Add("lat", lat.ToString(NumberFormatInfo.InvariantInfo)); dictionary.Add("lon", lon.ToString(NumberFormatInfo.InvariantInfo)); if (accuracy != GeoAccuracy.None) dictionary.Add("accuracy", accuracy.ToString("d")); return GetResponse<PlaceCollection>(dictionary); }
/// <summary> /// Suggest a particular location for a photo. /// </summary> /// <param name="photoId">The id of the photo.</param> /// <param name="latitude">The latitude of the location to suggest.</param> /// <param name="longitude">The longitude of the location to suggest.</param> /// <param name="accuracy">The accuracy of the location to suggest.</param> /// <param name="woeId">The WOE ID of the location to suggest.</param> /// <param name="placeId">The Flickr place id of the location to suggest.</param> /// <param name="note">A note to add to the suggestion.</param> public void PhotosSuggestionsSuggestLocation(string photoId, double latitude, double longitude, GeoAccuracy accuracy, string woeId, string placeId, string note) { CheckRequiresAuthentication(); var parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.photos.suggestions.suggestLocation"); parameters.Add("photo_id", photoId); parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("accuracy", accuracy.ToString("D")); parameters.Add("place_id", placeId); parameters.Add("woe_id", woeId); parameters.Add("note", note); GetResponseNoCache<NoResponse>(parameters); }
/// <summary> /// Sets the geo location for a photo. /// </summary> /// <param name="photoId">The ID of the photo to set to location for.</param> /// <param name="latitude">The latitude of the geo location. A double number ranging from -180.00 to 180.00. /// Digits beyond 6 decimal places will be truncated.</param> /// <param name="longitude">The longitude of the geo location. A double number ranging from -180.00 to 180.00. /// Digits beyond 6 decimal places will be truncated.</param> /// <param name="accuracy">The accuracy of the photos geo location.</param> /// <param name="context">The context of the geolocation data, i.e. Inside or Outside.</param> public void PhotosGeoSetLocation(string photoId, double latitude, double longitude, GeoAccuracy accuracy, GeoContext context) { var parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.photos.geo.setLocation"); parameters.Add("photo_id", photoId); parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (accuracy != GeoAccuracy.None) parameters.Add("accuracy", accuracy.ToString("D")); if (context != GeoContext.NotDefined) parameters.Add("context", context.ToString("D")); GetResponseNoCache<NoResponse>(parameters); }
/// <summary> /// Return a list of photos for a user at a specific latitude, longitude and accuracy. /// </summary> /// <param name="latitude">The latitude whose valid range is -90 to 90. Anything more than 6 decimal places will be truncated.</param> /// <param name="longitude">The longitude whose valid range is -180 to 180. Anything more than 6 decimal places will be truncated.</param> /// <param name="accuracy">Recorded accuracy level of the location information. /// World level is 1, Country is ~3, Region ~6, City ~11, Street ~16. Current range is 1-16. /// Defaults to 16 if not specified.</param> /// <param name="extras"></param> /// <param name="perPage">Number of photos to return per page. If this argument is omitted, it defaults to 100. /// The maximum allowed value is 500.</param> /// <param name="page">The page of results to return. If this argument is omitted, it defaults to 1.</param> /// <returns></returns> public PhotoCollection PhotosGeoPhotosForLocation(double latitude, double longitude, GeoAccuracy accuracy, PhotoSearchExtras extras, int perPage, int page) { CheckRequiresAuthentication(); var parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.photos.geo.photosForLocation"); parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("accuracy", accuracy.ToString("D")); if (extras != PhotoSearchExtras.None) parameters.Add("extras", UtilityMethods.ExtrasToString(extras)); if (perPage > 0) parameters.Add("per_page", perPage.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (page > 0) parameters.Add("page", page.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); return GetResponseNoCache<PhotoCollection>(parameters); }
public void PushSubscribe(string topic, string callback, string verify, string verifyToken, int? leaseSeconds, IEnumerable<int> woeIds, IEnumerable<string> placeIds, double? lat, double? lon, int? radius, RadiusUnit radiusUnits, GeoAccuracy accuracy, IEnumerable<string> nsids, IEnumerable<string> tags) { var dictionary = new Dictionary<string, string>(); dictionary.Add("method", "flickr.push.subscribe"); dictionary.Add("topic", topic); dictionary.Add("callback", callback); dictionary.Add("verify", verify); if (verifyToken != null) dictionary.Add("verify_token", verifyToken); if (leaseSeconds != null) dictionary.Add("lease_seconds", leaseSeconds.ToString().ToLower()); if (woeIds != null) dictionary.Add("woe_ids", woeIds == null ? String.Empty : String.Join(",", woeIds.Select(d => d.ToString(CultureInfo.InvariantCulture)).ToArray())); if (placeIds != null) dictionary.Add("place_ids", placeIds == null ? String.Empty : String.Join(",", placeIds.ToArray())); if (lat != null) dictionary.Add("lat", lat.ToString().ToLower()); if (lon != null) dictionary.Add("lon", lon.ToString().ToLower()); if (radius != null) dictionary.Add("radius", radius.ToString().ToLower()); if (radiusUnits != RadiusUnit.None) dictionary.Add("radius_units", radiusUnits.ToString().ToLower()); if (accuracy != GeoAccuracy.None) dictionary.Add("accuracy", accuracy.ToString("d")); if (nsids != null) dictionary.Add("nsids", nsids == null ? String.Empty : String.Join(",", nsids.ToArray())); if (tags != null) dictionary.Add("tags", tags == null ? String.Empty : String.Join(",", tags.ToArray())); GetResponse<NoResponse>(dictionary); }
/// <summary> /// Sets the geo location for a photo. /// </summary> /// <param name="photoId">The ID of the photo to set to location for.</param> /// <param name="latitude">The latitude of the geo location. A double number ranging from -180.00 to 180.00. Digits beyond 6 decimal places will be truncated.</param> /// <param name="longitude">The longitude of the geo location. A double number ranging from -180.00 to 180.00. Digits beyond 6 decimal places will be truncated.</param> /// <param name="accuracy">The accuracy of the photos geo location.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public async Task<FlickrResult<NoResponse>> PhotosGeoSetLocationAsync(string photoId, double latitude, double longitude, GeoAccuracy accuracy) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.photos.geo.setLocation"); parameters.Add("photo_id", photoId); parameters.Add("lat", latitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); parameters.Add("lon", longitude.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); if (accuracy != GeoAccuracy.None) parameters.Add("accuracy", accuracy.ToString("D")); return await GetResponseAsync<NoResponse>(parameters); }
public void PhotosSuggestionsSuggestLocation(string photoId, double lat, double lon, GeoAccuracy accuracy, string woeId, string placeId, string note) { var dictionary = new Dictionary<string, string>(); dictionary.Add("method", "flickr.photos.suggestions.suggestLocation"); dictionary.Add("photo_id", photoId); dictionary.Add("lat", lat.ToString(NumberFormatInfo.InvariantInfo)); dictionary.Add("lon", lon.ToString(NumberFormatInfo.InvariantInfo)); if (accuracy != GeoAccuracy.None) dictionary.Add("accuracy", accuracy.ToString("d")); if (woeId != null) dictionary.Add("woe_id", woeId); if (placeId != null) dictionary.Add("place_id", placeId); if (note != null) dictionary.Add("note", note); GetResponse<NoResponse>(dictionary); }
public void PhotosGeoSetLocation(string photoId, double lat, double lon, GeoAccuracy accuracy, GeoContext context) { var dictionary = new Dictionary<string, string>(); dictionary.Add("method", "flickr.photos.geo.setLocation"); dictionary.Add("photo_id", photoId); dictionary.Add("lat", lat.ToString(NumberFormatInfo.InvariantInfo)); dictionary.Add("lon", lon.ToString(NumberFormatInfo.InvariantInfo)); if (accuracy != GeoAccuracy.None) dictionary.Add("accuracy", accuracy.ToString("d")); if (context != GeoContext.NotDefined) dictionary.Add("context", context.ToString("d")); GetResponse<NoResponse>(dictionary); }
public PhotoCollection PhotosGeoPhotosForLocation(double lat, double lon, GeoAccuracy accuracy, PhotoSearchExtras extras, int page, int perPage) { var dictionary = new Dictionary<string, string>(); dictionary.Add("method", "flickr.photos.geo.photosForLocation"); dictionary.Add("lat", lat.ToString(NumberFormatInfo.InvariantInfo)); dictionary.Add("lon", lon.ToString(NumberFormatInfo.InvariantInfo)); if (accuracy != GeoAccuracy.None) dictionary.Add("accuracy", accuracy.ToString("d")); if (extras != PhotoSearchExtras.None) dictionary.Add("extras", UtilityMethods.ExtrasToString(extras)); if (page != 0) dictionary.Add("page", page.ToString(CultureInfo.InvariantCulture)); if (perPage != 0) dictionary.Add("perPage", perPage.ToString(CultureInfo.InvariantCulture)); return GetResponse<PhotoCollection>(dictionary); }
public void PhotosGeoBatchCorrectLocation(double latitude, double longitude, GeoAccuracy accuracy, string placeId, string woeId) { var dictionary = new Dictionary<string, string>(); dictionary.Add("method", "flickr.photos.geo.batchCorrectLocation"); dictionary.Add("latitude", latitude.ToString(NumberFormatInfo.InvariantInfo)); dictionary.Add("longitude", longitude.ToString(NumberFormatInfo.InvariantInfo)); if (accuracy != GeoAccuracy.None) dictionary.Add("accuracy", accuracy.ToString("d")); if (placeId != null) dictionary.Add("place_id", placeId); if (woeId != null) dictionary.Add("woe_id", woeId); GetResponse<NoResponse>(dictionary); }