用于基于位置的图像的Flickr API [英] Flickr API for location based images

查看:210
本文介绍了用于基于位置的图像的Flickr API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望在iOS中的搜索字段中输入城市名称时获取城市图像。我正在使用flickr API,但每当我输入任何经度和纬度值时,我只返回一个空数组。我该怎么办。我正在使用此网址:

I want to get images of cities when city name is entered in search field in iOS. I am using flickr API but whenever I enter any longitude and latitude values, I only get returned an empty array. What should I do. I am using this URL:

http://api.flickr.com/services /rest/?method=flickr.photos.geo.photosForLocation&api_key=e3d577010e5979a2ad2a22714abd901e&lat=40.6700&lon=73.9400&format=json&nojsoncallback=1&auth_token=72157638668602974-e1a3a3aa1e6d3dd8&api_sig=a0233b016c863b1662aeb21a664c351a

请告诉我该怎么办。任何帮助赞赏

Please tell me what should I do. any help appreciated

推荐答案

我怀疑你在lat-long上寻找太精确的匹配。使用 & accuracy 参数指定不太精确的匹配。 (默认值16指定非常精确的匹配。)Flickr建议值为11以匹配城市级别,因此添加

I suspect that you are seeking too precise a match on your lat-long. Use the &accuracy parameter to specify a less precise match. (The default value of 16 specifies a very precise match.) Flickr suggests a value of 11 to match at the city level, so add

&accuracy=11

到您的网址。

更新

我没有运气用flickr.photos.geo.photosForLocation检索图片,但我检索了图片通过lat-long与 flickr.photos.search 。请注意文档中的这条评论:

I have not had any luck retrieving images with flickr.photos.geo.photosForLocation, but I have retrieved images by lat-long with flickr.photos.search. Note this comment in the documentation:


Geo查询需要某种限制代理,以防止
数据库哭泣。对于没有地理组件的查询,这基本上类似于对
无参数搜索的检查。

Geo queries require some sort of limiting agent in order to prevent the database from crying. This is basically like the check against "parameterless searches" for queries without a geo component.

例如,标签被视为限制代理,因为user
定义了min_date_taken和min_date_upload参数 - 如果没有限制
因子通过,我们只返回过去12小时内添加的照片
(尽管我们可能会在未来扩展限制)。

A tag, for instance, is considered a limiting agent as are user defined min_date_taken and min_date_upload parameters — If no limiting factor is passed we return only photos added in the last 12 hours (though we may extend the limit in the future).

还要记住西半球的经度被指定为负数。

Also remember that longitudes of places in the Western Hemisphere are specified as negative numbers.

这篇关于用于基于位置的图像的Flickr API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