Find a place description in Freebase using latitude and longitude?

雨燕双飞 提交于 2019-12-11 19:28:31

问题


I'm receiving lat and long data from Google Maps and I want to send that along to Freebase to get a description of the relevant place.

There's a geocode schema (http://www.freebase.com/location/geocode?schema=) but it seems like you have to to enter them separately?

I'd like to, let's say using the lat / long of Berlin, get the following description from Freebase: http://www.freebase.com/m/0156q

Would love any help, thank you.


回答1:


If you convert your point to a small bounding box, you could get the Freebase data for all topics included in the bounding box like this:

[{
  "id": null,
  "name": null,
  "/location/location/geolocation": [{
    "latitude>=": 52.5,
    "latitude<=": 52.6,
    "latitude": null,
    "longitude>=": 13.38,
    "longitude<=": 13.39,
    "longitude": null
  }]
}]

You can make your bounding box arbitrarily small, but remember that for something like a city, the point probably represents something like the centroid while the actual bounds will be much larger. If you expand to the city limits, your search will, of course, return all the churches, stadiums, pubs, etc which are located within the city. You can add additional filters to only return certain types of entities if that helps for your purposes.



来源:https://stackoverflow.com/questions/22469936/find-a-place-description-in-freebase-using-latitude-and-longitude

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!