File Exchange

image thumbnail

Google Earth Toolbox

version (9.39 MB) by scott lee davis
Various plotting/drawing functions that can be saved as KML output, and loaded in Google Earth


Updated 02 Feb 2012

View Version History

View License

The projects git repository can be found at:

You are welcome to join and contribute, or simply just use it. Either way have fun.

With the MATLAB functions within this toolbox, one can display spatially and temporally distributed data within Google Earth. It may be argued that converting the results of models and measurements to be able to view them in Google Earth is unnecessary since they can also be viewed within MATLAB itself. However, using Google Earth for evaluation of data can have some major advantages, a few of which are listed below:

1) very intuitive tools for navigating the view
2) retrieval of data from objects within the viewer
3) quick rendering of large files
4) interactively choosing which objects should be displayed
5) dynamic representation of time-variant data

Note: You must add the toolbox to your matlab path before you can use it or access help from the matlab start menu. For example:
from the command window.

Cite As

scott lee davis (2021). Google Earth Toolbox (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (96)

Osman Serdar

Callum Jones

Sarah de Bie

Is this also possible for a wind rose/polar plot?

Zixi Liu

Aikaterini Kyprioti

Veronica Taurino

Vojtech Simak

Section examples is not visible on the website, only a small window with 1 row of content without possibility to scroll

Joseph Guggenberger

Great work; only question is how to change the color of the pushpins, specifically for ge_point. I've tried changing the 'iconColor' value but nothing I do seems to change the color from yellow.

Anselm Griffin

Probably just me but I am getting loads of errors ( I like to think that I know something about Matlab +10 years experience)
For instance in ge_windbarb Line 18 says
[toolboxroot,fname,ext,vsn] = fileparts(p)
Matlab quite rightly says too many output arguments. There should be only three. Also the the tutorial is out of date as it refers to non existment directories.

Tong Zhang

it has something wrong
>> demo_ge_plot3
错误使用 fprintf
文件标识符无效。使用 fopen 生成有效的文件标识符。

出错 ge_output (line 38)

出错 demo_ge_plot3 (line 17)

> > demo_ge_plot3
Error using fprintf.
The file identifier is invalid.Use fopen to generate valid file identifiers.
Error ge_output (line 38)
Fprintf (fid, '% s', the header).
Error demo_ge_plot3 (line 17)
Ge_output (kmlFileName, the output);

Seok-Han Jeong

Thank you so much for offering this amazing tool. But I have one concern. I wanted to point many places, which I did. But I failed to apply each places name! I need a help!

Eduardo Nzinga

Gustav Grundfelt


If anyone needs to export complex 3D geometry, be it a surface (xyz grid) or a patch (faces and vertices), textured or not, please try mesh2kml and leave feedback.


If anyone needs to export complex 3D geometry, be it a surface (xyz grid) or a patch (faces and vertices), textured or not, please try mesh2kml and leave feedback.

sebastian galmez

mohsen hp

can you send me video help to use it?
i realy need use that but i can't

Yang Shenglong

Yang Shenglong

Xuan-Mung Nguyen

Great tool. Thanks

ma peoyond

very nice


thanks for putting the ge_plot function!!! I didn't want to write it from scratch :)

Shi Yunfei

Val Schmidt

I'm a big fan of this toolbox. I have a feature request/bug.

ge_groundoverlay() does not currently support the altitudeMode option of "clampToSeaFloor". It's an easy fix.

Oh and a feature request. I'd love for a function that could create KMZ super overlays.



Dear Scott Lee Davis

Sorry I'm new in Matlab.
I had download the google earth toolbox.
I still cant figure out how to use ge_kmz function.

Is it i need to type ge_kmz(PlanA,varargin) to call the function out? *my kmz file name is PlanA*

After i type that command, i wil get error of
"Undefined function or variable 'PlanA'."

Kindly please teach me on this function.

Best Regards

Engin Berk Özmen

Hi Scott. It's a great job.
However, I want to ask you a question.
I wanted to show a photo of city which is in jpeg format on google earth. I have created kml file, but google earth couldn't open the file, because its too large, approximately 800 mb. Then I created smaller size kml files with 217 mb. Google earth can show 3 of those, but if i open the fourth one, it is terminated. Can you help me about this problem?

Steven Millard

Scott, I recently updated to MATLAB R2014 and noticed some of the packages don't seem in tune with R2014. Any plans to update from R2006?

Great utility....I love the toolbox.


Steve Millard


Hi Scott,

Fantastic toolbox, have been using it for spatial data analysis, and have been very happy with it!

One comment following up on Johannes Traugott below: ge_point (as well as ge_point_new) allow passing on a description for each object, which is then displayed in a pop-up balloon. Passing on the description to multiple objects seems to work fine. However, only a subset of objects (apparently random) actually displays a balloon. I have small (~10 KB) kml files with only about 20-50 objects, so it doesn't seem like size issue. Have you encountered this before?

Either way, great work!


João Carneiro

First of all,
Let me thank you for this package. It's been solving lot's of problems for me.

I have one question though. Why is ge_quiver not being distributed anymore? I had to recover it from a much older version. It works, so I'm not sure why it's not being offered with the rest of the package.

Maybe it's speed of the ge_quiver algorithm. To that, I have made a few tweaks to make it faster.. I would gladly send you the code if you want.

Anthony Klinkert


Regarding the Matlab Google Earth toolkit:

and here:

And as directed in the README file, typing this:

>> googleearth -docinstall

I get this:

Click on the MATLAB Start button->Desktop Tools->View Source Files...
...and click Refresh Start Button.

However, in 2013a and 2013b, there is no “Refresh Start Button.” (and nothing comes up in the help for this term)

What does this do, and how do we do it in the latest versions of Mathlab?

Thank you.
(great work!)

Dong Ye

Hi, Sir:

Your work is really great. It helps me a lot. And I have some special needs:
It seems the ge_contourf can't handle the cases when the matrix Z contains 'NaN'. But the matlab version contourf just ignore it entry. Can you do that as well? Thanks. God bless you.


Thank you!


For all those interested in data visualization in Google Earth with matlab, I would like to point you to this gallery of examples which was made with another toolbox which is part of the openearthtools (but not available on the file exchange).

G. M. Wolfe

I would like to echo Val's comment; it is cumbersome to tote around a folder of .dae files (e.g. for wind barbs), especially if we want to share the kml or kmz files with others.

Also, why is ge_quiver not included in the current package?

These small points aside, I am excited to have found this toolbox. I will be using it to visualize European air quality measurements acquired on a Zeppelin. Thanks!

Val Schmidt

Val Schmidt

Val Schmidt

This is a great tool and it seems very thoughtfully written. I do have a request:

When I create kmz files I get a zipped kml file but any images to display are not included. I would like the kmz files to consist of a zipped bundle of the kml and all its component parts (images to display for example) so that the result is completely self-contained. To me, that's the real advantage of kmz over kml - a single portable file without others to look after.



Val Schmidt




It's really amazing job!
But,does it support save the screen as jpg image file to local disk?I've tried to use the google api,only getting black-white pictures.
Can anyone give me a hit?
Thank you!


Jose Giron

Awesome toolbox, I specially like the timeSpan feature


Thanks for sharing this very useful toolbox, I use it a lot. But I have a problem: occasionally the results displayed in Google Earth are "flipud"-ed, i.e. split in half and the top half is below the bottom half with a missing gap in the middle. I hope this not because I live in the Southern Hemisphere! Any suggestions? TIA.

Margaret Segou

I am trying to use the ge_imagesc but it doesn't work. I am also running the demo and it presents an error about Unauthorized parameter imageURL in parameter/value passed to ge_imagesc. I guess it is somethign simple since all seem to be great. Nice effort!


Berker Hüsam

Gabriel ortiz

this Toolbox works in Spanish (google earth in spanish)??

Ben Williams

I have one comment: It would be fantastic if there was a function for plotting 2D or 3D patch data on Google Earth.

Ben Williams

Brilliant! So useful..... :-)

