[Proj] Using jniwrap

Michael Speth spethm at landcareresearch.co.nz
Wed Nov 23 13:42:34 PST 2011


I get the following error:

[output]
Exception in thread "main" java.lang.IllegalArgumentException: +a=1 +lon_0=0
     at org.proj4.PJ.<init>(Unknown Source)
     at 
org.landcare.scenzgrid.proj4.test.HEALPixTest.main(HEALPixTest.java:32)
[/output]

[code]
     double phi0 = Math.asin(2.0/3.0);
     PJ sourcePJ = new PJ("+a=1 +lon_0=0");           // (x,y) axis order
     PJ targetPJ = new PJ("+proj=healpix"); // (?,?) axis order
     double[] coordinates = {
         0, 0,   // First coordinate
         0, phi0,   // Second coordinate
         0, -1*phi0    // Third coordinate
     };
     sourcePJ.transform(targetPJ, 2, coordinates, 0, 3);
     System.out.println(Arrays.toString(coordinates));
[/code]

Thanks



On 24/11/11 10:33, Martin Desruisseaux wrote:
> Le 23/11/11 22:13, Michael Speth a écrit :
>> 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?
>
> It should, I'm not sure to understand which issue you are facing... 
> The code posted in your previous email should work. Do you get an 
> exception or unexpected result?
>
>     Martin
>


-- 
Michael Speth
Research Systems Developer
Landcare Research

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


More information about the Proj mailing list