aboutsummaryrefslogtreecommitdiff
path: root/man/man3
diff options
context:
space:
mode:
authorFrank Warmerdam <warmerdam@pobox.com>1999-03-18 16:34:52 +0000
committerFrank Warmerdam <warmerdam@pobox.com>1999-03-18 16:34:52 +0000
commit565a4bd035b9d4a83955808efef20f1d8dfa24cf (patch)
tree75785fc897708023f1ccdaf40079afcbaaf0fd3a /man/man3
downloadPROJ-565a4bd035b9d4a83955808efef20f1d8dfa24cf.tar.gz
PROJ-565a4bd035b9d4a83955808efef20f1d8dfa24cf.zip
New
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@776 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'man/man3')
-rw-r--r--man/man3/pj_init.385
1 files changed, 85 insertions, 0 deletions
diff --git a/man/man3/pj_init.3 b/man/man3/pj_init.3
new file mode 100644
index 00000000..d6d8e952
--- /dev/null
+++ b/man/man3/pj_init.3
@@ -0,0 +1,85 @@
+.\" @(#)pj_init.3 - 4.1
+.nr LL 5.5i
+.TH PJ_INIT 3U "92/11/08 Rel. 4, Ver. BETA" "GIE"
+.ad b
+.hy 1
+.SH NAME
+pj_init \- initialize cartographic projection
+.br
+pj_fwd \- forward cartographic projection
+.br
+pj_inv \- inverse cartographic projection
+.br
+pj_free \- de-initialize projection
+.SH SYNOPSIS
+.nf
+#include <projects.h>
+
+PJ *pj_init(int argc, char **argv)
+
+UV pj_fwd(UV val, PJ *proj)
+
+UV pj_inv(UV val, PJ *proj)
+
+void pj_free(PJ *proj)
+
+.SH DESCRIPTION
+Procedure \fBpj_init\fR selects and initializes a cartographic projection
+with 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 keyword
+assignments (\f(CW+\fR \fBproj\fR arguments).
+The list must contain at least the \fBproj=\fIprojection\fR and
+Earth's radius or elliptical parameters.
+If the initialization of the projection is successful a valid
+address is returned otherwise a NULL value.
+
+Once initialization is performed either forward or inverse
+projections can be performed with the returned value of \fBpj_init\fR
+used as the argument \fBproj\fR.
+The argument structure \fBUV\fR values \fBu\fR and \fBv\fR contain
+respective longitude and latitude or x and y.
+Latitude and longitude are in radians.
+If a projection operation fails, both elements of \fBUV\fR are
+set to HUGE_VAL (defined in \fImath.h\fR).
+
+\fBNote:\fR all projections have a forward mode, but some do not have
+an inverse projection.
+If the projection does not have an inverse the PJ structure element
+\fIinv\fR will be NULL.
+
+Memory associated with the projection may be freed with \fBpj_free\fR.
+.SH EXAMPLE
+The following program reads latitude and longitude values in decimal
+degress, performs Mercator projection with a Clarke 1866 ellipsoid and
+a 33\(de latitude of true scale and prints the projected
+cartesian values in meters:
+.nf
+\f(CW
+#include <projects.h>
+main(int argc, char **argv) {
+ char *args[] = { "proj=merc", "ellps=clrk66", "lat_ts=33" };
+ UV p;
+ PJ *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 LIBRARY
+libpj.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 AUTHOR/MAINTENANCE
+Gerald I. Evenden, USGS, Woods Hole, MA 02543