Manu R

This is a fantastic contribution.


very niiiiiice

I will be using mat-lab to retrieve information from google earth to simulate a car movement and I'm interested to know about how that is done.

Laurent Longuevergne

Great job, this toolbox is just very useful for my work. Thank you!

GE_point is really interesting, but displayed information is limited to a 2 column-table. How to modify the code to display an image? A 3-column-table ? Does such functionality exist?

Haiyang Cui

Haiyang Cui

it's a very good toolbox. But do you have the function like ge_trisurf, which could plot the mesh with triangles?

Stavroul Vassaki

it's a very good toolbox.Although i have a question.I want to display points with different colours, so i change the parameter 'icon colour' when i call the function but nothing changes.What can i do?
Thank you very much!!



Erdal Bizkevelci


Great job, although there are a couple of problems I'm having with the 'ge_contourf' function. I'd like to plot just 1 contour on GE and here's my test script:
close all
clear all
[X,Y] = meshgrid(1:20,1:20);
Z = peaks(20);
cMap = 'jet';
lineValues = [ 0 0 ] ;
[C,h] = contourf(X,Y,Z, lineValues);
axis image

kmlStr = ge_contourf(X,Y,Z,'cMap',cMap,...
'polyAlpha','7F', 'lineValues', lineValues);


The script as run above produces an error in the "isinner" function. I was able to tweak this by making 'firsttest' have a single scalar value so it'll accept the && test at the end of the function. This tweak actually gets the ge_contourf function to run but the other problem is that the resulting contour, and the polygon created in the .kml file, is the reverse of what I actually want and the reverse of what the CONTOURF function produces.

If you change the lineValues parameter to "[ 2 2]" then the resulting .kml polygon matches that produced by CONTOURF. Although I'd still like only 1 color showing on GE and not the background color - that is, I'd like 1 colored contour showing on GE.

Any ideas on how to tweak the ge_contourf function so I can get it correctly create the polygon and .kml file when the polgyon goes to the outer edges of the 'box' (i.e., the example when lineValues = [0 0])?

Atma Mani

A commendable effort.


