【源码】Google地图嵌入MATLAB图片——plot_google​_map函数

二叶草 2020年2月14日20:04:02函数代码评论阅读模式

 plot_google_map函数的作用是使用Google Maps API在当前图片的背景中绘制指定的谷歌地图。该函数假定当前图形的坐标以WGS84为基准,并使用转换代码将图像从Google使用的坐标系转换并投影到WGS84坐标中。地图的缩放尺度经过自动确定以覆盖图形的整个区域,此外,还可以在图中缩放时自动刷新地图,在放大时显示更多细节

谷歌地图API在没有API密钥的情况下每天最多只能提供1000个请求响应。如果您需要频繁使用此函数,最好申请一个API密钥。

function varargout =plot_google_map(varargin)

% function h = plot_google_map(varargin)

% Plots a google map on the current axesusing the Google Static Maps API

%

% USAGE:

% h = plot_google_map(Property, Value,...)

% Plots the map on the given axes. Usedalso if no output is specified

%

% Or:

% [lonVec latVec imag] =plot_google_map(Property, Value,...)

% Returns the map without plotting it

%

% PROPERTIES:

%   Axis           - Axis handle. Ifnot given, gca is used.

%   Height (640)   - Height of theimage in pixels (max 640)

%   Width  (640)   - Width of the image in pixels (max 640)

%   Scale (2)      - (1/2) Resolutionscale factor. Using Scale=2 will

%                     double the resulotion ofthe downloaded image (up

%                     to 1280x1280) and will resultin finer rendering,

%                     but processing time willbe longer.

%   Resize (1)     - (recommended 1-2)Resolution upsampling factor.

%                     Increases image resolutionusing imresize(). This results

%                     in a finer image but itneeds the image processing

%                     toolbox and processingtime will be longer.

%   MapType        - ('roadmap') Typeof map to return. Any of [roadmap,

%                     satellite, terrain,hybrid]. See the Google Maps API for

%                     more information.

%   Alpha (1)      - (0-1)Transparency level of the map (0 is fully

%                     transparent). While themap is always moved to the

%                     bottom of the plot (i.e.will not hide previously

%                     drawn items), this can beuseful in order to increase

%                     readability if many colorsare plotted

%                     (using SCATTER forexample).

…………….

GitHub下载地址:

https://github.com/zoharby/plot_google_map

本文来源于:【源码】Google地图嵌入MATLAB图片——plot_google​_map函数-变化吧门户
特别声明:以上文章内容仅代表作者本人观点,不代表变化吧门户观点或立场。如有关于作品内容、版权或其它问题请于作品发表后的30日内与变化吧联系。

  • 赞助本站
  • 微信扫一扫
  • weinxin
  • 加入Q群
  • QQ扫一扫
  • weinxin
二叶草
Go语言中的常量 函数代码

Go语言中的常量

1 概述 常量,一经定义不可更改的量。功能角度看,当出现不需要被更改的数据时,应该使用常量进行存储,例如圆周率。从语法的角度看,使用常量可以保证数据,在整个运行期间内,不会被更改。例如当前处理器的架构...
Go语言的接口 函数代码

Go语言的接口

Go语言-接口 在Go语言中,一个接口类型总是代表着某一种类型(即所有实现它的类型)的行为。一个接口类型的声明通常会包含关键字type、类型名称、关键字interface以及由花括号包裹的若干方法声明...
Go语言支持的正则语法 函数代码

Go语言支持的正则语法

1 字符 语法 说明 . 任意字符,在单行模式(s标志)下,也可以匹配换行 字符类 否定字符类 d Perl 字符类 D 否定 Perl 字符类 ASCII 字符类 否定 ASCII 字符类 pN U...
Go语言的包管理 函数代码

Go语言的包管理

1 概述 Go 语言的源码复用建立在包(package)基础之上。包通过 package, import, GOPATH 操作完成。 2 main包 Go 语言的入口 main() 函数所在的包(pa...

发表评论