📄 pj_init.3
字号:
.\" @(#)pj_init.3 - 4.1.nr LL 5.5i.TH PJ_INIT 3U "2001/04/05 Rel. 4.4" .ad b.hy 1.SH NAMEpj_init \- initialize cartographic projection.brpj_init_plus \- initialize cartographic projection.brpj_fwd \- forward cartographic projection.brpj_inv \- inverse cartographic projection.brpj_transform \- transform between coordinate systems.brpj_free \- de-initialize projection.SH SYNOPSIS.nf#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, double *x, double *y, double *z) void pj_free(projPJ proj).SH DESCRIPTIONProcedure \fBpj_init\fR selects and initializes a cartographic projectionwith its argument control parameters.\fBArgc\fR is the number of elements in the array of control strings\fBargv\fR that each contain individual cartographic control keywordassignments (\f(CW+\fR \fBproj\fR arguments).The list must contain at least the \fBproj=\fIprojection\fR andEarth's radius or elliptical parameters.If the initialization of the projection is successful a validaddress is returned otherwise a NULL value.The \fBpj_init_plus\fR function operates similarly to \fBpj_init\fR buttakes a single string containing the definition, with each parameterprefixed with a plus sign. For example "+proj=utm +zone=11 +ellps=WGS84".Once initialization is performed either forward or inverseprojections can be performed with the returned value of \fBpj_init\fRused as the argument \fBproj\fR.The argument structure \fBprojUV\fR values \fBu\fR and \fBv\fR containrespective longitude and latitude or x and y.Latitude and longitude are in radians.If a projection operation fails, both elements of \fBprojUV\fR areset to HUGE_VAL (defined in \fImath.h\fR).\fBNote:\fR all projections have a forward mode, but some do not havean inverse projection.If the projection does not have an inverse the projPJ structure element\fIinv\fR will be NULL.The \fBpj_transform\fR function may be used to transform points betweenthe two provided coordinate systems. In addition to converting betweencartographic projection coordinates and geographic coordinates, this functionalso takes care of datum shifts if possible between the source and destinationcoordinate system. Unlike \fBpj_fwd\fR and \fBpj_inv\fR it is also allowablefor the coordinate system definitions (\fBPJ *\fR) to be geographic coordinatesystems (defined as +proj=latlong). The \fBx\fR, \fBy\fR and \fBz\fR arrayscontain the input values of the points, and are replaced with the outputvalues. The function returns zero on success, or the error number (also inpj_errno) on failure.Memory associated with the projection may be freed with \fBpj_free\fR..SH EXAMPLEThe following program reads latitude and longitude values in decimaldegress, performs Mercator projection with a Clarke 1866 ellipsoid anda 33\(de latitude of true scale and prints the projectedcartesian values in meters:.nf\f(CW#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\et%.2f\en", p.u, p.v); } exit(0);} \fR.br.fi.SH LIBRARYlibproj.a \- library of projections and support procedures.SH SEE ALSO.B proj(1U),.br.I "Cartographic Projection Procedures for the UNIX Environment\(emA User's Manual,"(Evenden, 1990, Open-file report 90\-284)..SH HOME PAGEhttp://www.remotesensing.org/proj
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -