Index: /issm/trunk-jpl/src/m/contrib/larour/applyqgisstyle.m
===================================================================
--- /issm/trunk-jpl/src/m/contrib/larour/applyqgisstyle.m	(revision 24877)
+++ /issm/trunk-jpl/src/m/contrib/larour/applyqgisstyle.m	(revision 24878)
@@ -13,4 +13,8 @@
 	if strcmpi(type,'mesh'),
 		system(['cp /Users/larour/issm-jpl/usr/larour/Qgis/Mesh.qml ' newname]);
+	elseif strcmpi(type,'line'),
+		system(['cp /Users/larour/issm-jpl/usr/larour/Qgis/LineStyle.qml ' newname]);
+	elseif strcmpi(type,'point'),
+		system(['cp /Users/larour/issm-jpl/usr/larour/Qgis/SummitStyle.qml ' newname]);
 	else
 		error(['applyqgisstyle error message: ' type ' style not supported yet']);
Index: /issm/trunk-jpl/src/m/contrib/larour/contouradjust.m
===================================================================
--- /issm/trunk-jpl/src/m/contrib/larour/contouradjust.m	(revision 24878)
+++ /issm/trunk-jpl/src/m/contrib/larour/contouradjust.m	(revision 24878)
@@ -0,0 +1,53 @@
+function [newxi,newyi]=contouradjust(xi,yi,x,y);
+
+	figure(1),clf,hold on;
+	plot(xi,yi,'r-o'); xl=xlim; yl=ylim;
+
+	newxi=xi;
+	newyi=yi;
+
+	for i=1:length(xi)-1,
+		x1=xi(i); y1=yi(i);
+		x2=xi(i+1); y2=yi(i+1);
+
+		%is there in x and y someone on the segments [x1,y1][x2,y2]
+		newx=[]; newy=[];
+		for j=1:length(x),
+			 if pointonsegment(x1,y1,x2,y2,x(j),y(j)),
+				 newx(end+1,1)=x(j);
+				 newy(end+1,1)=y(j);
+			end
+		end
+		plot(newx,newy,'k*'); xlim(xl),ylim(yl);
+		if ~isempty(newx),
+			%ok, we have found points on this segment, need to order them: 
+			distance=sqrt((newx-x1).^2+(newy-y1).^2);
+			distance
+			error
+		end
+
+	end
+end
+
+function on=pointonsegment(xA,yA,xB,yB,xC,yC) % {{{
+
+	on=0; 
+	
+	AB=[xB-xA; yB-yA;0];
+	AC=[xC-xA; yC-yA;0];
+
+	if ~norm(cross(AB,AC)), return; end
+
+	KAC=dot(AB,AC);
+	
+	if(KAC<0), return; end;
+	if(KAC==0), return; end;
+
+	KAB=dot(AB,AB);
+
+	if(KAC>KAB) return; end; 
+	if(KAC==KAB) return; end; 
+
+	on=1; 
+	return;
+end %}}}
Index: /issm/trunk-jpl/src/m/contrib/larour/epsg34132shpprj.m
===================================================================
--- /issm/trunk-jpl/src/m/contrib/larour/epsg34132shpprj.m	(revision 24878)
+++ /issm/trunk-jpl/src/m/contrib/larour/epsg34132shpprj.m	(revision 24878)
@@ -0,0 +1,8 @@
+function epsg34132shpprj(filename)
+
+	%filename: does it have an extension? remove it. 
+	[path,name,ext] = fileparts(filename);
+
+	fid=fopen([path '/' name '.prj'],'w');
+	fprintf(fid,'PROJCS["WGS_84_NSIDC_Sea_Ice_Polar_Stereographic_North",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137,298.257223563]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Stereographic_North_Pole"],PARAMETER["standard_parallel_1",70],PARAMETER["central_meridian",-45],PARAMETER["false_easting",0],PARAMETER["false_northing",0],UNIT["Meter",1]]');
+	fclose(fid);
Index: /issm/trunk-jpl/src/m/contrib/larour/glacier_inventory.m
===================================================================
--- /issm/trunk-jpl/src/m/contrib/larour/glacier_inventory.m	(revision 24877)
+++ /issm/trunk-jpl/src/m/contrib/larour/glacier_inventory.m	(revision 24878)
@@ -29,6 +29,4 @@
 		function self = glacier_inventory(varargin) % {{{
 
-			self=setdefaultparameters(self);
-
 			options=pairoptions(varargin{:}); 
 
@@ -57,4 +55,5 @@
 				CenLon=zeros(length(contours),1);
 				CenLat=zeros(length(contours),1);
+				Connectivity=zeros(length(contours),1);
 				for j=1:length(contours),
 					O1Region(j)=str2num(contours(j).O1Region);
@@ -63,4 +62,5 @@
 					CenLon(j)=contours(j).CenLon;
 					CenLat(j)=contours(j).CenLat;
+					Connectivity(j)=contours(j).Connect;
 				end
 				self.regions(i).Area=Area;
@@ -69,4 +69,5 @@
 				self.regions(i).CenLat=CenLat;
 				self.regions(i).CenLon=CenLon;
+				self.regions(i).Connectivity=Connectivity;
 				self.regions(i).lids=[1:length(contours)]';
 				self.regions(i).gids=self.regions(i).lids+counter;
@@ -91,4 +92,5 @@
 			subsetregions=getfieldvalue(options,'regions',1:length(self.boxes));
 			errornotfound=getfieldvalue(options,'errornotfound',1);
+			plotr=getfieldvalue(options,'plot',0);
 
 			%The way we run this is through the O2 zones defined in boxes. We go through 
@@ -366,5 +368,5 @@
 		function name=ridtoname(self,rid) % {{{
 			
-			fullname=self.region(rid).name; 
+			fullname=self.regions(rid).name; 
 			name=fullname(10:end);
 
