Rank: 43458 based on 0 downloads (last 30 days) and 0 files submitted
photo

Amalia

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Amalia
Updated File Comments Rating
23 Sep 2009 Google Earth Toolbox Various plotting/drawing functions that can be saved as KML output, and loaded in Google Earth Author: scott lee davis

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);
colorbar
axis image
colormap(cMap)

kmlStr = ge_contourf(X,Y,Z,'cMap',cMap,...
               'polyAlpha','7F', 'lineValues', lineValues);
           
ge_output('test_contourf.kml',kmlStr);
___________
           
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])?

Contact us at files@mathworks.com