[Proj] Using jniwrap

Michael Speth spethm at landcareresearch.co.nz
Wed Nov 23 16:13:29 EST 2011


Thanks Martin,
   I didn't know the wrapper expected degrees.  The proj command that I 
am using I think is taking coordinates from a unit sphere and projecting 
with the HEALPix projection (I am currently working on this projection 
and will provide a patch to Frank).  It doesn't read data from a file.

So I would like to replicate this using the jniwrap for my own testing 
purposes.  Can this be done?

Thanks

On 24/11/11 09:59, Martin Desruisseaux wrote:
> 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
>


-- 
Michael Speth
Research Systems Developer
Landcare Research

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/proj/attachments/20111124/4b07cc9a/attachment.htm 


More information about the Proj mailing list