Rev | Line | |
---|
[24777] | 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 |
|
---|
[24956] | 12 | [s,r]=system(['gdalsrsinfo epsg:' num2str(epsg) ' | grep PROJ.4 | sed "s/PROJ.4 : //"']);
|
---|
[25003] | 13 | r=r(2:end-2);
|
---|
[24777] | 14 |
|
---|
| 15 | if s~=0,
|
---|
| 16 | error(r);
|
---|
| 17 | end
|
---|
[24957] | 18 | string=(r);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.