[Proj] Using jniwrap

Martin Desruisseaux martin.desruisseaux at geomatys.fr
Wed Nov 23 12:59:47 PST 2011


Hello Michael

Le 23/11/11 21:38, Michael Speth a écrit :
> I was able to use the jar without issue after compiling with make install (had 
> to do a make clean first).  My next question is how do I use the tool?
> The command that I have been using with the proj binary is:
> proj +proj=healpix -f '%.'17'f' +lon_0=0 +a=1 -E

I'm not quite familiar with the proj command-line. If the above was reading data 
from a file, in Java the developers need to read the file themselves. The PJ 
Java class just wraps the PJ C/C++ data structure, which (I think) is not the 
place where "proj" command-line performs file reading...

> I'm not sure what sourcePJ should be in the following example
>
>         PJ sourcePJ = new PJ("+a=1 +lon_0=0");

If the "+a=1 +lon_0=0" parameters were accepted by the "proj" command-line, I 
think they will be accepted by the PJ Java class since it just pass that 
parameter verbatim to the C library.

The only difference between the C library and the Java wrapper is that the Java 
wrappers expect angles in degrees, while the C library expects angles in 
radians. The Java wrappers perform the "radians to degrees" conversions 
themselves because we have more information on the C/C++ side about whatever 
such conversion is needed or not (it depends if the PJ are geographic or 
geocentric or projected CRS).

Javadoc is there: http://www.geoapi.org/geoapi-proj4/apidocs/org/proj4/PJ.html

     Martin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/proj/attachments/20111123/eec227bc/attachment.html>


More information about the Proj mailing list