[Proj] Using jniwrap

Martin Desruisseaux martin.desruisseaux at geomatys.fr
Tue Nov 22 21:13:32 EST 2011


Hello Michael

I just tried on my side and it worked well. Did you compiled with "make", and 
executed "make install" after a successful Proj.4 build? I believe (but I'm not 
sure, Frank could confirm) that "make install" is necessary in order to copy 
some necessary files like the EPSG list of definitions in proper locations. 
Maybe the exception that you get is caused by Proj.4 not finding the EPSG file?

     Martin


Le 23/11/11 02:57, Michael Speth a écrit :
> Anyone have experience with using the jniwrap java wrapper?
>
> I've compiled the jar and set the native library path; however, I get an error 
> when I try to run the example from the README.  Is there something that I 
> haven't configured correctly?
>
> [code]
>         PJ sourcePJ = new PJ("+init=epsg:32632");           // (x,y) axis order
>         PJ targetPJ = new PJ("+proj=latlong +datum=WGS84"); // (?,?) axis order
>         double[] coordinates = {
>             500000,       0,   // First coordinate
>             400000,  100000,   // Second coordinate
>             600000, -100000    // Third coordinate
>         };
>         sourcePJ.transform(targetPJ, 2, coordinates, 0, 3);
>         System.out.println(Arrays.toString(coordinates));
>
> [output]
> Exception in thread "main" java.lang.IllegalArgumentException: +init=epsg:32632
>     at org.proj4.PJ.<init>(Unknown Source)
>     at org.landcare.scenzgrid.proj4.test.HEALPixTest.main(HEALPixTest.java:36)
>
> Thanks

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/proj/attachments/20111123/9305a70f/attachment.htm 


More information about the Proj mailing list