Environmental Engineering Reference
In-Depth Information
The loop is ended when the right mouse button is used and the button variable
but contains a 3. Finally, after the loop, the polyline is plotted on top of the map (in
red color) and the info-text is deleted.
% --------------------------- Set Locations------------------------
h0 = text (xmin,ymin-0.05*(ymax-ymin),'Set locations: left mouse…
button: set; right: last value','BackgroundColor','y',…
'EdgeColor','red','LineWidth',2);
h = gca; hold on;
but = 1; n = 0;
while but == 1
[xj,yj,but] = ginput(1);
plot (xj,yj,'bo');
count = count+1;
xloc(count) = xj; yloc(count) = yj;
end
delete (h0)
The procedure, described for a polyline, is repeated for the location set. There
are minor differences: instead of a red cross, a blue circle becomes the indicator on
the map, and there is no connecting line drawn finally.
An example result of digitizing work with the presented M-file is given in
Fig. 17.3 .
6
5
4
3
2
1
0
-1
-2
Fig. 17.3 Effect of digitizing
work on the map of an island
(shoreline in red, locations in
blue)
-3
Search WWH ::




Custom Search