PhotosGetPhotosForLocationAsync not returning any results.

Topics: Developer Forum
Oct 18, 2013 at 4:32 AM

I'm trying to get a list of photos related to one location and this is the only method I found. I tried GeoAccuracy.Region and City too, but to no avail. The mLatitude and mLongitude are values retrieved from a PhotoInfo.Location object and I make sure they are valid before reaching this code. The values of mPerPage is 10 and for mCountryPage is 1. The call never returns an error, just an empty collection. Tried it with a whole bunch of locations, and nothing. Am I doing something wrong? I used the only GeoAccuracy values I understood, maybe there are some other values I should try? Any help would be appreciated.

flickr.PhotosGeoPhotosForLocationAsync(mLatitude, mLongitude, GeoAccuracy.Country, PhotoSearchExtras.All, mPerPage, mCountryPage, (result) =>             {
                  if (result.HasError || result.Result == null || result.Result.Count == 0)  {
                           //Show error message
Oct 18, 2013 at 4:16 PM
Try an accuracy of Street to see if that works.

Oct 21, 2013 at 5:29 AM
Edited Oct 21, 2013 at 5:31 AM
Well, I didn't try Street accuracy to be honest, but I did find a way to make it work, only I don't use the above mentioned call, I use PhotoSearchAsync instead. Here it is, in case some one else needs such functionality:
Flickr flickr = new Flickr(App.KEY, App.SECRET, token);
PhotoSearchOptions opt = new PhotoSearchOptions();
opt.Accuracy = GeoAccuracy.Region;
opt.Latitude = mLatitude;
opt.Longitude = mLongitude;
opt.Extras = PhotoSearchExtras.All;
opt.PerPage = mPerPage;
opt.Page = mPage;
flickr.PhotosSearchAsync(opt, (result) =>
I tested this code successfully with GeoAccuracy.City, GeoAccuracy.Region and GeoAccuracy.Country. I guess the others will work as well.

Forgot to mention that I'm using FlickrNet
Oct 21, 2013 at 10:41 AM
You can also add the Radius parameter to expand the range for which you can return photos.

I always user Street, as this returns all images, irrespective of accuracy, whereas anything else only returns photos with that accuracy and upwards (at least I think that's how it works).