如何从给定经纬度矩形的谷歌地图中提取卫星图像?
如何从给定经纬度矩形的谷歌地图中提取卫星图像? (或者,形成边界框的两个(纬度,经度)点)。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
如何从给定经纬度矩形的谷歌地图中提取卫星图像? (或者,形成边界框的两个(纬度,经度)点)。
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
在我看来,你的问题听起来像是你想提取 Google 地图上使用的原始卫星图块。这是违反使用条款的,如果您坚持这样做,我很确定您会被阻止使用该服务,所以...不要;)
相反,请使用 静态地图 API。如果您不想计算
center
和zoom
参数的值,则可以使用visible
参数,如下所示:http://maps.googleapis.com/maps/api/staticmap?sensor=false&size=640x400&maptype=satellite&visible=29.64,-13.09& ;可见=27.38,-18.53&标记=颜色:红色%7C颜色:红色%7C标签:A%7C27.38,-18.53&标记=颜色:红色%7C颜色:红色%7C标签:B%7C29.64,- 13.09
请记住,
visible
参数(您可以提供两个以上的值)不保证地图的角点位于其中任何一个角点上。它们将是可见的,这通常意味着除了它们之间的区域之外,地图还将包括它们周围的一些区域。这是图像:Your question sounds to me like you want to extract the raw satellite tiles used on Google Maps. That's against the Terms of Use and if you insist in doing I'm pretty sure you'll get blocked out of the service, so... don't ;)
Instead, use the Static Maps API as Mano points out. If you don't want to compute the values from the
center
andzoom
parameters, you can use thevisible
parameter like this:http://maps.googleapis.com/maps/api/staticmap?sensor=false&size=640x400&maptype=satellite&visible=29.64,-13.09&visible=27.38,-18.53&markers=color:red%7Ccolor:red%7Clabel:A%7C27.38,-18.53&markers=color:red%7Ccolor:red%7Clabel:B%7C29.64,-13.09
Bear in mind the
visible
parameter (of which you can provide more than two values) does not guarantee that the corners of the map will be on any of them. They will be visible, which often means the map will include some area around them, in addition to the area among them. Here's is the image:如何使用 Google 地图静态 API 提取地形(卫星)、道路等地图?
您需要一个 Google 帐户 &一个 API_KEY 来使用 google 地图静态 API
登录您的 google 帐户
登录后打开另一个选项卡并浏览 google 开发者控制台。
https://console.developers.google.com
创建或使用现有 API 密钥
4.1 进入控制台仪表板后,导航至
“启用 API 并获取密钥等凭证”
4.2 在 API 管理器选项卡中,选择凭据
4.3 进入“凭据”菜单后,选择“添加凭据”并在下拉列表中选择 API 密钥
4.4 在下一个菜单中选择密钥类型为浏览器
4.5 为您的密钥提供名称并单击“创建”。
4.6 复制密钥值并在对 google 地图 API 的所有请求中使用它
转到 Google 地图静态 API for google 开发人员文档。
https://developers.google.com/maps/文档/静态地图/介绍?hl=en
本文档解释了您需要了解的有关地图 API 的所有信息
Google Maps API 是一项 Web 服务,我们可以使用以下示例中显示的 URL 来调用它。使用该 URL 和您的 API_KEY 获取纽约市地图
Google 静态地图 API 服务网址
https://maps.googleapis.com/maps/api/staticmap?parameters< /a>
将参数替换为您首选的位置参数和位置参数。您的 API 密钥
<一href="https://maps.googleapis.com/maps/api/staticmap?center=布鲁克林+大桥,纽约+纽约,NY&zoom=13&size=600x300&maptype=roadmap&markers=color:blue%7Cl abel:S%7C40.702147,-74.015794&标记=颜色:绿色%7Clabel:G%7C40.711614,-74.012318&标记=颜色:红色%7Clabel:C%7C40.718217,-73.998284&key= YOUR_API_KEY” rel="noreferrer">https://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap&markers=color:蓝色%7Cl abel:S%7C40.702147,-74.015794&标记=颜色:绿色%7Clabel:G%7C40.711614,-74.012318& amp;markers=color:red%7Clabel:C%7C40.718217,-73.998284&key=YOUR_API_KEY
查找您首选位置的“中心”等参数
前往谷歌地图
https://www.google.lk/maps
使用城市名称、道路或其他重要位置信息搜索您喜欢的位置。我已经找到了我的家乡主要路口“Kurunegala Junction”
在谷歌地图上找到位置后,将浏览网址复制到文本文件中
https://www.google.lk/maps/place/Kurunegala+Junction/@7.480785,80.3402663,14z/data=!4m2!3m1!1s0x0000000000000000:0x4ef85a8455d1d21c
< /里>
在复制的 URL 中,复制经度和经度。纬度插入 Google 静态地图 API URL,如下面的 URL 所示(需要尺寸参数)
https://maps.googleapis.com/maps/api/staticmap?center=7.480785,80.3402663&zoom=12&size=400x400&key=YOUR_API_KEY
现在用所需的其他参数修改上述 URL
如果你想要地形和路线图,请将参数“maptype”设置为混合
https://maps.googleapis.com/maps/api/staticmap?center=7.480785,80.3402663&zoom=12&size=400x400&maptype=hybrid&key=YOUR_API_KEY
要获取可用参数的列表,请参阅 Google 地图静态 API 文档。
https://developers.google.com/maps/文档/静态地图/介绍?hl=en
How to use Google maps static API to extract a Terrain(Satellite), Road,...etc map?
You need a google account & an API_KEY to use the google maps static API
Login to your google account
After login open another tab and browse the google developer console.
https://console.developers.google.com
Create or use an existing API key
4.1 Once you are in the console dashboard, navigate to
“Enable APIs and get credentials like keys”
4.2 In the API manager tab, select Credentials
4.3 Once you are in the Credentials menu, select “Add credentials” and select API key in the drop down
4.4 In the next menu select key type as Browser
4.5 Provide a name to your key and click create.
4.6 Copy the key value and use it in all request to google maps API
Go to Google maps static API for google developers documentation.
https://developers.google.com/maps/documentation/static-maps/intro?hl=en
This documentation explains everything you need to know about the maps API
The Google Maps API is a web service that we can call by using a URL shown in the following example. Use the URL with your API_KEY to get the map of New York city
Google Static Map API Service URL
https://maps.googleapis.com/maps/api/staticmap?parameters
Replace the parameters with your prefered location parameters & your API key
https://maps.googleapis.com/maps/api/staticmap?center=Brooklyn+Bridge,New+York,NY&zoom=13&size=600x300&maptype=roadmap&markers=color:blue%7Clabel:S%7C40.702147,-74.015794&markers=color:green%7Clabel:G%7C40.711614,-74.012318&markers=color:red%7Clabel:C%7C40.718217,-73.998284&key=YOUR_API_KEY
To find the parameters like “center” for your preferred location
Go to google maps
https://www.google.lk/maps
Search for your prefered location with name of a city, road or another significant location information. I have searched for my home town main junction “Kurunegala Junction”
Once you have found the location on google maps, copy the browse URL into text file
https://www.google.lk/maps/place/Kurunegala+Junction/@7.480785,80.3402663,14z/data=!4m2!3m1!1s0x0000000000000000:0x4ef85a8455d1d21c
In the copied URL, copy the Longitude & Latitude into the Google static map API URL as depicted in the below URL(size parameter is required)
https://maps.googleapis.com/maps/api/staticmap?center=7.480785,80.3402663&zoom=12&size=400x400&key=YOUR_API_KEY
Now modify the above URL with other parameters that are required
If you want both terrain and roadmap, set the parameter “maptype” as hybrid
https://maps.googleapis.com/maps/api/staticmap?center=7.480785,80.3402663&zoom=12&size=400x400&maptype=hybrid&key=YOUR_API_KEY
To get a list of available parameters, refer the google map static API documentation.
https://developers.google.com/maps/documentation/static-maps/intro?hl=en
您可以使用 Google 静态地图 API。您只需要一对经纬度作为中心并设置图像的缩放和大小。它是您可以放置在网页中的一个 URL。
You can use the Google Static Maps API. You just need one Lat Long pair for the center and set the zoom and size of image. It's one URL that you can place in your web page.
尝试使用:
网址
结果
您可以在应用程序中更改 lat、lng 参数 =)。
添加您的关键 API。
https://maps.googleapis.com/maps/api/staticmap?center=17.053828,+-96.700116&zoom=17&scale=1&size=600x300&maptype=satellite&format=png&visual_refresh= true&key=YOUR_KEY_API
链接:
try with:
URL
Result
you can change lat, lng params in your app =).
Add your key API.
https://maps.googleapis.com/maps/api/staticmap?center=17.053828,+-96.700116&zoom=17&scale=1&size=600x300&maptype=satellite&format=png&visual_refresh=true&key=YOUR_KEY_API
Links: