Changeset 15206
- Timestamp:
- 06/06/13 17:00:05 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/googlemaps.m
r15178 r15206 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 … … 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)]; … … 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'... … … 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
Note:
See TracChangeset
for help on using the changeset viewer.