[英]How to get longitude/latitude from an URL using Google Place API or any JAVA API
I have an URL (of a restaurant or a place), and I want to get the location (latitude and longitude) of that place using any JAVA API. 我有一个(餐厅或地方的)URL,我想使用任何JAVA API来获取那个地方的位置(经度和纬度)。
With Google Place API, this is possible only after querying the system and giving a description of places we are searching for. 使用Google Place API,只有在查询系统并提供我们要搜索的位置的说明之后,才有可能。 But all what we have as input here is the URL.
但是,我们在此处输入的全部是URL。 This is why solutions given here and here are not responding to what I'm seeking for.
这就是为什么此处和此处给出的解决方案均未响应我所寻求的原因。
One solution could be to find the address by looking into Bottom Of home page (some sites put their address at footer) Find address from following pages linked to the main page Contact Us , About Us 一种解决方案是,通过查看首页底部来找到地址(某些网站的页脚位于其中)在链接到主页的后续页面中查找地址。 与我们联系 , 关于我们
None of the above approach is guaranteed to retrieve an address ...but is one step closer. 上面的方法都不能保证能检索到地址...但是更近一步。 Next option could be to lookup the whois to find the registered address.
下一个选择是查找Whois以查找注册地址。 If you are a paid user of lookup service you may be able to lookup address for a particular registrar.
如果您是查找服务的付费用户,则可以为特定注册商查找地址。 But then, there are registries that keeps the address hidden (my own website has the address hidden, it shows the address of service provider).... so not always a success.
但是,然后有一些注册表使地址保持隐藏状态(我自己的网站具有隐藏的地址,它显示了服务提供商的地址)....因此并不总是成功。
You can also lookup other services like Crunchbase , and any other directory service as a fallback. 您还可以查找其他服务(例如Crunchbase )和任何其他目录服务作为后备。
So , let's say we assume you are able to get address of 60-70% websites with all techniques mentioned above. 因此,假设我们假设您能够使用上述所有技术获得60-70%的网站地址。 There are situation, where you will end up getting multiple address.
在某些情况下,您最终将获得多个地址。 You should have a logic to resolve to a particular address.
您应该具有解析为特定地址的逻辑。 Just think of getting address of Pizza Hut from pizzahut.com :-)
只需考虑从pizzahut.com获取必胜客的地址:-)
You can add more intelligence...but hope this is good enough to get you started on right direction. 您可以添加更多的情报...但是希望这足够好,可以帮助您正确地开始工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.