Index: /issm/trunk/src/m/kml/kml_colorstyle.m
===================================================================
--- /issm/trunk/src/m/kml/kml_colorstyle.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_colorstyle.m	(revision 6454)
@@ -0,0 +1,120 @@
+%
+%  definition for the kml_colorstyle super (base) and sub (derived) class.
+%
+%  [kml]=kml_colorstyle(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, colorstyle id, '')
+%    color         (char, opacity/color in hex aabbggrr, 'ffffffff')
+%    colormode     (char, color mode , 'normal')
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_colorstyle < kml_substyle
+    properties
+        color     ='ffffffff';
+        colormode ='normal';
+    end
+    
+    methods
+        function [kml]=kml_colorstyle(varargin)
+
+            kml=kml@kml_substyle(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_substyle()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_colorstyle')
+                    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                        class(kml),inputname(1),string_dim(kml,i)));
+                end
+                disp@kml_substyle(kml(i));
+                disp(sprintf('         color: ''%s'''  ,kml(i).color));
+                if strcmp(class(kml),'kml_colorstyle')
+                    disp(sprintf('     colormode: ''%s''\n',kml(i).colormode));
+                else
+                    disp(sprintf('     colormode: ''%s'''  ,kml(i).colormode));
+                end
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the colorstyles
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_colorstyle')
+                    if ~isempty(kml(i).id)
+                        fprintf(fid,'%s<!ColorStyle id="%s">\n',indent,kml(i).id);
+                    else
+                        fprintf(fid,'%s<!ColorStyle>\n',indent);
+                    end
+                end
+                kml_write@kml_substyle(kml(i),fid,indent);
+                if ~isempty(kml(i).color)
+                    fprintf(fid,'%s  <color>%s</color>\n',indent,kml(i).color);
+                end
+                if ~isempty(kml(i).colormode)
+                    fprintf(fid,'%s  <colorMode>%s</colorMode>\n',indent,kml(i).colormode);
+                end
+                if strcmp(class(kml),'kml_colorstyle')
+                    fprintf(fid,'%s</!ColorStyle>\n',indent);
+                end
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_container.m
===================================================================
--- /issm/trunk/src/m/kml/kml_container.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_container.m	(revision 6454)
@@ -0,0 +1,114 @@
+%
+%  definition for the kml_container super (base) and sub (derived) class.
+%
+%  [kml]=kml_container(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, container id, '')
+%    name          (char, name, '')
+%    visibility    (logical, visibility, true)
+%    open          (logical, open, false)
+%    snippet       (char, snippet, '')
+%    descript      (char, description, '')
+%    styleurl      (char, style url, '')
+%    style         (cell array, styles)
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_container < kml_feature
+    properties
+    end
+    
+    methods
+        function [kml]=kml_container(varargin)
+
+            kml=kml@kml_feature(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_feature()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_container')
+                    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                        class(kml),inputname(1),string_dim(kml,i)));
+                end
+                disp@kml_feature(kml(i));
+                if strcmp(class(kml),'kml_container')
+                    disp(sprintf('\n'));
+                end
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the containers
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_container')
+                    if ~isempty(kml(i).id)
+                        fprintf(fid,'%s<!Container id="%s">\n',indent,kml(i).id);
+                    else
+                        fprintf(fid,'%s<!Container>\n',indent);
+                    end
+                end
+                kml_write@kml_feature(kml(i),fid,indent);
+                if strcmp(class(kml),'kml_container')
+                    fprintf(fid,'%s<!/Container>\n',indent);
+                end
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_document.m
===================================================================
--- /issm/trunk/src/m/kml/kml_document.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_document.m	(revision 6454)
@@ -0,0 +1,123 @@
+%
+%  definition for the kml_document sub (derived) class.
+%
+%  [kml]=kml_document(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, document id, '')
+%    name          (char, name, '')
+%    visibility    (logical, visibility, true)
+%    open          (logical, open, false)
+%    snippet       (char, snippet, '')
+%    descript      (char, description, '')
+%    styleurl      (char, style url, '')
+%    style         (cell array, styles)
+%    feature       (cell array, placemark features)
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_document < kml_container
+    properties
+        feature   ={};
+    end
+    
+    methods
+        function [kml]=kml_document(varargin)
+
+            kml=kml@kml_container(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_container()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                    class(kml),inputname(1),string_dim(kml,i)));
+                disp@kml_container(kml(i));
+                disp(sprintf('       feature: %s %s\n' ,string_size(kml(i).feature),...
+                             class(kml(i).feature)));
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the documents
+
+            for i=1:numel(kml)
+                if ~isempty(kml(i).id)
+                    fprintf(fid,'%s<Document id="%s">\n',indent,kml(i).id);
+                else
+                    fprintf(fid,'%s<Document>\n',indent);
+                end
+                kml_write@kml_container(kml(i),fid,indent);
+
+%  loop over the features for each document
+
+                for j=1:numel(kml(i).feature)
+                    if ~isempty(kml(i).feature{j})
+                        if isa(kml(i).feature{j},'kml_feature')
+                            kml_write(kml(i).feature{j},fid,[indent '  ']);
+                        else
+                            warning('kml(%d).feature{%d} is a ''%s'' class object, not ''%s''.',...
+                                i,j,class(kml(i).feature{j}),'kml_feature');
+                        end
+                    end
+                end
+
+                fprintf(fid,'%s</Document>\n',indent);
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_feature.m
===================================================================
--- /issm/trunk/src/m/kml/kml_feature.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_feature.m	(revision 6454)
@@ -0,0 +1,159 @@
+%
+%  definition for the kml_feature super (base) and sub (derived) class.
+%
+%  [kml]=kml_feature(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, feature id, '')
+%    name          (char, name, '')
+%    visibility    (logical, visibility, true)
+%    open          (logical, open, false)
+%    snippet       (char, snippet, '')
+%    descript      (char, description, '')
+%    styleurl      (char, style url, '')
+%    style         (cell array, styles)
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_feature < kml_object
+    properties
+        name      ='';
+        visibility=true;
+        open      =false;
+        snippet   ='';
+        descript  ='';
+        styleurl  ='';
+        style     ={};
+    end
+    
+    methods
+        function [kml]=kml_feature(varargin)
+
+            kml=kml@kml_object(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_object()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_feature')
+                    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                        class(kml),inputname(1),string_dim(kml,i)));
+                end
+                disp@kml_object(kml(i));
+                disp(sprintf('          name: ''%s'''  ,kml(i).name));
+                disp(sprintf('    visibility: %g'      ,kml(i).visibility));
+                disp(sprintf('          open: %g'      ,kml(i).open));
+                disp(sprintf('       snippet: ''%s'''  ,kml(i).snippet));
+                disp(sprintf('      descript: ''%s'''  ,kml(i).descript));
+                disp(sprintf('      styleurl: ''%s'''  ,kml(i).styleurl));
+                if strcmp(class(kml),'kml_feature')
+                    disp(sprintf('         style: %s %s\n' ,string_size(kml(i).style),...
+                                 class(kml(i).style)));
+                else
+                    disp(sprintf('         style: %s %s'   ,string_size(kml(i).style),...
+                                 class(kml(i).style)));
+                end
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the features
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_feature')
+                    if ~isempty(kml(i).id)
+                        fprintf(fid,'%s<!Feature id="%s">\n',indent,kml(i).id);
+                    else
+                        fprintf(fid,'%s<!Feature>\n',indent);
+                    end
+                end
+                kml_write@kml_object(kml(i),fid,indent);
+                if ~isempty(kml(i).name)
+                    fprintf(fid,'%s  <name>%s</name>\n',indent,kml(i).name);
+                end
+                fprintf(fid,'%s  <visibility>%d</visibility>\n',indent,kml(i).visibility);
+                fprintf(fid,'%s  <open>%d</open>\n',indent,kml(i).open);
+                if ~isempty(kml(i).snippet)
+                    fprintf(fid,'%s  <Snippet maxLines="2">%s</Snippet>\n',indent,kml(i).snippet);
+                end
+                if ~isempty(kml(i).descript)
+                    fprintf(fid,'%s  <description>%s</description>\n',indent,kml(i).descript);
+                end
+                if ~isempty(kml(i).styleurl)
+                    fprintf(fid,'%s  <styleUrl>%s</styleUrl>\n',indent,kml(i).styleurl);
+                end
+
+%  loop over the styles for each feature
+
+                for j=1:numel(kml(i).style)
+                    if ~isempty(kml(i).style{j})
+                        if isa(kml(i).style{j},'kml_styleselector')
+                            kml_write(kml(i).style{j},fid,[indent '  ']);
+                        else
+                            warning('kml(%d).style{%d} is a ''%s'' class object, not ''%s''.',...
+                                i,j,class(kml(i).style{j}),'kml_styleselector');
+                        end
+                    end
+                end
+
+                if strcmp(class(kml),'kml_feature')
+                    fprintf(fid,'%s<!/Feature>\n',indent);
+                end
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_folder.m
===================================================================
--- /issm/trunk/src/m/kml/kml_folder.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_folder.m	(revision 6454)
@@ -0,0 +1,123 @@
+%
+%  definition for the kml_folder sub (derived) class.
+%
+%  [kml]=kml_folder(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, folder id, '')
+%    name          (char, name, '')
+%    visibility    (logical, visibility, true)
+%    open          (logical, open, false)
+%    snippet       (char, snippet, '')
+%    descript      (char, description, '')
+%    styleurl      (char, style url, '')
+%    style         (cell array, styles)
+%    feature       (cell array, placemark features)
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_folder < kml_container
+    properties
+        feature   ={};
+    end
+    
+    methods
+        function [kml]=kml_folder(varargin)
+
+            kml=kml@kml_container(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_container()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                    class(kml),inputname(1),string_dim(kml,i)));
+                disp@kml_container(kml(i));
+                disp(sprintf('       feature: %s %s\n' ,string_size(kml(i).feature),...
+                             class(kml(i).feature)));
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the folders
+
+            for i=1:numel(kml)
+                if ~isempty(kml(i).id)
+                    fprintf(fid,'%s<Folder id="%s">\n',indent,kml(i).id);
+                else
+                    fprintf(fid,'%s<Folder>\n',indent);
+                end
+                kml_write@kml_container(kml(i),fid,indent);
+
+%  loop over the features for each folder
+
+                for j=1:numel(kml(i).feature)
+                    if ~isempty(kml(i).feature{j})
+                        if isa(kml(i).feature{j},'kml_feature')
+                            kml_write(kml(i).feature{j},fid,[indent '  ']);
+                        else
+                            warning('kml(%d).feature{%d} is a ''%s'' class object, not ''%s''.',...
+                                i,j,class(kml(i).feature{j}),'kml_feature');
+                        end
+                    end
+                end
+
+                fprintf(fid,'%s</Folder>\n',indent);
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_geometry.m
===================================================================
--- /issm/trunk/src/m/kml/kml_geometry.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_geometry.m	(revision 6454)
@@ -0,0 +1,107 @@
+%
+%  definition for the kml_geometry super (base) and sub (derived) class.
+%
+%  [kml]=kml_geometry(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, geometry id, '')
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_geometry < kml_object
+    properties
+    end
+    
+    methods
+        function [kml]=kml_geometry(varargin)
+
+            kml=kml@kml_object(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_object()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_geometry')
+                    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                        class(kml),inputname(1),string_dim(kml,i)));
+                end
+                disp@kml_object(kml(i));
+                if strcmp(class(kml),'kml_geometry')
+                    disp(sprintf('\n'));
+                end
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the geometries
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_geometry')
+                    if ~isempty(kml(i).id)
+                        fprintf(fid,'%s<!Geometry id="%s">\n',indent,kml(i).id);
+                    else
+                        fprintf(fid,'%s<!Geometry>\n',indent);
+                    end
+                end
+                kml_write@kml_object(kml(i),fid,indent);
+                if strcmp(class(kml),'kml_geometry')
+                    fprintf(fid,'%s</!Geometry>\n',indent);
+                end
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_linearring.m
===================================================================
--- /issm/trunk/src/m/kml/kml_linearring.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_linearring.m	(revision 6454)
@@ -0,0 +1,123 @@
+%
+%  definition for the kml_linearring sub (derived) class.
+%
+%  [kml]=kml_linearring(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, linearring id, '')
+%    extrude       (logical, extrusion, false)
+%    tessellate    (logical, tessellation, false)
+%    altmode       (char, altitude mode, 'clampToGround')
+%    coords        (numeric, long/lat/alt (n x 3), empty)
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_linearring < kml_geometry
+    properties
+        extrude   =false;
+        tessellate=false;
+        altmode   ='clampToGround';
+        coords    =zeros(0,3);
+    end
+    
+    methods
+        function [kml]=kml_linearring(varargin)
+
+            kml=kml@kml_geometry(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_geometry()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                    class(kml),inputname(1),string_dim(kml,i)));
+                disp@kml_geometry(kml(i));
+                disp(sprintf('       extrude: %g'      ,kml(i).extrude));
+                disp(sprintf('    tessellate: %g'      ,kml(i).tessellate));
+                disp(sprintf('       altmode: ''%s'''  ,kml(i).altmode));
+                disp(sprintf('        coords: %s %s\n' ,string_size(kml(i).coords),...
+                             class(kml(i).coords)));
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+            if ~exist('fid','var') || isempty(fid)
+                fid=1;
+            end
+            if ~exist('indent','var') || isempty(indent)
+                indent='';
+            end
+
+%  loop over the linearrings
+
+            for i=1:numel(kml)
+                if ~isempty(kml(i).id)
+                    fprintf(fid,'%s<LinearRing id="%s">\n',indent,kml(i).id);
+                else
+                    fprintf(fid,'%s<LinearRing>\n',indent);
+                end
+                kml_write@kml_geometry(kml(i),fid,indent);
+                fprintf(fid,'%s  <extrude>%d</extrude>\n',indent,kml(i).extrude);
+                fprintf(fid,'%s  <tessellate>%d</tessellate>\n',indent,kml(i).tessellate);
+                fprintf(fid,'%s  <altitudeMode>%s</altitudeMode>\n',indent,kml(i).altmode);
+                fprintf(fid,'%s  <coordinates>\n',indent);
+
+%  loop over the coordinates for each linearring
+
+                for j=1:size(kml(i).coords,1)
+                    fprintf(fid,'%s    %0.16g,%0.16g,%0.16g\n',indent,kml(i).coords(j,:));
+                end
+
+                fprintf(fid,'%s  </coordinates>\n',indent);
+                fprintf(fid,'%s</LinearRing>\n',indent);
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_linestring.m
===================================================================
--- /issm/trunk/src/m/kml/kml_linestring.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_linestring.m	(revision 6454)
@@ -0,0 +1,123 @@
+%
+%  definition for the kml_linestring sub (derived) class.
+%
+%  [kml]=kml_linestring(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, linestring id, '')
+%    extrude       (logical, extrusion, false)
+%    tessellate    (logical, tessellation, false)
+%    altmode       (char, altitude mode, 'clampToGround')
+%    coords        (numeric, long/lat/alt (n x 3), empty)
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_linestring < kml_geometry
+    properties
+        extrude   =false;
+        tessellate=false;
+        altmode   ='clampToGround';
+        coords    =zeros(0,3);
+    end
+    
+    methods
+        function [kml]=kml_linestring(varargin)
+
+            kml=kml@kml_geometry(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_geometry()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                    class(kml),inputname(1),string_dim(kml,i)));
+                disp@kml_geometry(kml(i));
+                disp(sprintf('       extrude: %g'      ,kml(i).extrude));
+                disp(sprintf('    tessellate: %g'      ,kml(i).tessellate));
+                disp(sprintf('       altmode: ''%s'''  ,kml(i).altmode));
+                disp(sprintf('        coords: %s %s\n' ,string_size(kml(i).coords),...
+                             class(kml(i).coords)));
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+            if ~exist('fid','var') || isempty(fid)
+                fid=1;
+            end
+            if ~exist('indent','var') || isempty(indent)
+                indent='';
+            end
+
+%  loop over the linestrings
+
+            for i=1:numel(kml)
+                if ~isempty(kml(i).id)
+                    fprintf(fid,'%s<LineString id="%s">\n',indent,kml(i).id);
+                else
+                    fprintf(fid,'%s<LineString>\n',indent);
+                end
+                kml_write@kml_geometry(kml(i),fid,indent);
+                fprintf(fid,'%s  <extrude>%d</extrude>\n',indent,kml(i).extrude);
+                fprintf(fid,'%s  <tessellate>%d</tessellate>\n',indent,kml(i).tessellate);
+                fprintf(fid,'%s  <altitudeMode>%s</altitudeMode>\n',indent,kml(i).altmode);
+                fprintf(fid,'%s  <coordinates>\n',indent);
+
+%  loop over the coordinates for each linestring
+
+                for j=1:size(kml(i).coords,1)
+                    fprintf(fid,'%s    %0.16g,%0.16g,%0.16g\n',indent,kml(i).coords(j,:));
+                end
+
+                fprintf(fid,'%s  </coordinates>\n',indent);
+                fprintf(fid,'%s</LineString>\n',indent);
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_linestyle.m
===================================================================
--- /issm/trunk/src/m/kml/kml_linestyle.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_linestyle.m	(revision 6454)
@@ -0,0 +1,104 @@
+%
+%  definition for the kml_linestyle sub (derived) class.
+%
+%  [kml]=kml_linestyle(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, linestyle id, '')
+%    color         (char, opacity/color in hex aabbggrr, 'ffffffff')
+%    colormode     (char, color mode , 'normal')
+%    width         (numeric, line width (in pixels), 1)
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_linestyle < kml_colorstyle
+    properties
+        width     =1;
+    end
+    
+    methods
+        function [kml]=kml_linestyle(varargin)
+
+            kml=kml@kml_colorstyle(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_colorstyle()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                    class(kml),inputname(1),string_dim(kml,i)));
+                disp@kml_colorstyle(kml(i));
+                disp(sprintf('         width: %d\n'    ,kml(i).width));
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the linestyles
+
+            for i=1:numel(kml)
+                if ~isempty(kml(i).id)
+                    fprintf(fid,'%s<LineStyle id="%s">\n',indent,kml(i).id);
+                else
+                    fprintf(fid,'%s<LineStyle>\n',indent);
+                end
+                kml_write@kml_colorstyle(kml(i),fid,indent);
+                fprintf(fid,'%s  <width>%d</width>\n',indent,kml(i).width);
+                fprintf(fid,'%s</LineStyle>\n',indent);
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_multigeometry.m
===================================================================
--- /issm/trunk/src/m/kml/kml_multigeometry.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_multigeometry.m	(revision 6454)
@@ -0,0 +1,116 @@
+%
+%  definition for the kml_multigeometry sub (derived) class.
+%
+%  [kml]=kml_multigeometry(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, multigeometry id, '')
+%    geometry      (cell array, multigeometry geometry)
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_multigeometry < kml_geometry
+    properties
+        geometry  ={};
+    end
+    
+    methods
+        function [kml]=kml_multigeometry(varargin)
+
+            kml=kml@kml_geometry(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_geometry()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                    class(kml),inputname(1),string_dim(kml,i)));
+                disp@kml_geometry(kml(i));
+                disp(sprintf('      geometry: %s %s\n' ,string_size(kml(i).geometry),...
+                             class(kml(i).geometry)));
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the multigeometry
+
+            for i=1:numel(kml)
+                if ~isempty(kml(i).id)
+                    fprintf(fid,'%s<MultiGeometry id="%s">\n',indent,kml(i).id);
+                else
+                    fprintf(fid,'%s<MultiGeometry>\n',indent);
+                end
+                kml_write@kml_geometry(kml(i),fid,indent);
+
+%  loop over the geometry elements for each multigeometry
+
+                for j=1:numel(kml(i).geometry)
+                    if ~isempty(kml(i).geometry{j})
+                        if isa(kml(i).geometry{j},'kml_geometry')
+                            kml_write(kml(i).geometry{j},fid,[indent '  ']);
+                        else
+                            warning('kml(%d).geometry{%d} is a ''%s'' class object, not ''%s''.',...
+                                i,j,class(kml(i).geometry{j}),'kml_geometry');
+                        end
+                    end
+                end
+
+                fprintf(fid,'%s</MultiGeometry>\n',indent);
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_object.m
===================================================================
--- /issm/trunk/src/m/kml/kml_object.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_object.m	(revision 6454)
@@ -0,0 +1,108 @@
+%
+%  definition for the kml_object super (base) class.
+%
+%  [kml]=kml_object(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, object id, '')
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_object
+    properties
+        id        ='';
+    end
+    
+    methods
+        function [kml]=kml_object(varargin)
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_object')
+                    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                        class(kml),inputname(1),string_dim(kml,i)));
+                end
+
+                if strcmp(class(kml),'kml_object')
+                    disp(sprintf('            id: ''%s''\n',kml(i).id));
+                else
+                    disp(sprintf('            id: ''%s'''  ,kml(i).id));
+                end
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the objects
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_object')
+                    if ~isempty(kml(i).id)
+                        fprintf(fid,'%s<!Object id="%s">\n',indent,kml(i).id);
+                    else
+                        fprintf(fid,'%s<!Object>\n',indent);
+                    end
+                end
+
+                if strcmp(class(kml),'kml_object')
+                    fprintf(fid,'%s</!Object>\n',indent);
+                end
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_placemark.m
===================================================================
--- /issm/trunk/src/m/kml/kml_placemark.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_placemark.m	(revision 6454)
@@ -0,0 +1,123 @@
+%
+%  definition for the kml_placemark sub (derived) class.
+%
+%  [kml]=kml_placemark(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, placemark id, '')
+%    name          (char, name, '')
+%    visibility    (logical, visibility, true)
+%    open          (logical, open, false)
+%    snippet       (char, snippet, '')
+%    descript      (char, description, '')
+%    styleurl      (char, style url, '')
+%    style         (cell array, styles)
+%    geometry      (kml_geometry, placemark geometry)
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_placemark < kml_feature
+    properties
+        geometry  =kml_geometry.empty();
+    end
+    
+    methods
+        function [kml]=kml_placemark(varargin)
+
+            kml=kml@kml_feature(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_feature()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                    class(kml),inputname(1),string_dim(kml,i)));
+                disp@kml_feature(kml(i));
+                disp(sprintf('      geometry: %s %s\n' ,string_size(kml(i).geometry),...
+                             class(kml(i).geometry)));
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the placemarks
+
+            for i=1:numel(kml)
+                if ~isempty(kml(i).id)
+                    fprintf(fid,'%s<Placemark id="%s">\n',indent,kml(i).id);
+                else
+                    fprintf(fid,'%s<Placemark>\n',indent);
+                end
+                kml_write@kml_feature(kml(i),fid,indent);
+
+%  loop over the geometry elements for each placemark
+
+                for j=1:min(1,numel(kml(i).geometry))
+                    if ~isempty(kml(i).geometry(j))
+                        if isa(kml(i).geometry(j),'kml_geometry')
+                            kml_write(kml(i).geometry(j),fid,[indent '  ']);
+                        else
+                            warning('kml(%d).geometry(%d) is a ''%s'' class object, not ''%s''.',...
+                                i,j,class(kml(i).geometry(j)),'kml_geometry');
+                        end
+                    end
+                end
+
+                fprintf(fid,'%s</Placemark>\n',indent);
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_polygon.m
===================================================================
--- /issm/trunk/src/m/kml/kml_polygon.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_polygon.m	(revision 6454)
@@ -0,0 +1,140 @@
+%
+%  definition for the kml_polygon sub (derived) class.
+%
+%  [kml]=kml_polygon(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, polygon id, '')
+%    extrude       (logical, extrusion, false)
+%    tessellate    (logical, tessellation, false)
+%    altmode       (char, altitude mode, 'clampToGround')
+%    outer         (kml_linearring, outer boundary)
+%    inner         (kml_linearring, inner boundaries)
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_polygon < kml_geometry
+    properties
+        extrude   =false;
+        tessellate=false;
+        altmode   ='clampToGround';
+        outer     =kml_linearring();
+        inner     =kml_linearring.empty();
+    end
+    
+    methods
+        function [kml]=kml_polygon(varargin)
+
+            kml=kml@kml_geometry(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_geometry()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                    class(kml),inputname(1),string_dim(kml,i)));
+                disp@kml_geometry(kml(i));
+                disp(sprintf('       extrude: %g'      ,kml(i).extrude));
+                disp(sprintf('    tessellate: %g'      ,kml(i).tessellate));
+                disp(sprintf('       altmode: ''%s'''  ,kml(i).altmode));
+                disp(sprintf('         outer: %s %s'   ,string_size(kml(i).outer),...
+                             class(kml(i).outer)));
+                disp(sprintf('         inner: %s %s\n' ,string_size(kml(i).inner),...
+                             class(kml(i).inner)));
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the polygons
+
+            for i=1:numel(kml)
+                if ~isempty(kml(i).id)
+                    fprintf(fid,'%s<Polygon id="%s">\n',indent,kml(i).id);
+                else
+                    fprintf(fid,'%s<Polygon>\n',indent);
+                end
+                kml_write@kml_geometry(kml(i),fid,indent);
+                fprintf(fid,'%s  <extrude>%d</extrude>\n',indent,kml(i).extrude);
+                fprintf(fid,'%s  <tessellate>%d</tessellate>\n',indent,kml(i).tessellate);
+                fprintf(fid,'%s  <altitudeMode>%s</altitudeMode>\n',indent,kml(i).altmode);
+                fprintf(fid,'%s  <outerBoundaryIs>\n',indent);
+                if isa(kml(i).outer,'kml_linearring')
+                    kml_write(kml(i).outer,fid,[indent '    ']);
+                else
+                    warning('kml(%d).outer is a ''%s'' class object, not ''%s''.',...
+                        i,class(kml(i).outer),'kml_linearring');
+                end
+                fprintf(fid,'%s  </outerBoundaryIs>\n',indent);
+
+%  loop over any inner boundaries for each polygon
+
+                if isa(kml(i).inner,'kml_linearring')
+                    for j=1:numel(kml(i).inner)
+                        fprintf(fid,'%s  <innerBoundaryIs>\n',indent);
+                        kml_write(kml(i).inner(j),fid,[indent '    ']);
+                        fprintf(fid,'%s  </innerBoundaryIs>\n',indent);
+                    end
+                else
+                    warning('kml(%d).inner is a ''%s'' class object, not ''%s''.',...
+                        i,class(kml(i).inner),'kml_linearring');
+                end
+
+                fprintf(fid,'%s</Polygon>\n',indent);
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_polystyle.m
===================================================================
--- /issm/trunk/src/m/kml/kml_polystyle.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_polystyle.m	(revision 6454)
@@ -0,0 +1,108 @@
+%
+%  definition for the kml_polystyle sub (derived) class.
+%
+%  [kml]=kml_polystyle(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, polystyle id, '')
+%    color         (char, opacity/color in hex aabbggrr, 'ffffffff')
+%    colormode     (char, color mode , 'normal')
+%    fill          (logical, polygon fill, true)
+%    outline       (logical, polygon outline, true)
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_polystyle < kml_colorstyle
+    properties
+        fill      =true;
+        outline   =true;
+    end
+    
+    methods
+        function [kml]=kml_polystyle(varargin)
+
+            kml=kml@kml_colorstyle(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_colorstyle()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                    class(kml),inputname(1),string_dim(kml,i)));
+                disp@kml_colorstyle(kml(i));
+                disp(sprintf('          fill: %d'      ,kml(i).fill));
+                disp(sprintf('       outline: %d\n'    ,kml(i).outline));
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the polystyles
+
+            for i=1:numel(kml)
+                if ~isempty(kml(i).id)
+                    fprintf(fid,'%s<PolyStyle id="%s">\n',indent,kml(i).id);
+                else
+                    fprintf(fid,'%s<PolyStyle>\n',indent);
+                end
+                kml_write@kml_colorstyle(kml(i),fid,indent);
+                fprintf(fid,'%s  <fill>%d</fill>\n',indent,kml(i).fill);
+                fprintf(fid,'%s  <outline>%d</outline>\n',indent,kml(i).outline);
+                fprintf(fid,'%s</PolyStyle>\n',indent);
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_style.m
===================================================================
--- /issm/trunk/src/m/kml/kml_style.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_style.m	(revision 6454)
@@ -0,0 +1,162 @@
+%
+%  definition for the kml_style sub (derived) class.
+%
+%  [kml]=kml_style(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, style id, '')
+%    icon          (char, icon style, '')
+%    label         (char, label style, '')
+%    line          (char, line style, '')
+%    poly          (char, poly style, '')
+%    balloon       (char, balloon style, '')
+%    list          (char, list style, '')
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_style < kml_styleselector
+    properties
+%         icon      =kml_iconstyle.empty();
+%         label     =kml_labelstyle.empty();
+        icon      =[];
+        label     =[];
+        line      =kml_linestyle.empty();
+        poly      =kml_polystyle.empty();
+%         balloon   =kml_balloonstyle.empty();
+%         list      =kml_liststyle.empty();
+        balloon   =[];
+        list      =[];
+    end
+    
+    methods
+        function [kml]=kml_style(varargin)
+
+            kml=kml@kml_styleselector(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_styleselector()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                    class(kml),inputname(1),string_dim(kml,i)));
+                disp@kml_styleselector(kml(i));
+                disp(sprintf('          icon: %s %s'   ,string_size(kml(i).icon),...
+                             class(kml(i).icon)));
+                disp(sprintf('         label: %s %s'   ,string_size(kml(i).label),...
+                             class(kml(i).label)));
+                disp(sprintf('          line: %s %s'   ,string_size(kml(i).line),...
+                             class(kml(i).line)));
+                disp(sprintf('          poly: %s %s'   ,string_size(kml(i).poly),...
+                             class(kml(i).poly)));
+                disp(sprintf('       balloon: %s %s'   ,string_size(kml(i).balloon),...
+                             class(kml(i).balloon)));
+                disp(sprintf('          list: %s %s\n' ,string_size(kml(i).list),...
+                             class(kml(i).list)));
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the styles
+
+            for i=1:numel(kml)
+                if ~isempty(kml(i).id)
+                    fprintf(fid,'%s<Style id="%s">\n',indent,kml(i).id);
+                else
+                    fprintf(fid,'%s<Style>\n',indent);
+                end
+                kml_write@kml_styleselector(kml(i),fid,indent);
+%                 if isa(kml(i).icon,'kml_iconstyle')
+%                     kml_write(kml(i).icon,fid,[indent '    ']);
+%                 else
+%                     warning('kml(%d).icon is a ''%s'' class object, not ''%s''.',...
+%                         i,class(kml(i).icon),'kml_iconstyle');
+%                 end
+%                 if isa(kml(i).label,'kml_labelstyle')
+%                     kml_write(kml(i).label,fid,[indent '    ']);
+%                 else
+%                     warning('kml(%d).label is a ''%s'' class object, not ''%s''.',...
+%                         i,class(kml(i).label),'kml_labelstyle');
+%                 end
+                if isa(kml(i).line,'kml_linestyle')
+                    kml_write(kml(i).line,fid,[indent '    ']);
+                else
+                    warning('kml(%d).line is a ''%s'' class object, not ''%s''.',...
+                        i,class(kml(i).line),'kml_linestyle');
+                end
+                if isa(kml(i).poly,'kml_polystyle')
+                    kml_write(kml(i).poly,fid,[indent '    ']);
+                else
+                    warning('kml(%d).poly is a ''%s'' class object, not ''%s''.',...
+                        i,class(kml(i).poly),'kml_polystyle');
+                end
+%                 if isa(kml(i).balloon,'kml_balloonstyle')
+%                     kml_write(kml(i).balloon,fid,[indent '    ']);
+%                 else
+%                     warning('kml(%d).balloon is a ''%s'' class object, not ''%s''.',...
+%                         i,class(kml(i).balloon),'kml_balloonstyle');
+%                 end
+%                 if isa(kml(i).list,'kml_liststyle')
+%                     kml_write(kml(i).list,fid,[indent '    ']);
+%                 else
+%                     warning('kml(%d).list is a ''%s'' class object, not ''%s''.',...
+%                         i,class(kml(i).list),'kml_liststyle');
+%                 end
+                fprintf(fid,'%s</Style>\n',indent);
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_styleselector.m
===================================================================
--- /issm/trunk/src/m/kml/kml_styleselector.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_styleselector.m	(revision 6454)
@@ -0,0 +1,107 @@
+%
+%  definition for the kml_styleselector super (base) and sub (derived) class.
+%
+%  [kml]=kml_styleselector(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, styleselector id, '')
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_styleselector < kml_object
+    properties
+    end
+    
+    methods
+        function [kml]=kml_styleselector(varargin)
+
+            kml=kml@kml_object(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_object()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_styleselector')
+                    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                        class(kml),inputname(1),string_dim(kml,i)));
+                end
+                disp@kml_object(kml(i));
+                if strcmp(class(kml),'kml_styleselector')
+                    disp(sprintf('\n'));
+                end
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the styleselectors
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_styleselector')
+                    if ~isempty(kml(i).id)
+                        fprintf(fid,'%s<!StyleSelector id="%s">\n',indent,kml(i).id);
+                    else
+                        fprintf(fid,'%s<!StyleSelector>\n',indent);
+                    end
+                end
+                kml_write@kml_object(kml(i),fid,indent);
+                if strcmp(class(kml),'kml_styleselector')
+                    fprintf(fid,'%s</!StyleSelector>\n',indent);
+                end
+            end
+
+        end
+        
+    end
+    
+end
+
Index: /issm/trunk/src/m/kml/kml_substyle.m
===================================================================
--- /issm/trunk/src/m/kml/kml_substyle.m	(revision 6454)
+++ /issm/trunk/src/m/kml/kml_substyle.m	(revision 6454)
@@ -0,0 +1,107 @@
+%
+%  definition for the kml_substyle super (base) and sub (derived) class.
+%
+%  [kml]=kml_substyle(varargin)
+%
+%  where the optional varargin and defaults are:
+%    id            (char, substyle id, '')
+%
+%  note that zero arguments constructs a default instance; one
+%  argument of the class copies the instance; and two or more
+%  arguments constructs a new instance from the arguments.
+%
+classdef kml_substyle < kml_object
+    properties
+    end
+    
+    methods
+        function [kml]=kml_substyle(varargin)
+
+            kml=kml@kml_object(varargin{:});
+
+            switch nargin
+
+%  create a default object
+
+                case 0
+
+%  copy the object or create the object from the input
+
+                otherwise
+                    if (nargin == 1) && isa(varargin{1},class(kml))
+                        kml=varargin{1};
+
+                    else
+                        fnames=fieldnames(kml);
+
+                        for i=length(fieldnames(kml_object()))+1:min(nargin,length(fnames))
+                            if isa(varargin{i},class(kml.(fnames{i})))
+                                if ~isempty(varargin{i})
+                                    kml.(fnames{i})=varargin{i};
+                                end
+                            else
+                                if ~isempty(inputname(i))
+                                    warning('Argument ''%s'' for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        inputname(i),fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                else
+                                    warning('Argument %d for field ''%s'' is a ''%s'' class object, not ''%s''.',...
+                                        i           ,fnames{i},class(varargin{i}),class(kml.(fnames{i})));
+                                end
+                            end
+                        end
+                    end
+
+            end
+
+        end
+
+%  display the object
+
+        function []=disp(kml)
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_substyle')
+                    disp(sprintf('class ''%s'' object ''%s%s'' = \n',...
+                        class(kml),inputname(1),string_dim(kml,i)));
+                end
+                disp@kml_object(kml(i));
+                if strcmp(class(kml),'kml_substyle')
+                    disp(sprintf('\n'));
+                end
+            end
+
+        end
+
+%  write the object
+
+        function []=kml_write(kml,fid,indent)
+
+           if ~exist('fid','var') || isempty(fid)
+               fid=1;
+           end
+           if ~exist('indent','var') || isempty(indent)
+               indent='';
+           end
+
+%  loop over the substyles
+
+            for i=1:numel(kml)
+                if strcmp(class(kml),'kml_substyle')
+                    if ~isempty(kml(i).id)
+                        fprintf(fid,'%s<!SubStyle id="%s">\n',indent,kml(i).id);
+                    else
+                        fprintf(fid,'%s<!SubStyle>\n',indent);
+                    end
+                end
+                kml_write@kml_object(kml(i),fid,indent);
+                if strcmp(class(kml),'kml_substyle')
+                    fprintf(fid,'%s<!/SubStyle>\n',indent);
+                end
+            end
+
+        end
+        
+    end
+    
+end
+
