/// <summary> /// Return a list of the top 100 unique places clustered by a given placetype for set of tags or machine tags. /// </summary> /// <param name="placeType">The ID for a specific place type to cluster photos by. </param> /// <param name="woeId">A Where on Earth identifier to use to filter photo clusters. </param> /// <param name="placeId">A Flickr Places identifier to use to filter photo clusters. </param> /// <param name="boundaryBox">The boundary box to search for places in.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public async Task <FlickrResult <PlaceCollection> > PlacesPlacesForBoundingBoxAsync(PlaceType placeType, string woeId, string placeId, BoundaryBox boundaryBox) { Dictionary <string, string> parameters = new Dictionary <string, string>(); parameters.Add("method", "flickr.places.placesForBoundingBox"); parameters.Add("place_type_id", placeType.ToString("D")); if (!String.IsNullOrEmpty(woeId)) { parameters.Add("woe_id", woeId); } if (!String.IsNullOrEmpty(placeId)) { parameters.Add("place_id", placeId); } parameters.Add("bbox", boundaryBox.ToString()); return(await GetResponseAsync <PlaceCollection>(parameters)); }
/// <summary> /// Return a list of the top 100 unique places clustered by a given placetype for set of tags or machine tags. /// </summary> /// <param name="placeType">The ID for a specific place type to cluster photos by. </param> /// <param name="woeId">A Where on Earth identifier to use to filter photo clusters. </param> /// <param name="placeId">A Flickr Places identifier to use to filter photo clusters. </param> /// <param name="boundaryBox">The boundary box to search for places in.</param> /// <returns></returns> public PlaceCollection PlacesPlacesForBoundingBox(PlaceType placeType, string woeId, string placeId, BoundaryBox boundaryBox) { var parameters = new Dictionary <string, string>(); parameters.Add("method", "flickr.places.placesForBoundingBox"); parameters.Add("place_type_id", placeType.ToString("D")); if (!string.IsNullOrEmpty(woeId)) { parameters.Add("woe_id", woeId); } if (!string.IsNullOrEmpty(placeId)) { parameters.Add("place_id", placeId); } parameters.Add("bbox", boundaryBox.ToString()); return(GetResponseCache <PlaceCollection>(parameters)); }
/// <summary> /// Return a list of the top 100 unique places clustered by a given placetype for set of tags or machine tags. /// </summary> /// <param name="placeType">The ID for a specific place type to cluster photos by. </param> /// <param name="woeId">A Where on Earth identifier to use to filter photo clusters. </param> /// <param name="placeId">A Flickr Places identifier to use to filter photo clusters. </param> /// <param name="boundaryBox">The boundary box to search for places in.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PlacesPlacesForBoundingBoxAsync(PlaceType placeType, string woeId, string placeId, BoundaryBox boundaryBox, Action <FlickrResult <PlaceCollection> > callback) { var parameters = new Dictionary <string, string>(); parameters.Add("method", "flickr.places.placesForBoundingBox"); parameters.Add("place_type_id", placeType.ToString("D")); if (!string.IsNullOrEmpty(woeId)) { parameters.Add("woe_id", woeId); } if (!string.IsNullOrEmpty(placeId)) { parameters.Add("place_id", placeId); } parameters.Add("bbox", boundaryBox.ToString()); GetResponseAsync <PlaceCollection>(parameters, callback); }
/// <summary> /// Takes the various properties of this instance and adds them to a <see cref="Dictionary{K,V}"/> instanced passed in, ready for sending to Flickr. /// </summary> /// <param name="parameters">The <see cref="Dictionary{K,V}"/> to add the options to.</param> public void AddToDictionary(Dictionary <string, string> parameters) { if (!string.IsNullOrEmpty(UserId)) { parameters.Add("user_id", UserId); } if (!string.IsNullOrEmpty(GroupId)) { parameters.Add("group_id", GroupId); } if (!string.IsNullOrEmpty(Text)) { parameters.Add("text", Text); } if (!string.IsNullOrEmpty(Tags)) { parameters.Add("tags", Tags); } if (TagMode != TagMode.None) { parameters.Add("tag_mode", UtilityMethods.TagModeToString(TagMode)); } if (!string.IsNullOrEmpty(MachineTags)) { parameters.Add("machine_tags", MachineTags); } if (MachineTagMode != MachineTagMode.None) { parameters.Add("machine_tag_mode", UtilityMethods.MachineTagModeToString(MachineTagMode)); } if (MinUploadDate != DateTime.MinValue) { parameters.Add("min_upload_date", UtilityMethods.DateToUnixTimestamp(MinUploadDate).ToString()); } if (MaxUploadDate != DateTime.MinValue) { parameters.Add("max_upload_date", UtilityMethods.DateToUnixTimestamp(MaxUploadDate).ToString()); } if (MinTakenDate != DateTime.MinValue) { parameters.Add("min_taken_date", UtilityMethods.DateToMySql(MinTakenDate)); } if (MaxTakenDate != DateTime.MinValue) { parameters.Add("max_taken_date", UtilityMethods.DateToMySql(MaxTakenDate)); } if (Licenses.Count != 0) { var licenseArray = new List <string>(); foreach (var license in Licenses) { licenseArray.Add(license.ToString("d")); } parameters.Add("license", String.Join(",", licenseArray.ToArray())); } 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)); } if (Extras != PhotoSearchExtras.None) { parameters.Add("extras", ExtrasString); } if (SortOrder != PhotoSearchSortOrder.None) { parameters.Add("sort", SortOrderString); } if (PrivacyFilter != PrivacyFilter.None) { parameters.Add("privacy_filter", PrivacyFilter.ToString("d")); } if (BoundaryBox != null && BoundaryBox.IsSet) { parameters.Add("bbox", BoundaryBox.ToString()); } if (Accuracy != GeoAccuracy.None) { parameters.Add("accuracy", Accuracy.ToString("d")); } if (SafeSearch != SafetyLevel.None) { parameters.Add("safe_search", SafeSearch.ToString("d")); } if (ContentType != ContentTypeSearch.None) { parameters.Add("content_type", ContentType.ToString("d")); } if (HasGeo != null) { parameters.Add("has_geo", HasGeo.Value ? "1" : "0"); } if (Latitude != null) { parameters.Add("lat", Latitude.Value.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); } if (Longitude != null) { parameters.Add("lon", Longitude.Value.ToString(System.Globalization.NumberFormatInfo.InvariantInfo)); } if (Radius != null) { parameters.Add("radius", Radius.Value.ToString("0.00000", System.Globalization.NumberFormatInfo.InvariantInfo)); } if (RadiusUnits != RadiusUnit.None) { parameters.Add("radius_units", (RadiusUnits == RadiusUnit.Miles ? "mi" : "km")); } if (Contacts != ContactSearch.None) { parameters.Add("contacts", (Contacts == ContactSearch.AllContacts ? "all" : "ff")); } if (WoeId != null) { parameters.Add("woe_id", WoeId); } if (PlaceId != null) { parameters.Add("place_id", PlaceId); } if (IsCommons) { parameters.Add("is_commons", "1"); } if (InGallery) { parameters.Add("in_gallery", "1"); } if (IsGetty) { parameters.Add("is_getty", "1"); } if (MediaType != MediaType.None) { parameters.Add("media", UtilityMethods.MediaTypeToString(MediaType)); } if (GeoContext != GeoContext.NotDefined) { parameters.Add("geo_context", GeoContext.ToString("d")); } if (Faves) { parameters.Add("faves", "1"); } if (PersonId != null) { parameters.Add("person_id", PersonId); } if (Camera != null) { parameters.Add("camera", Camera); } if (JumpTo != null) { parameters.Add("jump_to", JumpTo); } }
public PlaceCollection PlacesPlacesForBoundingBox(BoundaryBox bbox, PlaceType placeType, int? placeTypeId, bool? recursive) { var dictionary = new Dictionary<string, string>(); dictionary.Add("method", "flickr.places.placesForBoundingBox"); dictionary.Add("bbox", bbox.ToString().ToLower()); if (placeType != PlaceType.None) dictionary.Add("place_type", placeType.ToString().ToLower()); if (placeTypeId != null) dictionary.Add("place_type_id", placeTypeId.ToString().ToLower()); if (recursive != null) dictionary.Add("recursive", recursive.Value ? "1" : "0"); return GetResponse<PlaceCollection>(dictionary); }
/// <summary> /// Return a list of the top 100 unique places clustered by a given placetype for set of tags or machine tags. /// </summary> /// <param name="placeType">The ID for a specific place type to cluster photos by. </param> /// <param name="woeId">A Where on Earth identifier to use to filter photo clusters. </param> /// <param name="placeId">A Flickr Places identifier to use to filter photo clusters. </param> /// <param name="boundaryBox">The boundary box to search for places in.</param> /// <returns></returns> public PlaceCollection PlacesPlacesForBoundingBox(PlaceType placeType, string woeId, string placeId, BoundaryBox boundaryBox) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.places.placesForBoundingBox"); parameters.Add("place_type_id", placeType.ToString("D")); if (!String.IsNullOrEmpty(woeId)) parameters.Add("woe_id", woeId); if (!String.IsNullOrEmpty(placeId)) parameters.Add("place_id", placeId); parameters.Add("bbox", boundaryBox.ToString()); return GetResponseCache<PlaceCollection>(parameters); }
/// <summary> /// Return a list of the top 100 unique places clustered by a given placetype for set of tags or machine tags. /// </summary> /// <param name="placeType">The ID for a specific place type to cluster photos by. </param> /// <param name="woeId">A Where on Earth identifier to use to filter photo clusters. </param> /// <param name="placeId">A Flickr Places identifier to use to filter photo clusters. </param> /// <param name="boundaryBox">The boundary box to search for places in.</param> /// <param name="callback">Callback method to call upon return of the response from Flickr.</param> public void PlacesPlacesForBoundingBoxAsync(PlaceType placeType, string woeId, string placeId, BoundaryBox boundaryBox, Action<FlickrResult<PlaceCollection>> callback) { Dictionary<string, string> parameters = new Dictionary<string, string>(); parameters.Add("method", "flickr.places.placesForBoundingBox"); parameters.Add("place_type_id", placeType.ToString("D")); if (!String.IsNullOrEmpty(woeId)) parameters.Add("woe_id", woeId); if (!String.IsNullOrEmpty(placeId)) parameters.Add("place_id", placeId); parameters.Add("bbox", boundaryBox.ToString()); GetResponseAsync<PlaceCollection>(parameters, callback); }