Changeset 25035
- Timestamp:
- 06/12/20 20:03:09 (5 years ago)
- Location:
- issm/trunk-jpl/src/m
- Files:
-
- 5 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/coordsystems/epsg2proj.m
r25034 r25035 1 1 function string = epsg2proj(epsg) 2 %use gdalsrsinfo to provide Proj.4 compatible string from EPSG code 2 %FUNCTION EPSG2PROJ - uses gdalsrsinfo to provide PROJ.4 compatible string from 3 %EPSG code 3 4 % 4 5 % Usage: 5 6 % proj4string = epsg2proj(4326); 6 7 % 7 % Example: 8 % proj4string = epsg2proj(4326); 9 % return proj4string='+proj=longlat +datum=wgs84 +no_defs 8 % Example: 9 % proj4string = epsg2proj(4326); 10 % return proj4string='+proj=longlat +datum=wgs84 +no_defs' 10 11 % 11 12 12 [s,r]=system(['gdalsrsinfo epsg:' num2str(epsg)' | grep PROJ.4 | sed "s/PROJ.4 : //"']);13 [s,r]=system(['gdalsrsinfo epsg:' num2str(epsg) ' | grep PROJ.4 | sed "s/PROJ.4 : //"']); 13 14 14 15 if s~=0, -
issm/trunk-jpl/src/m/coordsystems/gdaltransform.m
r24777 r25035 2 2 %GDALTRANSFORM - switch from one projection system to another 3 3 % 4 % 5 % 4 % Usage: 5 % [x,y] = gdaltransform(x1,y1,epsg_in, epsg_out); 6 6 % 7 % Example:8 % 7 % Example: 8 % [x,y] = gdaltransform(md.mesh.long,md.mesh.lat,'EPSG:4326','EPSG:3031') 9 9 % 10 % For reference:11 % 12 % 13 % 10 % For reference: 11 % EPSG: 4326 (lat,long) 12 % EPSG: 3411 (Greenland, UPS 45W, 70N) 13 % EPSG: 3031 (Antarctica, UPS 0E, 71S) 14 14 % 15 % 16 % 17 % 18 % 19 % 20 % 15 % ll2xy default projection Antarctica: 16 % +proj=stere +lat_0=-90 +lat_ts=-71 +lon_0=0 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.448564109 +units=m +no_defs 17 % ll2xy default projection Greenland: 18 % +proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.448564109 +units=m +no_defs 19 % Bamber's Greeland projection 20 % +proj=stere +lat_0=90 +lat_ts=71 +lon_0=-39 +k=1 +x_0=0 +y_0=0 +a=6378273 +b=6356889.448564109 +units=m +no_defs 21 21 % 22 % To get proj.4 string from EPSG, use gdalsrsinfo. Example: gdalsrsinfo "EPSG:4326" | grep "PROJ.4" 22 % To get proj.4 string from EPSG, use gdalsrsinfo. Example: 23 % 24 % gdalsrsinfo epsg:4326 | grep "PROJ.4" | sed "s/PROJ.4 : //" 23 25 24 26 %give ourselves unique file names
Note:
See TracChangeset
for help on using the changeset viewer.