Flickr Geo 查询不返回任何数据

发布于 2024-09-09 18:27:34 字数 881 浏览 3 评论 0原文

我无法让 Flickr API 返回任何纬度/经度查询数据。

查看源:http://api.flickr.com/services/rest/?method=flickr.photos.search&media=photo&api_key=KEY_HERE&has_geo=1&extras= geo&bbox=0,0,180,90

这应该返回一些东西,任何东西。如果我使用纬度/经度也不起作用。如果我首先查找 place_id 然后在查询中使用它,我可以获得一些返回的照片,除非返回的所有照片都来自任何地方而不是地点 id

例如,

http://api.flickr.com/services/rest/?method= flickr.photos.search&media=photo&api_key=KEY_HERE&placeId=8iTLPoGcB5yNDA19yw

我显然删除了我的密钥,用你的替换来测试。

任何帮助表示赞赏,我对此感到生气。

I cannot get the Flickr API to return any data for lat/lon queries.

view-source:http://api.flickr.com/services/rest/?method=flickr.photos.search&media=photo&api_key=KEY_HERE&has_geo=1&extras=geo&bbox=0,0,180,90

This should return something, anything. Doesn't work if I use lat/lng either. I can get some photos returned if I lookup a place_id first and then use that in the query, except then all the photos returned are from anywhere and not the place id

Eg,

http://api.flickr.com/services/rest/?method=flickr.photos.search&media=photo&api_key=KEY_HERE&placeId=8iTLPoGcB5yNDA19yw

I deleted out my key obviously, replace with yours to test.

Any help appreciated, I am going mad over this.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱要勇敢去追 2024-09-16 18:27:34

我相信,如果您不在查询中添加其他搜索词,Flickr API 将不会返回任何结果。如果我记得文档中的内容,这被视为无界搜索。以下是文档中的引用:

地理查询需要某种限制代理以防止数据库崩溃。这基本上类似于对没有地理组件的查询进行“无参数搜索”检查。

例如,标签被视为限制代理,用户定义的 min_date_taken 和 min_date_upload 参数也是如此 — 如果没有传递限制因素,我们将仅返回过去 12 小时内添加的照片(尽管我们将来可能会扩展限制)。

我的应用程序使用相同类型的地理搜索,因此我所做的就是添加一个最短日期的附加搜索词,如下所示:

http://api.flickr.com/services/rest/?method=flickr.photos.search&media=photo&api_key=KEY_HERE&has_geo=1&extras=geo&bbox=0,0,180,90&min_taken_date=2005-01-01 00:00:00

哦,不要忘记签署您的请求并填写 api_sig 字段。我的经验是,除非您附加 api_key 并签署您的搜索,否则基于地理的搜索行为不会一致。例如,我有时会得到搜索结果,然后当我没有签署查询时,使用相同的搜索不会得到图像。

I believe that the Flickr API won't return any results if you don't put additional search terms in your query. If I recall from the documentation, this is treated as an unbounded search. Here is a quote from the documentation:

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.

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).

My app uses the same kind of geo searching so what I do is put in an additional search term of the minimum date taken, like so:

http://api.flickr.com/services/rest/?method=flickr.photos.search&media=photo&api_key=KEY_HERE&has_geo=1&extras=geo&bbox=0,0,180,90&min_taken_date=2005-01-01 00:00:00

Oh, and don't forget to sign your request and fill in the api_sig field. My experience is that the geo based searches don't behave consistently unless you attach your api_key and sign your search. For example, I would sometimes get search results and then later with the same search get no images when I didn't sign my query.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文