Changeset 17004


Ignore:
Timestamp:
12/04/13 09:11:36 (11 years ago)
Author:
Mathieu Morlighem
Message:

CHG: moved print/export_geotiff.m

File:
1 moved

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/m/print/export_geotiff.m

    r17003 r17004  
    1 function export_geotif(filename,ref)
     1function export_geotiff(filename,ref)
    22%EXPORT_GEOTIF - export geotiff
    33%
     4%   Usage:
     5%      export_geotif(filename,ref);
    46%
    5 % Usage: export_geotif('Articles/figures/figure','EPSG:3411');
     7%      This function must be called after plotmodel
     8%      filname: no extension
     9%      ref:     UPS Greenland  EPSG:3413 (http://www.spatialreference.org/ref/epsg/3413/)
     10%               UPS Antarctica EPSG:3031 (http://www.spatialreference.org/ref/epsg/3031/)
    611%
     12%   Example:
     13%      export_geotif('Greenland','EPSG:3413');
    714
     15%Get axis limits and convert to strings
     16XLIM = xlim(); x0 = num2str(XLIM(1)); x1 = num2str(XLIM(2));
     17YLIM = ylim(); y0 = num2str(YLIM(1)); y1 = num2str(YLIM(2));
    818
    9         %first export the figure
    10         export_fig([filename '.jpg']);
     19%first export the figure
     20export_fig([filename '.jpg']);
    1121
    12         %call gdal on this:
    13         system(sprintf('gdal_translate -a_srs %s -of GTiff -co "INTERLEAVE=PIXEL" -a_ullr %g %g %g %g %s.jpg %s.tif', ref, min(xlim), max(ylim),max(xlim),min(ylim),filename,filename));
    14         system(['rm -rf ' filename '.jpg']);
    15 
    16 end
     22%call gdal on this:
     23system(['gdal_translate -a_srs ' ref ' -of GTiff -co "INTERLEAVE=PIXEL" -a_ullr ' x0 ' ' y1 ' ' x1 ' ' y0 ' ' filename '.jpg ' filename '.tif']);
     24system(['rm -rf ' filename '.jpg']);
Note: See TracChangeset for help on using the changeset viewer.