Index: /issm/trunk-jpl/src/c/modules/Shp2Expx/Shp2Expx.cpp
===================================================================
--- /issm/trunk-jpl/src/c/modules/Shp2Expx/Shp2Expx.cpp	(revision 14280)
+++ /issm/trunk-jpl/src/c/modules/Shp2Expx/Shp2Expx.cpp	(revision 14281)
@@ -49,4 +49,9 @@
 
 	char    indent[81]="";
+	KML_File          *kfile  = NULL;
+	KML_Document      *kdoc   = NULL;
+	KML_Style         *kstyle = NULL;
+	KML_LineStyle     *klsty  = NULL;
+	KML_PolyStyle     *kpsty  = NULL;
 	KML_Folder        *kfold  = NULL;
 	KML_Placemark     *kplace = NULL;
@@ -199,4 +204,56 @@
 
 	SHPClose( hSHP );
+
+/*  construct kml file  */
+
+	kfile =new KML_File();
+	kfile->AddAttrib("xmlns","http://www.opengis.net/kml/2.2");
+
+/*  construct kml document  */
+
+	kdoc  =new KML_Document();
+	sprintf(kdoc->name      ,"Shp2Kmlx Module -- %s",ctime(&time0));
+	kdoc->open      =1;
+
+/*  construct style templates for defaults  */
+
+	klsty =new KML_LineStyle();
+	sprintf(klsty->color     ,"ff000000");
+	sprintf(klsty->colormode ,"normal");
+	klsty->width     =lwidth;
+	kpsty =new KML_PolyStyle();
+	sprintf(kpsty->color     ,"%02xffffff",(int)floor(popac*255+0.5));
+	sprintf(kpsty->colormode ,"random");
+	kstyle=new KML_Style();
+	kstyle->AddAttrib("id","BlackLineRandomPoly");
+	kstyle->line      =klsty;
+	kstyle->poly      =kpsty;
+	(kdoc->style     )->AddObject((Object*)kstyle);
+
+	klsty =new KML_LineStyle();
+	sprintf(klsty->color     ,"ff000000");
+	sprintf(klsty->colormode ,"normal");
+	klsty->width     ,lwidth;
+	kpsty =new KML_PolyStyle();
+	sprintf(kpsty->color     ,"00ffffff");
+	sprintf(kpsty->colormode ,"random");
+	kstyle=new KML_Style();
+	kstyle->AddAttrib("id","BlackLineEmptyPoly");
+	kstyle->line      =klsty;
+	kstyle->poly      =kpsty;
+	(kdoc->style     )->AddObject((Object*)kstyle);
+
+	klsty =new KML_LineStyle();
+	sprintf(klsty->color     ,"%02xffffff",(int)floor(popac*255+0.5));
+	sprintf(klsty->colormode ,"random");
+	klsty->width     =lwidth*2;
+	kpsty =new KML_PolyStyle();
+	sprintf(kpsty->color     ,"00ffffff");
+	sprintf(kpsty->colormode ,"random");
+	kstyle=new KML_Style();
+	kstyle->AddAttrib("id","RandomLineEmptyPoly");
+	kstyle->line      =klsty;
+	kstyle->poly      =kpsty;
+	(kdoc->style     )->AddObject((Object*)kstyle);
 
 /*  construct kml folder for shapes  */
@@ -507,18 +564,25 @@
 	}
 
+/*  assemble the rest of the kml hierarchy  */
+
+	(kdoc ->feature   )->AddObject((Object*)kfold);
+	kfold=NULL;
+	(kfile->kmlobj    )->AddObject((Object*)kdoc);
+	kdoc =NULL;
+
 /*  open exp file  */
 
-    _pprintLine_("Writing exp profiles to file.");
-    fid=fopen(filexp,"w");
+	_pprintLine_("Writing exp profiles to file.");
+	fid=fopen(filexp,"w");
 
 /*  write the polygons and linestrings  */
 
-    kfold->WriteExp(fid,"",sgn,cm,sp);
+	kfile->WriteExp(fid,"",sgn,cm,sp);
 
 /*  close exp file  */
 
-    fclose(fid);
-
-	delete kfold;
+	fclose(fid);
+
+	delete kfile;
 	for (i=nshape-1; i>=0; i--) {
 		xDelete<double>((pshapm[i]));
