Index: /issm/trunk/src/m/utils/Basins/basinzoom.m
===================================================================
--- /issm/trunk/src/m/utils/Basins/basinzoom.m	(revision 7303)
+++ /issm/trunk/src/m/utils/Basins/basinzoom.m	(revision 7304)
@@ -1,3 +1,3 @@
-function varargout=basinzoom(options)
+function varargout=basinzoom(varargin)
 %ANTZOOM - zoom on a basin in Antarctica or Greenland.
 %
@@ -9,4 +9,15 @@
 
 %recover some options, and set defaults
+
+%is varargin an options database already?
+if nargin==0,
+	options=pairoptions(varargin{:});
+elseif (isa(varargin{1},'plotoptions') | isa(varargin{1},'pairoptions')),
+	%do nothing to the varargin: 
+	options=varargin{1};
+else
+	%process varargin for options: 
+	options=pairoptions(varargin{:});
+end
 
 unitmultiplier=getfieldvalue(options,'unit',NaN);
Index: /issm/trunk/src/m/utils/Geometry/FlagElements.m
===================================================================
--- /issm/trunk/src/m/utils/Geometry/FlagElements.m	(revision 7303)
+++ /issm/trunk/src/m/utils/Geometry/FlagElements.m	(revision 7304)
@@ -32,5 +32,5 @@
 			%does the region domain outline exist or do we have to look for xlim,ylim in basinzoom?
 			if ~exist(region,'file'),
-				[xlim,ylim]=basinzoom(region);
+				[xlim,ylim]=basinzoom('basin',region);
 				flag_nodes=double(md.x<xlim(2) & md.x>xlim(1) &  md.y<ylim(2) & md.y>ylim(1));
 				flag=prod(flag_nodes(md.elements),2);
Index: /issm/trunk/src/m/utils/Kml/kml2exp.m
===================================================================
--- /issm/trunk/src/m/utils/Kml/kml2exp.m	(revision 7303)
+++ /issm/trunk/src/m/utils/Kml/kml2exp.m	(revision 7304)
@@ -11,9 +11,19 @@
 %First, read polygon kml file.
 structure=kml_shapefile(input);
+	
+%create exp file: 
+domain=struct();
+for i=1:length(structure),
 
-%create exp file: 
-domain.name=structure.name;
-domain.density=1;
-domain.x=structure.X;
-domain.y=structure.Y;
+	if isfield(structure,'name'),
+		domain(end+1).name=structure(i).name;
+	else
+		domain(end+1).name='NaN';
+	end
+
+	domain(end).density=1;
+	domain(end).x=structure(i).X;
+	domain(end).y=structure(i).Y;
+end
+domain=domain(2:end);
 expwrite(domain,output);
Index: /issm/trunk/src/m/utils/Kml/kml2expg.m
===================================================================
--- /issm/trunk/src/m/utils/Kml/kml2expg.m	(revision 7304)
+++ /issm/trunk/src/m/utils/Kml/kml2expg.m	(revision 7304)
@@ -0,0 +1,13 @@
+function kml2expg(filename)
+
+	[path,name,ext]=fileparts(filename);
+
+	if strcmpi(ext,'.kmz'),
+		eval(['!unzip ' filename]);
+		eval(['!mv doc.kml ' name '.kml']);
+		kml2exp([name '.kml'],[name '.exp']);
+		expll2xy([name '.exp'],1);
+	end
+
+	kml2exp([name '.kml'],[name '.exp']);
+	expll2xy([name '.exp'],1);
