|
Last change
on this file since 24777 was 24777, checked in by Eric.Larour, 6 years ago |
|
NEW/CHG: new lambert equal area routine to provide PROJ.4 string.
gdal now also compatible with PROJ.4 (fixed a tiny bug).
New routine to transform EPSGS code into corresponding PROJ.4 string.
|
|
File size:
397 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']);
|
|---|
| 13 |
|
|---|
| 14 | if s~=0,
|
|---|
| 15 | error(r);
|
|---|
| 16 | end
|
|---|
| 17 | string=r(11:end-2);
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.