KML toolbox

Create KML/KMZ files and view them in Google Earth. Supports 3D models, contours, overlays, and more


Updated 3 Mar 2016

From GitHub

View License on GitHub

This class-based MATLAB toolbox allows you to create many different plots in Google Earth, by automatically creating the required xml-based KML files without user interaction. Also allows to save as KMZ packages, including any model & images necessary for the plot.

Cite As

Rafael Oliveira (2023). KML toolbox (, GitHub. Retrieved .

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

Inspired by: Google Earth Toolbox

Community Treasure Hunt

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

Start Hunting!

Versions that use the GitHub default branch cannot be downloaded

Version Published Release Notes

Finally moved to GitHub :)

v2.7: fixed a bug in the contourf function, related to contours with custom contour levels

(forgot to update version number)

v2.6: finally possible to save KMZ files(default)- auto includes models & images. fix num2str behavior, reported by Nick Mortimer. Fix to keep path when saving, reported by Alberto. Added lineWidth/lineColor to contourf, suggested by Keith Epstein.

v2.3: A couple more bug fixes (thanks to Reid Pulley for reporting them!), added one example of animation to the test folder

v2.2: A few bug fixes.

v2.1: Added support for gx:LatLonQuad overlays, so now you can add non-square images to the kml

v2.0: Some bug fixes in the filled contour, added animation support.

v1.9: Finally implemented the filled contour plot! And also made some changes to the other contour functions to match better the color scale from MATLAB.
Added also a surf function, to plot 3D colored surfaces.

v1.8: increased to the numeric precision when saving numbers as text. Added the polyMap function, to create a 3D map similar to surf, but composed of a polygons with height proportional to the cell value (similar to hist3, but without binning).

v1.7: small correction in the quiver3d function, and implementation of the classic quiver plot in 2D, without using models anymore.

v1.6: made it compatible with older versions that do not support ~ as function output. Also added the suggestion of Balam Willemsen, to make run work with OSX... Any suggestions on the Linux side are welcome :)

v1.5: updated scatter and scatter3 to accept an different icons for each point. You must supply them as a cell array with the same size of the latitude and longitude inputs.

Corrected the image in File Exchange

v1.4 - Fixed some bugs, added documentation, and a method to animate a model in a trajectory (kml.modelTour)

v 1.3: fixed a small error in the checkUnit function

v1.2: Updated to support both degree and radian inputs.

To view or report issues in this GitHub add-on, visit the GitHub Repository.
To view or report issues in this GitHub add-on, visit the GitHub Repository.