other versions
- wheezy 4.7.0-2
- jessie 4.8.0-5
- testing 4.9.3-1
- unstable 4.9.3-1
- experimental 4.9.3-2~exp1
other sections
PJ_INIT(3) | Library Functions Manual | PJ_INIT(3) |
NAME¶
pj_init - initialize cartographic projectionSYNOPSIS¶
#include <proj_api.h> projPJ pj_init(int argc, char **argv) projPJ pj_init_plus(const char *defn) projUV pj_fwd(projUV val, projPJ proj) projUV pj_inv(projUV val, projPJ proj) int pj_transform(projPJ src_cs, projPJ dst_cs, long point_count, int point_offset, double *x, double *y, double *z) void pj_free(projPJ proj)
DESCRIPTION¶
Procedure pj_init selects and initializes a cartographic projection with its argument control parameters. Argc is the number of elements in the array of control strings argv that each contain individual cartographic control keyword assignments (+ proj arguments). The list must contain at least the proj=projection and Earth's radius or elliptical parameters. If the initialization of the projection is successful a valid address is returned otherwise a NULL value.EXAMPLE¶
The following program reads latitude and longitude values in decimal degrees, performs Mercator projection with a Clarke 1866 ellipsoid and a 33° latitude of true scale and prints the projected cartesian values in meters:#include <proj_api.h> main(int argc, char **argv) { char *args[] = { "proj=merc", "ellps=clrk66", "lat_ts=33" }; projUV p; projPJ pj; if (!(pj = pj_init(3, args))) exit(1); while (scanf("%lf %lf", &p.v, &p.u) == 2) { p.u *= DEG_TO_RAD; p.v *= DEG_TO_RAD; p = pj_fwd(p, pj); printf("%.2f\t%.2f\n", p.u, p.v); } exit(0); }
LIBRARY¶
libproj.a - library of projections and support proceduresSEE ALSO¶
http://proj.osgeo.org/ProjAPI, proj(1U),HOME PAGE¶
http://proj.osgeo.org2001/04/05 Rel. 4.4 |