Great job, nice features! I was trying to generate a dynamic visualization with ge_imagesc, but cannot make it work in google earth.... I specify the 'timeSpanStart','timeSpanStop' in each ge_imagesc plot and put everything in a ge_folder... it seems to run but there is no motion (all the same pictures). do you have a working sample or any advice? Thanks again



Very usefull work. Please a question.
I am trying to imcorporated google earth in Matlab GUI using GEPluginCoClass ActiveX but I dont know how to do. Need help to do this or if someone has other way to integrate GE in Matlab GUI.

Great job for GE Toolbox.

Ambarish Jash

Ambarish Jash

for ge_quiver there is no option to scale the length of the arrows? could you please add that. -Thank you


@ Johannes Traugott 22 Apr 2009

Hi Johannes:
indeed this functionality did not exist. However, I uploaded 2 new files (ge_point_new.m and demo_ge_point_new.m) to the Google Code repository (revision 28), which may solve your problem. Let me warn you though that 500.000 points with popup menu will generate huge KML files. Having said that, good luck on your work and thanks for the rating.

Johannes Traugott

I'm trying to display many (500.000) points in Google Earth using the GE_POINT function. Every single point needs to be described by it's own pop-up baloon. I do not see a possibility how to transfer the pop-up information to ge_point for multiple point plotting. Does such functionality exist?
(Great toolbox, anyhow!)

Macarena Varela

Great Work!!!


Some of the issues raised in previous posts have been resolved in revision 27 of the googleearth toolbox --check the Google Code link above or ""


Great - really useful.
re comment above - got round this by adding:
X = linspace(0,1,size(cMap,1))';
in ge_colorbar (using R2006b).


Great work!
Some issues with the demos, though. e.g.:

>> demo_ge_colorbar
??? Error using ==> interp1 at 185
There should be at least two data points.

Error in ==> ge_colorbar at 93
YIRed = interp1(X,YRed,fM);

Error in ==> demo_ge_colorbar at 9
kmlStr = ge_colorbar(PosLong,PosLat,Z,...

kamal lmk_kmlhotmailcom

it's of a great help for me this toolbox. you've made a very good job

Andy Bliss

ge_point is quite nice, but the 'description' option doesn't work for me. I tried with single points and with multiple points at a time. It'd also be nice if this would accept a cell array of strings (documentation says it can just do char array).

Dan S

Very nice toolset -- occasionally needs minor tweaks (e.g. ge_quiver3 does not specifiy a default 3D model)

Rajesh Nasare

caio guimaraes

Great Work. I'm missing the mat2gray function inside the ge_imagesc (I think it´s from Matlab´s Image Processing Toolbox). Is it possible to include this function in your file? Or, do you know a way to run the ge_imagesc functin without really needing the mat2gray?

haraguchi kazuki

Eric Gayer

I just need to figure out how to deal with projections... other than that... this Toolbox is amazing !

Bobby P.

EXCELLENT! but a quick question: in ge_contour, what type of lat/lon should i use? UTM (meters?) or degrees?
Other than, well done!

Scott R

Well done.

Falo folio

It is unbelieveble that this toolbox is distributed for free. It should belong to the standard toolbox-set with every release of MATLAB. Excellent job!

Rich Signell

Thanks for this extremely useful toolkit. One future enhancement that would be nice: the ability to pass "ge_contour.m" a vector V that has specific values of the contour levels (e.g. as in "contourc.m")



Parasar Kodati

Awesome effort

JH Spaaks

In fact, the ge_surf file is listed along the contents of the zip file, so I think it should be working. However, it's not included in the documentation yet, being one of the newer files. That means that you can't access the source code through the link provided in het documentation, but you can use the function from the command line, or in your scripts. Good luck, please let us know if you experience more problems with it.

taiga woods

Where's the ge_surf.m function? It's a beautiful image, but the corresponding function is missing inside the .zip file.

scott davis

Added. Indeed, all the options ge_poly had are now available to ge_plot3 as well. See demo_ge_plot3.m for example.

Slater Voorhees

Great set of tools.

Would it be possible to provide the drop down lines used in ge_poly in the ge_plot3 functions? I am assuming that is just adding the altitudeMode option.


scott davis

Added. See demo_ge_imagesc.m for example.

Nirmal Jayaram

Awesome Work. Keep Rocking
There is just one thing I wanted to know. Is it possible to add a colorbar when I use, say, the ge_imagesc.m function? Thanks

scott davis


Ludovic Bariteau

Hi there,
I started to play with this fabulous toolbox but the function 'vectorsplit' is missing in the zip file. This function is used for example into ge_circle.m
Is it possible to add it in the package?

nesrine zaklos

äÓÑíä äÓäÓ

Tomas Frank

Sorry, forgot my ratigs. Its A+++++++++++

Tomas Frank

Great Toolbox! Merging giagants: Mathworks and Google. Much more superior to the previous submission on this topic. In your place, I would spend some time to make Matlab2Google (or something) toolbox. Good luck!

Carlos Adrián Vargas Aguilera

Wow!! Really great, i need to make some functions like rad2deg and to figure it out what does the entries means because there's not help, but great job, keep working! ... it would be nice a program that reads coordinates of the marks into matlab...

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!