Commit 8731ccabf9d7e8f5c44cdad7f622b443e4c10f37

Authored by Paul Nicot
1 parent 7d111340
Exists in master

cree une png de la resolution et de la position de la georectification

Showing 1 changed file with 37 additions and 5 deletions   Show diff stats
r_interp_opc_UTM.m
@@ -63,6 +63,10 @@ tifdir = [zonedir,'/tif']; @@ -63,6 +63,10 @@ tifdir = [zonedir,'/tif'];
63 63
64 %% Load the calibration file 64 %% Load the calibration file
65 load(calfile); 65 load(calfile);
  66 +% files for context image
  67 +S = shaperead('/home/nicp0003/LND_LSLE_line_UTM.shp');
  68 +[res,Rr] = geotiffread([rootdir '/' estr(1:4) '/calib/resolution_' estr(1:4) '_UTM.tif']);
  69 +res = double(res);
66 70
67 %% Creation of the grid 71 %% Creation of the grid
68 72
@@ -75,7 +79,7 @@ elseif zone == 2 % entree BHH + au large @@ -75,7 +79,7 @@ elseif zone == 2 % entree BHH + au large
75 llat = 5353902; ulat = 5358298; 79 llat = 5353902; ulat = 5358298;
76 80
77 elseif zone == 3 % entree BHH 81 elseif zone == 3 % entree BHH
78 - llon = 51028; rlon = 512939; 82 + llon = 510208; rlon = 512939;
79 llat = 5353902; ulat = 5355976; 83 llat = 5353902; ulat = 5355976;
80 84
81 % elseif zone == 4 % mouillage AWAC 85 % elseif zone == 4 % mouillage AWAC
@@ -97,8 +101,8 @@ end @@ -97,8 +101,8 @@ end
97 101
98 102
99 % update grid with resolution 103 % update grid with resolution
100 -str_resol = num2str(resol*100);  
101 -lon1 = llon ; lon2 = rlon; 104 +%str_resol = num2str(resol*100);
  105 +%lon1 = llon ; lon2 = rlon;
102 x1vec = llon:resol:rlon; 106 x1vec = llon:resol:rlon;
103 y1vec = llat:resol:ulat; 107 y1vec = llat:resol:ulat;
104 y1vec = y1vec'; 108 y1vec = y1vec';
@@ -137,7 +141,35 @@ if iEnd == 0 @@ -137,7 +141,35 @@ if iEnd == 0
137 iEnd = nFiles; 141 iEnd = nFiles;
138 end 142 end
139 143
140 -% georect loop 144 +%% plot context image
  145 +h = figure; set(h,'visible','off');
  146 +
  147 +lev1 = [2:2:10];
  148 +mapshow(res, Rr,'DisplayType', 'contour','LineStyle','--', ...
  149 + 'LevelList',lev1,'edgecolor', 'none','LineColor', 'black',...
  150 + 'ShowText', 'on');
  151 +
  152 +hold on;
  153 +lev2 = [15,25,50,75,100];
  154 +mapshow(res, Rr,'DisplayType', 'contour','LineStyle','--', ...
  155 + 'LevelList',lev2,'edgecolor', 'none','LineColor', 'black', ...
  156 + 'ShowText', 'on');
  157 +
  158 +mapshow(S,'color',[0.3 0.3 0.3],'LineWidth',1);
  159 +
  160 +ylim([5353000, 5363000]);
  161 +xlim([506000, 515000]);
  162 +
  163 +line([rlon llon],[llat llat],'Color',[1 0 0]);
  164 +line([llon rlon],[ulat ulat],'Color',[1 0 0]);
  165 +line([rlon rlon],[llat ulat],'Color',[1 0 0]);
  166 +line([llon llon],[llat ulat],'Color',[1 0 0]);
  167 +
  168 +iname = [zonedir,'/georect_context_',estr,'.png'];
  169 +saveas(h,iname);
  170 +
  171 +
  172 +%% georect loop
141 for n = iFirst:nSkip:iEnd 173 for n = iFirst:nSkip:iEnd
142 174
143 imfilename = imfiles(n).name; 175 imfilename = imfiles(n).name;
@@ -218,7 +250,7 @@ for n = iFirst:nSkip:iEnd @@ -218,7 +250,7 @@ for n = iFirst:nSkip:iEnd
218 end 250 end
219 251
220 %% write a README.txt with the georectification informations 252 %% write a README.txt with the georectification informations
221 -fidname = [zonedir,'/README.txt'] 253 +fidname = [zonedir,'/README.txt'];
222 fid = fopen(fidname,'w'); 254 fid = fopen(fidname,'w');
223 255
224 fprintf(fid,'%s\n','README.txt'); 256 fprintf(fid,'%s\n','README.txt');