@@ -40,7 +40,7 @@ function gridmaps(grids,outd,varargin)
4040%
4141% Author: F. Beauducel, C. Brunet, WEBOBS/IPGP
4242% Created: 2013-09-13 in Paris, France
43- % Updated: 2021-05-19
43+ % Updated: 2022-07-21
4444
4545
4646WO = readcfg ;
@@ -117,10 +117,11 @@ function gridmaps(grids,outd,varargin)
117117lwmajor = field2num(P ,' CONTOURLINES_MAJOR_LINEWIDTH' ,1 );
118118zerolevel = isok(P ,' CONTOURLINES_ZERO_LEVEL' ,0 );
119119convertopt = field2str(WO ,' CONVERT_COLORSPACE' ,' -colorspace sRGB' );
120+ shading = field2str(P ,' SHADING' ,' light' );
120121feclair = field2num(P ,' COLOR_LIGHTENING' ,2 );
121122csat = field2num(P ,' COLOR_SATURATION' ,.8 );
122123zcut = field2num(P ,' ZCUT' ,0.1 );
123- laz = field2num(P ,' LIGHT_AZIMUTH' ,45 );
124+ laz = field2num(P ,' LIGHT_AZIMUTH' ,[- 45 , 45 ] );
124125lct = field2num(P ,' LIGHT_CONTRAST' ,1 );
125126if isfield(P ,' LANDCOLORMAP' ) && exist(P .LANDCOLORMAP ,' file' )
126127 cmap = eval(P .LANDCOLORMAP );
@@ -139,7 +140,7 @@ function gridmaps(grids,outd,varargin)
139140end
140141demoptions = {' Interp' ,' Lake' ,' LakeZmin' ,0 ,' ZCut' ,zcut ,' Azimuth' ,laz , ...
141142 ' Contrast' ,lct ,' LandColor' ,cmap ,' SeaColor' ,sea ,' Watermark' ,feclair , ...
142- ' Saturation' ,csat ,' latlon' ,' legend' ,' axisequal' ,' manual' };
143+ ' Saturation' ,csat ,' latlon' ,' shading ' , shading , ' legend' ,' axisequal' ,' manual' };
143144
144145% loads all needed grid's parameters & associated nodes
145146for g = 1 : length(grids )
@@ -192,7 +193,7 @@ function gridmaps(grids,outd,varargin)
192193 s = split(grids{g },' .' );
193194 G = GRIDS.(s{1 }).(s{2 });
194195 % GRIDMAPS.rc SRTM1 option applies only if not defined in the PROC's configuration
195- if isok(P ,' DEM_SRTM1' ) & (~isfield(G ,' DEM_SRTM1' ) || merge )
196+ if isok(P ,' DEM_SRTM1' ) && (~isfield(G ,' DEM_SRTM1' ) || merge )
196197 G.DEM_SRTM1 = ' Y' ;
197198 end
198199 if request
@@ -304,12 +305,12 @@ function gridmaps(grids,outd,varargin)
304305 clrgb = [0 ,0 ,0 ];
305306 end
306307 if length(dz1 ) > 1
307- [~ ,h ] = contour(x ,y ,z ,dz1 ,' -' , ' Color ' , clrgb );
308- set(h ,' LineWidth' ,lwminor );
308+ [~ ,h ] = contour(x ,y ,z ,dz1 ,' -' );
309+ set(h ,' LineColor ' , clrgb , ' LineWidth' ,lwminor );
309310 end
310311 if length(dz0 ) > 1
311- [cs ,h ] = contour(x ,y ,z ,dz0 ,' -' , ' Color ' , clrgb );
312- set(h ,' LineWidth' ,lwmajor );
312+ [cs ,h ] = contour(x ,y ,z ,dz0 ,' -' );
313+ set(h ,' LineColor ' , clrgb , ' LineWidth' ,lwmajor );
313314 if isok(P ,' CONTOURLINES_LABEL' )
314315 clabel(cs ,h ,dz0 ,' Color' ,clrgb ,' FontSize' ,7 ,' FontWeight' ,' bold' ,' LabelSpacing' ,288 )
315316 end
@@ -381,7 +382,8 @@ function gridmaps(grids,outd,varargin)
381382 xylim = [get(gca ,' XLim' ),get(gca ,' YLim' )];
382383
383384 % copyright
384- copyright = sprintf(' {\\ bf\\ copyright %s } - {%s } - %s / %s ' ,WO .COPYRIGHT ,strrep(grids{g },' _' ,' \_' ),demcopyright ,datestr(now ,0 ));
385+ copyright = sprintf(' {\\ bf\\ copyright %s , %s } - {%s } - %s / %s ' ,num2roman(str2double(datestr(now ,' yyyy' ))), ...
386+ WO .COPYRIGHT ,strrep(grids{g },' _' ,' \_' ),demcopyright ,datestr(now ,0 ));
385387 axes(' Position' ,[pos(1 ),0 ,pos(3 ),pos(2 )])
386388 axis([0 ,1 ,0 ,1 ]); axis off
387389 text(.5 ,0 ,copyright ,' Color' ,.4 *[1 ,1 ,1 ],' FontSize' ,9 ,' HorizontalAlignment' ,' center' ,' VerticalAlignment' ,' bottom' )
@@ -437,7 +439,10 @@ function gridmaps(grids,outd,varargin)
437439 txt = regexprep(sprintf(' %s : %s ' ,NN(gg ).alias{knn },NN(gg ).name{knn }),' "' ,' ' );
438440 fprintf(fid ,' <AREA href="%s " title="%s " shape=circle coords="%d ,%d ,%d ">\n ' ,lnk ,txt ,x ,y ,r );
439441 else
440- txt = unicode2native(regexprep(sprintf(' <b>%s </b>: %s ' ,NN(gg ).alias{knn },NN(gg ).name{knn }),' "' ,' ' ),' utf-8' );
442+ txt = regexprep(sprintf(' <b>%s </b>: %s ' ,NN(gg ).alias{knn },NN(gg ).name{knn }),' "' ,' ' );
443+ try
444+ txt = unicode2native(txt ,' UTF-8' );
445+ end
441446 txt = regexprep(char(txt ),' '' ' ,' \\'' ' );
442447 fprintf(fid ,' <AREA href="%s " onMouseOut="nd()" onMouseOver="overlib(''%s'' )" shape=circle coords="%d ,%d ,%d ">\n ' ,lnk ,txt ,x ,y ,r );
443448 end
0 commit comments