Using the Matlab Google-Earth Toolbox to Calculate Latitude and Longitude

I am trying to build some waypoints using the Google-Earth toolbar . The documentation for it is pretty bad, so I decided that this would be a good question about stack overflow.

I have a matrix, wypts , that has latitude and longitude coordinate pairs in decimal format (if anyone is wondering about this at State College (SCE) in Pennsylvania).

 wypts = 40.8489 -77.8492 40.8922 -77.8492 40.9355 -77.8492 40.9788 -77.8492 41.0221 -77.8492 41.0654 -77.8492 41.1087 -77.8492 41.1154 -77.8492 

Instead of drawing dots in Pennsylvania, the following does not work: nothing is visible at the south pole:

 output = ge_plot(wypts(:,1),wypts(:,2)) ge_output('wypts.kml',output) 
+6
matlab latitude-longitude google-earth
source share
1 answer

Your latitudes and longitudes are shifted. The help documentation for ge_plot says that the first input should be longitude, and the second input should be latitude. Try the following:

 output = ge_plot(wypts(:,2),wypts(:,1)); ge_output('wypts.kml',output); 
+3
source share

All Articles