transform               package:proj4               R Documentation

_T_r_a_n_s_f_o_r_m _g_e_o_g_r_a_p_h_i_c _c_o_o_r_d_i_n_a_t_e_s _f_r_o_m _o_n_e _p_r_o_j_e_c_t_i_o_n _i_n_t_o _a_n_o_t_h_e_r

_D_e_s_c_r_i_p_t_i_o_n:

     Transformation of geographics coordinates from one projection to
     another, using PROJ.4 library.

_U_s_a_g_e:

     ptransform(data, src.proj, dst.proj, silent=TRUE)

_A_r_g_u_m_e_n_t_s:

    data: input (list, matrix or 2d-array) - see details below. 

src.proj: description of the source projection

dst.proj: description of the destination projection

  silent: if set to 'TRUE', warnings will be suppressed 

_D_e_t_a_i_l_s:

     The data can be a list of vectors (if the list contains more than
     three entries, only first three entries are used and a warning is
     issued), a two-dimensional matrix or array (the number of columns
     or rows must be at most three). If the input is a list then the
     result will be a list with the entries named 'x', 'y' and 'z',
     otherwise the result is a matrix with three columns.

     When the list form is used, inputs are recycled with a warning
     when necessary. All unspecified coordinates are set to zero.

     Note that the project specification _must_ include an ellipsoid or
     a datum. Add 'ellps='sphere'' to obtain the same result as older
     PROJ.4 versions with no datum specification.

     Datum files must be installed in order to be able to perform datum
     shifts (on Windows they should be located in 'c:\proj') - see
     PROJ.4 website for the download of datum files.

     A list of some commonly used projections can be found at <URL:
     http://www.remotesensing.org/geotiff/proj_list/>,

_V_a_l_u_e:

     A matrix with three columns or list with projected coordinates. If
     the input was a list then the output will be a list, otherwise a
     matrix.

_A_u_t_h_o_r(_s):

     Simon Urbanek

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://www.remotesensing.org/proj/>

_E_x_a_m_p_l_e_s:

     data(state)
     sc <- cbind(state.center$x, state.center$y)
     ## this is essentially the same as project except
     ## that the default lat/long input is in radians
     tr <- ptransform(sc/180*pi, '+proj=latlong +ellps=sphere',
                      '+proj=merc +ellps=sphere')
     ## we can compare it with the project result
     res <- project(sc, c(proj="merc"))
     ## ptransform has z coordinate which is 0 for this projection
     summary(tr - cbind(res, 0))

