图像缩略图

get_google_map.

版本1.4.0.0(7.62 kB) Val Schmidt.
使用静态谷歌地图API从命令行检索Google Map。

10.9k下载

Updated2016年3月25日

查看许可证

函数get_google_map.m使用谷歌地图API(https://developers.google.com/maps/documentation/static-maps/)从Google给定图像中心的坐标和所需的缩放级别(默认为15),检索Google Map图像。图像作为光栅阵列和颜色图返回。
In addition, an estimate of the X and Y coordinate vectors are returned in UTM coordinates to facilitate easy plotting of additional information on the map from within MATLAB.
可以指定图像(以像素为单位)的所需高度和宽度以及“MapType”(路线图,移动,卫星,地形,混合动力,MapMaker-RoadMap,MapMaker-Hybrid)以及最多50个谷歌地图标记。对于每个标记,可以指定位置,大小,颜色和可选标签。
默认值:缩放15,maptype ='卫星',高度= 640,宽度= 640
One may utilize the Google Maps API without a key for a limited number of queries per day. To utilize the Google Maps API up to 25,000 queries per day, one must obtain a Google Maps API Key, freely available from Google. The key may be obtained here:https://developers.google.com/maps/documentation/static-maps/(点击“得到一个键”)

注意,关键限制要求的地方e portability of this function, as the key, and therefore the function is necessarily tied to a domain name and therefore (usually) a physical location. None-the-less it remains a very handy function for quickly plotting data on a map.

The following code produce the attached screenshot:

[xx yy m m mcolor] = get_google_map(43.06374,-70.703993);
ImagesC(XX,YY,M);遮阳平;Colormap(Mcolor)
Xlabel('Eastings Utm')
ylabel('nortingum')
title('Entrance to Portsmouth Harbor')

已知的问题:
1) The estimate of the X and Y coordinate vectors are just that, a guess at an algorithm for determining these values from the images size and zoom level. The algorithm was determined by trial and error (as the API provides no way to query for the spacial bounds of an image), and therefore will likely produce poor results for some locations. In the vicinity of Portsmouth Harbor, NH the resulting image is geo-referenced to about +/- 3m.

2)由于MATLAB在MAC平台上的渲染性能不佳,我的经验是绘制的地图,如上面的例子中产生的白色间隙,其原因和分辨率未知。

引用

Val Schmidt(2021)。get_google_map.(//www.tatmou.com/matlabcentral/fileexchange/24113-get_google_map),matlab中央文件交换。检索到

马铃薯草Release Compatibility
用R2009A创建
Compatible with any release
平台兼容性
Windows 苹果系统 Linux.

社区宝藏狩猎

找到Matlab Central中的宝藏,并发现社区如何帮助您!

Start Hunting!