The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

PDL::Transform::Proj4 - PDL::Transform interface to the Proj4 projection library

SYNOPSIS

 # Using the generalized proj interface:
 # Make an orthographic map of Earth
 use PDL::Transform::Cartography;
 use PDL::Transform::Proj4;
 $a = earth_coast();
 $a = graticule(10,2)->glue(1,$a);
 $t = t_proj( proj_params => "+proj=ortho +ellps=WGS84 +lon_0=-90 +lat_0=40" );
 $w = pgwin(xs);
 $w->lines($t->apply($a)->clean_lines());
 
 # Using the aliased functions:
 # Make an orthographic map of Earth
 use PDL::Transform::Cartography;
 use PDL::Transform::Proj4;
 $a = earth_coast();
 $a = graticule(10,2)->glue(1,$a);
 $t = t_proj_ortho( ellps => 'WGS84', lon_0 => -90, lat_0 => 40 )
 $w = pgwin(xs);
 $w->lines($t->apply($a)->clean_lines());

DESCRIPTION

Works like PDL::Transform::Cartography, but using the proj library in the background.

Please see the proj library docs at http://www.remotesensing.org/proj for more information on proj, and how to use the library.

GENERALIZED INTERFACE

The main object here is the PDL::Transform::Proj4 object, aliased to the t_proj() function.

This object accepts all of the standard options described below, but mainly is there to be called with just the proj_params option defined.

When options are used, they must be used with a '+' before them when placed in the proj_params string, but that is not required otherwise. See the SYNOPSIS above.

ALIASED INTERFACE

Other than t_proj(), all of the other transforms below have been autogenerated, and may not work properly. The main problem is determining the parameters a projection requires from the proj library itself.

Due to the difficulties in doing this, there may be times when the proj docs specify a parameter for a projection that won't work using the anon-hash type specification. In that case, just throw that parameter in the proj_params string, and everything should work fine.

PARAMETERS AVAILABLE IN ALL PROJECTIONS

General Parameters

proj_params

This is a string containing the proj "plus style" parameters. This would be similar to what you would put on the command line for the 'proj' tool. Like "+proj=ortho +ellps=WGS84 +lon_0=-90 +lat_0=40".

This parameter overrides the others below when it contains parameters that are also specified explicitly.

proj

The proj projection code to use (like ortho...)

x_0

Cartesian X offset for the output of the transformation

y_0

Cartesian Y offset for the output of the transformation

lat_0

Central latitude for the projection. NOTE: This may mean other things depending on the projection selected, read the proj docs!

lon_0

Central longitude for the projection. NOTE: This may mean other things depending on the projection selected, read the proj docs!

units

Cartesian units used for the output of the projection. NOTE: Like most of the options here, this is likely useless in the current implementation of this library.

init

Specify a file:unit for proj to use for its runtime defaults. See the proj docs.

no_defs

Don't load any defaults. See the proj docs.

over

Normally, the transformation limits the output to between -180 and 180 degrees (or the cartesian equivalent), but with this option that behavior is turned off.

geoc

Input values are geocentric coordinates.

Earth Figure Parameters

ellps

Ellipsoid datum to use. Ex: WGS72, WGS74. See the proj docs and command line tool for list of possibilities ('proj -le').

R

Radius of the Earth.

R_A

Radius of a sphere with equivalent surface area of specified ellipse.

R_V

Radius of a sphere with equivalent volume of specified ellipse.

R_a

Arithmetic mean of the major and minor axis, Ra = (a + b)/2.

R_g

Geometric mean of the major and minor axis, Rg = (ab)1/2.

R_h

Harmonic mean of the major and minor axis, Rh = 2ab/(a + b).

R_lat_a=phi

Arithmetic mean of the principle radii at latitude phi.

R_lat_g=phi

Geometric mean of the principle radii at latitude phi.

b

Semiminor axis or polar radius

f

Flattening

rf

Reciprocal flattening, +rf=1/f

e

Eccentricity +e=e

es

Eccentricity squared +es=e2

FUNCTIONS

t_proj

This is the main entry point for the generalized interface. See above on its usage.