Rev | Line | |
---|
[24777] | 1 | function string = epsg2proj(epsg)
|
---|
[25455] | 2 | %EPSG2PROJ - uses gdalsrsinfo to provide PROJ.4 compatible string from
|
---|
[25035] | 3 | %EPSG code
|
---|
[24777] | 4 | %
|
---|
| 5 | % Usage:
|
---|
| 6 | % proj4string = epsg2proj(4326);
|
---|
| 7 | %
|
---|
[25035] | 8 | % Example:
|
---|
| 9 | % proj4string = epsg2proj(4326);
|
---|
| 10 | % return proj4string='+proj=longlat +datum=wgs84 +no_defs'
|
---|
[24777] | 11 | %
|
---|
| 12 |
|
---|
[27529] | 13 | %Call PROJ library
|
---|
| 14 | [status, string]=system(['projinfo -o PROJ -q epsg:' num2str(epsg)]);
|
---|
[24777] | 15 |
|
---|
[27529] | 16 | %Check status
|
---|
| 17 | if status~=0; error(string); end
|
---|
[25050] | 18 |
|
---|
[27529] | 19 | %remove trailing blanks
|
---|
| 20 | string = deblank(string);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.