source:
issm/trunk-jpl/src/m/coordsystems/epsg2proj.m@
25003
| Last change on this file since 25003 was 25003, checked in by , 6 years ago | |
|---|---|
| File size: 426 bytes | |
| Line | |
|---|---|
| 1 | function string = epsg2proj(epsg) |
| 2 | %use gdalsrsinfo to provide Proj.4 compatible string from EPSG code |
| 3 | % |
| 4 | % Usage: |
| 5 | % proj4string = epsg2proj(4326); |
| 6 | % |
| 7 | % Example: |
| 8 | % proj4string = epsg2proj(4326); |
| 9 | % return proj4string='+proj=longlat +datum=wgs84 +no_defs ' |
| 10 | % |
| 11 | |
| 12 | [s,r]=system(['gdalsrsinfo epsg:' num2str(epsg) ' | grep PROJ.4 | sed "s/PROJ.4 : //"']); |
| 13 | r=r(2:end-2); |
| 14 | |
| 15 | if s~=0, |
| 16 | error(r); |
| 17 | end |
| 18 | string=(r); |
Note:
See TracBrowser
for help on using the repository browser.
![(please configure the [header_logo] section in trac.ini)](/trac/issm/chrome/common/trac_banner.png)