|
Last change
on this file since 24957 was 24957, checked in by jdquinn, 5 years ago |
|
BUG: Let system call parse string.
|
|
File size:
411 bytes
|
| 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 : //"']);
|
|---|
| [24777] | 13 |
|
|---|
| 14 | if s~=0,
|
|---|
| 15 | error(r);
|
|---|
| 16 | end
|
|---|
| [24957] | 17 | string=(r);
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.