use of com.flickr4java.flickr.photos.SearchParameters in project osm-contributor by jawg.
the class GetFlickrPhotos method doInBackground.
@Override
protected List<List<Size>> doInBackground(Void... params) {
// Create search tags list
ArrayList<String> searchTags = new ArrayList<String>(TAGS);
searchTags.add(new StringBuilder("osm:").append((featurePoi.getWay()) ? "way" : "node").append("=").append(featurePoi.getBackendId()).toString());
SearchParameters parameters = new SearchParameters();
parameters.setLatitude(String.valueOf(latitude));
parameters.setLongitude(String.valueOf(longitude));
parameters.setRadius(RADIUS);
parameters.setTags(searchTags.toArray(new String[searchTags.size()]));
parameters.setSort(SearchParameters.INTERESTINGNESS_DESC);
if (!isCancelled()) {
try {
PhotoList<Photo> photos = flickr.getPhotosInterface().search(parameters, limitPerPage, nbPage);
List<List<Size>> photosList = new ArrayList<>();
for (Photo photo : photos) {
photosList.add((List<Size>) flickr.getPhotosInterface().getSizes(photo.getId()));
}
return photosList;
} catch (FlickrException e) {
e.printStackTrace();
}
}
return null;
}
Aggregations