Index: /issm/trunk/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp
===================================================================
--- /issm/trunk/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 8740)
+++ /issm/trunk/src/c/modules/Exp2Kmlx/Exp2Kmlx.cpp	(revision 8741)
@@ -41,4 +41,5 @@
 	KML_Polygon*       kpoly =NULL;
 	KML_LinearRing*    kring =NULL;
+	KML_LineString*    kline =NULL;
 
 	FILE*   fid=NULL;
@@ -53,5 +54,5 @@
 /*  read exp file  */
 
-	if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp))
+	if (!DomainOutlineRead(&nprof,&pnvert,&pprofx,&pprofy,&closed,filexp,false))
 		_error_("Error reading exp file.");
 
@@ -70,8 +71,13 @@
 
 	kfold =new KML_Folder();
-	sprintf(kfold->name      ,"Polygons translated from file \"%s\".",filexp);
+	sprintf(kfold->name      ,"Profiles translated from file \"%s\".",filexp);
 	kfold->open      =1;
 
 /*  polygon with multiple holes  */
+
+	if (holes && nprof && !closed[0]) {
+		_printf_(true,"Warning -- Outer profile is not closed, so \"holes\" option will be ignored.\n");
+		holes=false;
+	}
 
 	if (holes) {
@@ -102,4 +108,9 @@
 
 		for (i=1; i<nprof; i++) {
+			if (!closed[i]) {
+				_printf_(true,"Warning -- Inner profile %d is not closed with \"holes\" specified, so it will be ignored.\n",i+1);
+				continue;
+			}
+
 			kring =new KML_LinearRing();
 
@@ -127,34 +138,62 @@
 	}
 
-/*  multiple polygons  */
+/*  multiple polygons or linestrings  */
 
 	else {
 		for (i=0; i<nprof; i++) {
 			kplace=new KML_Placemark();
-			sprintf(kplace->name      ,"Polygon %d",i);
-			kplace->visibility=true;
-
-			kpoly =new KML_Polygon();
-			kring =new KML_LinearRing();
-
-			lat=(double *) xmalloc(pnvert[i]*sizeof(double));
-			lon=(double *) xmalloc(pnvert[i]*sizeof(double));
-			Xy2llx(lat,lon,pprofx[i],pprofy[i],pnvert[i],sgn,cm,sp);
-
-			kring->ncoord    =pnvert[i];
-			kring->coords    =(double (*)[3]) xmalloc(pnvert[i]*3*sizeof(double));
-			for (j=0; j<pnvert[i]; j++) {
-				kring->coords[j][0]=lon[j];
-				kring->coords[j][1]=lat[j];
-				kring->coords[j][2]=0.;
-			}
-			xfree((void**)&lon);
-			xfree((void**)&lat);
-
-			(kpoly ->outer     )->AddObject((Object*)kring);
-			kring =NULL;
-
-			(kplace->geometry  )->AddObject((Object*)kpoly);
-			kpoly =NULL;
+
+			if (closed[i]) {
+				sprintf(kplace->name      ,"Polygon %d",i+1);
+				kplace->visibility=true;
+
+				kpoly =new KML_Polygon();
+				kring =new KML_LinearRing();
+
+				lat=(double *) xmalloc(pnvert[i]*sizeof(double));
+				lon=(double *) xmalloc(pnvert[i]*sizeof(double));
+				Xy2llx(lat,lon,pprofx[i],pprofy[i],pnvert[i],sgn,cm,sp);
+
+				kring->ncoord    =pnvert[i];
+				kring->coords    =(double (*)[3]) xmalloc(pnvert[i]*3*sizeof(double));
+				for (j=0; j<pnvert[i]; j++) {
+					kring->coords[j][0]=lon[j];
+					kring->coords[j][1]=lat[j];
+					kring->coords[j][2]=0.;
+				}
+				xfree((void**)&lon);
+				xfree((void**)&lat);
+
+				(kpoly ->outer     )->AddObject((Object*)kring);
+				kring =NULL;
+
+				(kplace->geometry  )->AddObject((Object*)kpoly);
+				kpoly =NULL;
+			}
+
+			else {
+				sprintf(kplace->name      ,"LineString %d",i+1);
+				kplace->visibility=true;
+
+				kline =new KML_LineString();
+
+				lat=(double *) xmalloc(pnvert[i]*sizeof(double));
+				lon=(double *) xmalloc(pnvert[i]*sizeof(double));
+				Xy2llx(lat,lon,pprofx[i],pprofy[i],pnvert[i],sgn,cm,sp);
+
+				kline->ncoord    =pnvert[i];
+				kline->coords    =(double (*)[3]) xmalloc(pnvert[i]*3*sizeof(double));
+				for (j=0; j<pnvert[i]; j++) {
+					kline->coords[j][0]=lon[j];
+					kline->coords[j][1]=lat[j];
+					kline->coords[j][2]=0.;
+				}
+				xfree((void**)&lon);
+				xfree((void**)&lat);
+
+				(kplace->geometry  )->AddObject((Object*)kline);
+				kline =NULL;
+			}
+
 			(kfold ->feature   )->AddObject((Object*)kplace);
 			kplace=NULL;
Index: /issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp
===================================================================
--- /issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 8740)
+++ /issm/trunk/src/c/shared/Exp/DomainOutlineRead.cpp	(revision 8741)
@@ -11,5 +11,5 @@
 #include "../Exceptions/exceptions.h"
 
-int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname){
+int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole){
 
 	
@@ -102,6 +102,8 @@
 		cl=false;
 		if((x[0]==x[n-1]) && (y[0]==y[n-1])){
-			n=n-1;
 			cl=true;
+			if (!whole) {
+				n=n-1;
+			}
 		}
 
Index: /issm/trunk/src/c/shared/Exp/exp.h
===================================================================
--- /issm/trunk/src/c/shared/Exp/exp.h	(revision 8740)
+++ /issm/trunk/src/c/shared/Exp/exp.h	(revision 8741)
@@ -12,5 +12,5 @@
 int IsOutsidePoly(Vec in,double* xc,double* yc,int numvertices,double* x,double* y,int i0,int i1, int edgevalue);
 int IsInPolySerial(double* in,double* xc,double* yc,int numvertices,double* x,double* y,int nods, int edgevalue);
-int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname);
+int DomainOutlineRead(int* pnprof,int** pprofnvertices,double*** ppprofx,double*** ppprofy,bool** pclosed,char* domainname,bool whole);
 int pnpoly(int npol, double *xp, double *yp, double x, double y, int edgevalue);
 
Index: /issm/trunk/src/mex/TriMesh/TriMesh.cpp
===================================================================
--- /issm/trunk/src/mex/TriMesh/TriMesh.cpp	(revision 8740)
+++ /issm/trunk/src/mex/TriMesh/TriMesh.cpp	(revision 8741)
@@ -96,5 +96,5 @@
 	
 	/*Start reading the domain outline file: */
-	if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,NULL,domainname)){
+	if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,NULL,domainname,false)){
 		printf("%s%s%s\n",__FUNCT__," error message reading domain outline ",domainname);
 		mexErrMsgTxt(" ");
@@ -103,5 +103,5 @@
 	/*Read rifts file if present: */
 	if(riftname){
-		if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,NULL,riftname)){
+		if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,NULL,riftname,false)){
 			printf("%s%s%s\n",__FUNCT__," error message reading rifts outline ",riftname);
 			mexErrMsgTxt(" ");
Index: /issm/trunk/src/mex/TriMeshNoDensity/TriMeshNoDensity.cpp
===================================================================
--- /issm/trunk/src/mex/TriMeshNoDensity/TriMeshNoDensity.cpp	(revision 8740)
+++ /issm/trunk/src/mex/TriMeshNoDensity/TriMeshNoDensity.cpp	(revision 8741)
@@ -86,5 +86,5 @@
 	
 	/*Start reading the domain outline file: */
-	if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,NULL,domainname)){
+	if(!DomainOutlineRead(&nprof,&profnvertices,&pprofx,&pprofy,NULL,domainname,false)){
 		printf("%s%s%s\n",__FUNCT__," error message reading domain outline ",domainname);
 		mexErrMsgTxt(" ");
@@ -93,5 +93,5 @@
 	/*Read rifts file if present: */
 	if(riftname){
-		if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,NULL,riftname)){
+		if(!DomainOutlineRead(&numrifts,&riftsnumvertices,&riftsverticesx,&riftsverticesy,NULL,riftname,false)){
 			printf("%s%s%s\n",__FUNCT__," error message reading rifts outline ",riftname);
 			mexErrMsgTxt(" ");
