如何改善Google Places API中的照片的相关性

时间:2018-08-07 14:42:20

标签: google-places-api

我正在编写一个使用Google Places API来显示火车站照片的应用程序。不幸的是,第一张照片的主题有时并不重要。例如,如果我搜索“ Slaithwaite火车站”,则会得到火车站外自行车架的图片。如果我搜索“哈德斯菲尔德火车站”,则会得到售票机的照片,而不是火车站的精美外观。

我的查询示例:

  

https://maps.googleapis.com/maps/api/place/findplacefromtext/json?key=MYKEY&input=slaithwaite%20train%20station&type=train_station&inputtype=textquery&locationbias=point:53.603185,-1.93075&fields=place_id,name,formatted_address,types,photos

 {
   "candidates" : [
      {
         "formatted_address" : "Slaithwaite, Huddersfield HD7 5EF, United Kingdom",
         "name" : "Slaithwaite",
         "photos" : [
            {
               "height" : 768,
               "html_attributions" : [
                  "\u003ca href=\"https://maps.google.com/maps/contrib/110133644218180648677/photos\"\u003eJohn De L\u003c/a\u003e"
               ],
               "photo_reference" : 
"CmRaAAAACqCwi4Malz1DgLEYzEqKck75NJVnjOewUjmThmNypDtKHkYIRP_TaClw9EJBAXXDX4mJby0Zovf1RLnyPheBA3MtHeFAUx_ZEJq0sbKoPWxbwhNmg2YVqxgR7oYcm_GrEhAreyPneTGXuWhNv__tMUwlGhQkGX1LQOocZcfdymfmntIhwDNSXA",
               "width" : 1024
            }
         ],
         "place_id" : "ChIJ98gMWL3Ee0gRWZOqK8g9RkU",
         "types" : [
           "train_station",
           "transit_station",
           "point_of_interest",
           "establishment"
         ]
      }
   ],
}

给我一​​张bicycle rack的照片

除了自己整理照片之外,还有没有办法获得像样的照片?

(我发现a similar question去年问过,但没有答案或评论)。

0 个答案:

没有答案
相关问题