[15393] | 1 | Index: ../trunk-jpl/src/m/plot/googlemaps.m
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/m/plot/googlemaps.m (revision 15205)
|
---|
| 4 | +++ ../trunk-jpl/src/m/plot/googlemaps.m (revision 15206)
|
---|
| 5 | @@ -80,17 +80,17 @@
|
---|
| 6 | rows = ceil(dy/maxsize);
|
---|
| 7 |
|
---|
| 8 | %calculate pixel dimensions of each small image
|
---|
| 9 | -bottom = 120;
|
---|
| 10 | -largura = ceil(dx/cols);
|
---|
| 11 | -altura = ceil(dy/rows);
|
---|
| 12 | -alturaplus = altura + bottom;
|
---|
| 13 | +bottom = 100;
|
---|
| 14 | +width = ceil(dx/cols);
|
---|
| 15 | +height = ceil(dy/rows);
|
---|
| 16 | +heightplus = height + bottom;
|
---|
| 17 |
|
---|
| 18 | %Initialize final image
|
---|
| 19 | final = zeros(floor(dy),floor(dx),3);%RGB image
|
---|
| 20 | for x=0:cols-1,
|
---|
| 21 | for y=0:rows-1,
|
---|
| 22 | - dxn = largura * (0.5 + x);
|
---|
| 23 | - dyn = altura * (0.5 + y);
|
---|
| 24 | + dxn = width * (0.5 + x);
|
---|
| 25 | + dyn = height * (0.5 + y);
|
---|
| 26 | [latn, lonn] = pixelstolatlon(ulx + dxn, uly - dyn - bottom/2, zoom);
|
---|
| 27 | position = [num2str(latn) ',' num2str(lonn)];
|
---|
| 28 | disp(['Google Earth tile: ' num2str(x) '/' num2str(cols-1) ' ' num2str(y) '/' num2str(rows-1) ' (center: ' position ')']);
|
---|
| 29 | @@ -98,17 +98,19 @@
|
---|
| 30 | params = [...
|
---|
| 31 | 'center=' position ...
|
---|
| 32 | '&zoom=' num2str(zoom)...
|
---|
| 33 | - '&size=' num2str(largura) 'x' num2str(alturaplus)...
|
---|
| 34 | + '&size=' num2str(width) 'x' num2str(heightplus)...
|
---|
| 35 | '&maptype=satellite'...
|
---|
| 36 | '&sensor=false'...
|
---|
| 37 | '&scale=' num2str(scale)];
|
---|
| 38 | url = ['http://maps.google.com/maps/api/staticmap?' params];
|
---|
| 39 | [X, map]=imread(url,'png');
|
---|
| 40 | X=ind2rgb(X,map);
|
---|
| 41 | - indx1 = floor(x*largura)+1;
|
---|
| 42 | - indx2 = min(floor(dx),floor(x*largura)+size(X,2));
|
---|
| 43 | - indy1 = floor(y*altura)+1;
|
---|
| 44 | - indy2 = min(floor(dy),floor(y*altura)+size(X,1));
|
---|
| 45 | + indx1 = floor(x*width)+1;
|
---|
| 46 | + indx2 = min(floor(dx),floor(x*width)+size(X,2));
|
---|
| 47 | + indy1 = floor(y*height)+1;
|
---|
| 48 | + [floor(dy),floor(y*height)+size(X,1)]
|
---|
| 49 | + [height heightplus]
|
---|
| 50 | + indy2 = min(floor(dy),floor(y*height)+size(X,1));
|
---|
| 51 | final(indy1:indy2,indx1:indx2,:)=X(1:indy2-indy1+1,1:indx2-indx1+1,:);
|
---|
| 52 | end
|
---|
| 53 | end
|
---|