source:
issm/oecreview/Archive/14312-15392/ISSM-15205-15206.diff
Last change on this file was 15393, checked in by , 12 years ago | |
---|---|
File size: 1.8 KB |
-
../trunk-jpl/src/m/plot/googlemaps.m
80 80 rows = ceil(dy/maxsize); 81 81 82 82 %calculate pixel dimensions of each small image 83 bottom = 1 20;84 largura= ceil(dx/cols);85 altura= ceil(dy/rows);86 alturaplus = altura+ bottom;83 bottom = 100; 84 width = ceil(dx/cols); 85 height = ceil(dy/rows); 86 heightplus = height + bottom; 87 87 88 88 %Initialize final image 89 89 final = zeros(floor(dy),floor(dx),3);%RGB image 90 90 for x=0:cols-1, 91 91 for y=0:rows-1, 92 dxn = largura* (0.5 + x);93 dyn = altura* (0.5 + y);92 dxn = width * (0.5 + x); 93 dyn = height * (0.5 + y); 94 94 [latn, lonn] = pixelstolatlon(ulx + dxn, uly - dyn - bottom/2, zoom); 95 95 position = [num2str(latn) ',' num2str(lonn)]; 96 96 disp(['Google Earth tile: ' num2str(x) '/' num2str(cols-1) ' ' num2str(y) '/' num2str(rows-1) ' (center: ' position ')']); … … 98 98 params = [... 99 99 'center=' position ... 100 100 '&zoom=' num2str(zoom)... 101 '&size=' num2str( largura) 'x' num2str(alturaplus)...101 '&size=' num2str(width) 'x' num2str(heightplus)... 102 102 '&maptype=satellite'... 103 103 '&sensor=false'... 104 104 '&scale=' num2str(scale)]; 105 105 url = ['http://maps.google.com/maps/api/staticmap?' params]; 106 106 [X, map]=imread(url,'png'); 107 107 X=ind2rgb(X,map); 108 indx1 = floor(x*largura)+1; 109 indx2 = min(floor(dx),floor(x*largura)+size(X,2)); 110 indy1 = floor(y*altura)+1; 111 indy2 = min(floor(dy),floor(y*altura)+size(X,1)); 108 indx1 = floor(x*width)+1; 109 indx2 = min(floor(dx),floor(x*width)+size(X,2)); 110 indy1 = floor(y*height)+1; 111 [floor(dy),floor(y*height)+size(X,1)] 112 [height heightplus] 113 indy2 = min(floor(dy),floor(y*height)+size(X,1)); 112 114 final(indy1:indy2,indx1:indx2,:)=X(1:indy2-indy1+1,1:indx2-indx1+1,:); 113 115 end 114 116 end
Note:
See TracBrowser
for help on using the repository browser.