简体   繁体   English

如何在Freebase中搜索建筑物附近的地点?

[英]How to search places near a building in freebase?

I'm made a web crawler that crawls into hotels websites and save Hotel name, hotel address and other stuff in a csv. 我制作了一个网络爬虫,可以爬入酒店网站并将酒店名称,酒店地址和其他内容保存在csv中。 After the csv is complete, I'd like to find attractions near the hotels, and to accomplish that I have to use Google Freebase and I can use the fields "Hotel Name" and "Hotel Address". CSV完成后,我想在酒店附近找到景点,并且要完成操作,必须使用Google Freebase,并且可以使用“酒店名称”和“酒店地址”字段。 Looking inside the google documentations, the best thing I found is: 查阅google文档,我发现最好的是:

filter=(all type:restaurant (within radius:1000ft lon:-122.39 lat:37.7955))

This should search all restaurants in a radius of 1000ft, given lon and lat coordinates. 给定经度和纬度坐标,这将搜索半径1000英尺范围内的所有餐馆。 So I should need something that, given the hotel name or the hotel address, returns me the geolocation of the building, or a way to build the query passing as parameters a street instead of geolocation. 因此,在给定酒店名称或酒店地址的情况下,我应该需要一些能够为我返回建筑物地理位置的信息,或者一种通过以街道而不是地理位置作为参数传递来构建查询的方法。

Further searches didn't solve the clue. 进一步的搜索并没有找到线索。

You could use the Google Maps API to geocode the address: https://developers.google.com/maps/documentation/geocoding/ 您可以使用Google Maps API对地址进行地理编码: https : //developers.google.com/maps/documentation/geocoding/

Really any geocoding solution would work as that would give you the longitude and latitude. 实际上,任何地理编码解决方案都可以使用,因为它可以为您提供经度和纬度。

I had similar need to get the geolocation in the results. 我也有类似的需要在结果中获得地理位置。

Here , I found that example: 在这里 ,我找到了这个例子:

filter=(all type:restaurant (within radius:1000ft lon:-122.39 lat:37.7955))
&output=(geocode)

And luckily, it works. 幸运的是,它有效。

But frankly, those Semantic Web tools are SO rich/vast that it's really difficult to build queries. 但是坦率地说,那些语义Web工具是如此丰富/丰富,以至于很难构建查询。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM