简体   繁体   English

如何使用Google Place API或任何JAVA API从URL获取经度/纬度

[英]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.

相关问题 如何使用纬度,经度和半径(距离)将区域划分为更小尺寸的区域,在Google中使用Java搜索API? - How to divide the region into smaller size regions using latitude, longitude and radius(distance), in Google place Search API in Java? Google Places API:如何从纬度和经度中获取照片并放置ID? - Google Places API: How to get photos and place id from latitude and longitude? 如何使用 Google 的 GeoCoder Java Client 获取特定地点的经度和纬度? - How can I get the longitude and latitude of a specific place using Google's GeoCoder Java Client? 使用Java从Android Studio中的Google Geocoding API获取经度和纬度值 - Get Longitude and Latitude values from Google Geocoding API in Android Studio with Java 如何从谷歌地图 URL 获取纬度经度 - How to get latitude longitude from google map URL 如何在Java中使用经度和纬度获取位置? - how to get location using Latitude and Longitude in java? 如何使用经度和纬度获取位置ID? - How do I get place id using latitude and longitude? 从 URL Google Maps 获取经纬度 - Get latitude-longitude from URL Google Maps 如何从“ http://api.wunderground.com”获取经纬度的天气信息 - How to get weather info by Latitude & longitude from “http://api.wunderground.com” 如何从SnapToRoads API请求纬度和经度数据? - How can I request the latitude and longitude data from SnapToRoads API?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM