Dev:KML

kmldump - KML dump function

Synopsis
EXPORT int kmldump(int (*stream)(const char *,...), OBJECT *obj);
 * 1) include "gridlabd.h"

Description
The KML dump function is used to output a KML data file for Google Earth when the --kml command option is used.

Example
EXPORT int kmldump(int (*stream)(const char *,...), OBJECT *obj) {  if ( gl_object_isa(obj,"class") ) return OBJECTDATA(obj,class)->kmldump(stream); // TODO add other classes else return 0; }
 * module/main.cpp
 * 1) include "gridlabd.h"


 * module/class.h

class class : public gld_object { // ... other declarations int kmldump(int (*stream)(const char *,...)); };


 * module/class.cpp

int class::kmldump(int (*stream)(const char*, ...)) {  if ( isnan(get_latitude) || isnan(get_longitude) ) return 0; stream("\n"); stream(" %s \n", get_name); stream(" \n<![CDATA[\n"); // TODO add popup data here stream("   ]]>\n"); stream(" \n"); stream(" \n"); stream("   %f,%f \n", get_longitude, get_latitude); stream(" \n"); stream(""); }