Function file: [X,Y] = _op_fwd(lon,lat,params)

This function projects geodetic coordinates into cartesian projected coordinates in the defined cartographic projection using the PROJ function proj_trans_generic().

INPUT ARGUMENTS:

  • lon is a column vector containing by default the geodetic longitude.
  • lat is a column vector containing by default the geodetic latitude.
  • params is a text string containing the projection parameters in PROJ format (ONLY format ’+’ style is allowed, in any other case results are not guaranteed).

OUTPUT ARGUMENTS:

  • X is a column vector containing by default the X projected coordinates.
  • Y is a column vector containing by default the Y projected coordinates.

The coordinate vectors lon and lat must be both scalars or both column vectors (of the same size). X and Y will be according to the input dimensions. Angular units are by default radians and linear meters, although other can be specified in params, so lon and lat must be congruent with params. The same applies to the coordinate order at input and output.

If a projection error occurs the resultant coordinates for the affected points have both Inf value and a warning message is emitted (one for each erroneous point).

See also: _op_inv, _op_transform.

Package: octproj