Changeset 15155


Ignore:
Timestamp:
05/29/13 16:28:09 (12 years ago)
Author:
Mathieu Morlighem
Message:

CHG: also works for Antarctica now (rotation needed though...)

Location:
issm/trunk-jpl/src/m/plot
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/plot/googlemaps.m

    r15149 r15155  
    2626        xlim=getfieldvalue(options,'xlim',[min(md.mesh.x) max(md.mesh.x)]);
    2727        ylim=getfieldvalue(options,'ylim',[min(md.mesh.y) max(md.mesh.y)]);
    28         [latlist lonlist]= xy2ll(...
    29                 [linspace(xlim(1),xlim(2),100) linspace(xlim(2),xlim(2),100) linspace(xlim(2),xlim(1),100) linspace(xlim(1),xlim(1),100)],...
    30                 [linspace(ylim(1),ylim(1),100) linspace(ylim(1),ylim(2),100) linspace(ylim(2),ylim(2),100) linspace(ylim(2),ylim(1),100)],...
    31                 +1,45,70);
     28        if strcmpi(md.mesh.hemisphere,'n'),
     29                [latlist lonlist]= xy2ll(...
     30                        [linspace(xlim(1),xlim(2),100) linspace(xlim(2),xlim(2),100) linspace(xlim(2),xlim(1),100) linspace(xlim(1),xlim(1),100)],...
     31                        [linspace(ylim(1),ylim(1),100) linspace(ylim(1),ylim(2),100) linspace(ylim(2),ylim(2),100) linspace(ylim(2),ylim(1),100)],...
     32                        +1,45,70);
     33        elseif strcmpi(md.mesh.hemisphere,'s'),
     34                [latlist lonlist]= xy2ll(...
     35                        [linspace(xlim(1),xlim(2),100) linspace(xlim(2),xlim(2),100) linspace(xlim(2),xlim(1),100) linspace(xlim(1),xlim(1),100)],...
     36                        [linspace(ylim(1),ylim(1),100) linspace(ylim(1),ylim(2),100) linspace(ylim(2),ylim(2),100) linspace(ylim(2),ylim(1),100)],...
     37                        -1,0,71);
     38        else
     39                error('field hemisphere should either be ''n'' or ''s''');
     40        end
    3241
    3342        %Image corners in lat/long
     
    7685                position = [num2str(latn) ',' num2str(lonn)];
    7786                disp(['Google Earth tile: ' num2str(x) '/' num2str(cols-1) ' ' num2str(y) '/' num2str(rows-1) ' (center: ' position ')']);
     87                %Google maps API
     88                %http://developers.google.com/maps/documentation/staticmaps/
    7889                params = [...
    7990                        'center=' position ...
     
    97108[gX gY]=meshgrid(ulx:ulx+size(final,2)-1,uly:-1:uly-size(final,1)+1);
    98109[LAT LON]=pixelstolatlon(gX,gY, zoom);
    99 [X Y]=ll2xy(LAT,LON,+1,45,70);
     110if strcmpi(md.mesh.hemisphere,'n'),
     111        [X Y]=ll2xy(LAT,LON,+1,45,70);
     112elseif strcmpi(md.mesh.hemisphere,'s'),
     113        [X Y]=ll2xy(LAT,LON,-1,0,71);
     114else
     115        error('field hemisphere should either be ''n'' or ''s''');
     116end
    100117
    101118md.radaroverlay.pwr=final;
  • issm/trunk-jpl/src/m/plot/plot_googlemaps.m

    r15149 r15155  
    2525        xlim=getfieldvalue(options,'xlim',[min(x) max(x)]);
    2626        ylim=getfieldvalue(options,'ylim',[min(y) max(y)]);
    27         [latlist lonlist]= xy2ll(...
    28                 [linspace(xlim(1),xlim(2),100) linspace(xlim(2),xlim(2),100) linspace(xlim(2),xlim(1),100) linspace(xlim(1),xlim(1),100)],...
    29                 [linspace(ylim(1),ylim(1),100) linspace(ylim(1),ylim(2),100) linspace(ylim(2),ylim(2),100) linspace(ylim(2),ylim(1),100)],...
    30                 +1,45,70);
     27        if strcmpi(md.mesh.hemisphere,'n'),
     28                [latlist lonlist]= xy2ll(...
     29                        [linspace(xlim(1),xlim(2),100) linspace(xlim(2),xlim(2),100) linspace(xlim(2),xlim(1),100) linspace(xlim(1),xlim(1),100)],...
     30                        [linspace(ylim(1),ylim(1),100) linspace(ylim(1),ylim(2),100) linspace(ylim(2),ylim(2),100) linspace(ylim(2),ylim(1),100)],...
     31                        +1,45,70);
     32        elseif strcmpi(md.mesh.hemisphere,'s'),
     33                [latlist lonlist]= xy2ll(...
     34                        [linspace(xlim(1),xlim(2),100) linspace(xlim(2),xlim(2),100) linspace(xlim(2),xlim(1),100) linspace(xlim(1),xlim(1),100)],...
     35                        [linspace(ylim(1),ylim(1),100) linspace(ylim(1),ylim(2),100) linspace(ylim(2),ylim(2),100) linspace(ylim(2),ylim(1),100)],...
     36                        -1,0,71);
     37        else
     38                error('field hemisphere should either be ''n'' or ''s''');
     39        end
    3140
    3241        %Image corners in lat/long
Note: See TracChangeset for help on using the changeset viewer.