Project

General

Profile

how to add support for other projections using proj.4

Added by Etienne Tourigny about 11 years ago

Hi,

I would like to know what work would be necessary to add a new projection type (e.g. spherical mercator) to remap from lat/lon, using the proj.4 library.

Currently, proj.4 is used to map from sinusoidal/lambert TO lat/lon. What is needed to do the reverse?

Regards,
Etienne


Replies (3)

RE: how to add support for other projections using proj.4 - Added by Joerg Trentmann almost 11 years ago

Dear Etienne,

I am also looking for a convenient way to remap data from a regular lon/lat grid to a new projection (Lambert Azimuthal Equal Area in my case), which is supported by the proj4-library. Did you find a way using cdo to do such a transformation?

Thanks, regards,
Jörg

RE: how to add support for other projections using proj.4 - Added by Etienne Tourigny almost 11 years ago

I haven't made any progress. My suggestion would be to use a tool like gdal to do the transformation.

i.e. gdalwarp -s_srs EPSG:4326 -t_srs '<proj_definition>' in.nc out.nc

it might work better if the file is first converted to gtiff and the result back to netcdf (or whatever else the file format is) using gdal_translate.

RE: how to add support for other projections using proj.4 - Added by Jaison-Thomas Ambadan almost 11 years ago

Hi Jörg,

You could also use GMT tools such as "grdproject" http://gmt.soest.hawaii.edu/gmt/html/man/grdproject.html or "mapproject" http://gmt.soest.hawaii.edu/gmt/html/man/mapproject.html

"grdproject" can handle NetCDF files; here is an example to project a lon-lat grid to Lambert Azimuthal Equal-Area:

cdo -f nc -topo ifile.nc
grdproject ifile.nc -Rg -Ja0/0/180/1:1 -Gofile.nc

Cheers,
J

    (1-3/3)