File Exchange

image thumbnail

GEplot

version 1.2.0.0 (54 KB) by Rafael Palacios
If you know plot, try GEplot. GEplot uses the same syntax as plot, but draws over Google Earth maps.

7 Downloads

Updated 20 Nov 2017

View License

Creates a file in kmz format that can be opened into Google Earth.
GEplot uses the same syntax as the traditional plot function but requires Latitude and Longitude (WGS84) instead of x and y.
Examples:
GEplot('my_track',Lat,Lon);
GEplot('my_track',Lat,Lon,'o-r','MarkerSize',10,'LineWidth',3)
Colors supported: blue, green, red, cyan, magenta, yellow, black, white.
Symbols supported: point, circle, x-mark, plus, star, square, diamond, filled square, filled diamond,filled circle.
Each plot appears as a separate folder within GE; within the folder line and marks are separated in two layer. Hence it is very easy to show/hide different plots.

If you need to convert from UTM to Lat/Lon you may use utm2deg.m, also available at Matlab Central.
If you want to add Labels and Descriptions to your point, use GEplotLabelsDesc.m, also available at Matlab Central

Comments and Ratings (10)

Rod Bryant

I am relatively green with Matlab and very green with kml. This seems just what the doctor ordered but I have a problem similar to Tomas Frank:
??? Error using ==> iofun\private\getArchiveEntries
File "GEimages/circle_r.png" does not exist.
Where can I find the symbol files? Can anyone help? Thanks.

Amazing code for plotting, Very Thanks Rafael, you safe my life!
I see your tutorials too an there are just terrific. Thank you for sharing your knowledge!!!

Enrique Vargas

R. LeFande

GEplot('my_track',xx,yy)
??? Undefined function or method 'GEplot' for input arguments of type 'char'.

What am I missing? Thanx.

tarun luthra

i am trying to run this tool but it gives me this errorfp=fopen(strcat(filename,'.kml'),'w');
if (fp==-1)
message=sprint('Unable to open file %s.kml',filename);
error(message);
end

can you tell me whats wrong with i have got my lat and lon in decimal format is that good enough it doesnt create the .kml file and if it does where is it gonna store it

Eric Gayer

Thanks for this simple and so usefull code. Thanks also for adding Labels. Now I can plot my sample site, with their name on GE... Thanks again ! This is gonna be really usefull for the geosciences community.

Andrew Robertson

This is the simplest way to draw my vectors of coordinates in Google Earth.
Thanks!

nima moshtagh

Great job! it works very nicely. I recommend adding the capability of plotting multiple trajectories at once. So the 'Lat' and 'Lon' would be matrices rather than vectors. (similar to the Matlab's plot() function) I did it myself and it worked perfectly.

Rafael Palacios

The problem found by Tomas Frank has been corrected in the currently available version.
GEplot is easy to learn because it uses the same syntax as plot. If you need to draw other kind of objects, you may consider using Matlab2GoogleEarth toolbox, also available at Matlab Central.

Tomas Frank

Idea is great! Google Earth in Matlab! But it took me 10 min of my time to fail to overcome the elementary error (after I installed software and set the path).

>> GEplot('my_track',Lat,Lon);
??? Error using ==> iofun\private\getArchiveEntries
File "GEimages/none_b.png" does not exist.

Error in ==> GEplot at 217
zip(filename,{strcat(filename,'.kml'), iconfilename});

Note: I set Lat and Lon to actual vectors.

Maybe it make sence to check first if what you submit actually works.

But, again, the idea is great!

Updates

1.2.0.0

% Version 1.2: Added support for multiple lines. Fixed nargchk warning.
% Fixed error in movifile for Matlab version 2017b. Fixed a path error
% for symbol files: folder GEimages

1.0.0.0

Apparently, similar plotting functions are located in Graphics category.

Correct an error while ploting graphs with lines but without symbols. Now it works just with lines, just with symbols or lines and symbols.

Fixed an error (found by Tomas Frank) related to plotting graphs without symbols (just lines).

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

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor