[Proj] proj JNI wrapping

Chapman, Martin MChapman at sanz.com
Wed Oct 13 10:36:14 EDT 2004


I've done this with proj and gdal.  JNI works really well.  The only
concern you will have is thread safety, but that is easily solved on the
java side by synchronizing your jni wrappers.  I wouldn't try to do a
one for one mapping of functions and classes between java and gdal/proj.
Instead I would build a couple of jni classes that call a c++ class that
does a specific operation with gdal/proj.  If you try to use the
gdal/proj c/c++ functions/objects directly in your java code it will get
ugly because all of the state management that needs to occur.  In other
words, use the JNI bridge sparingly.

Martin

-----Original Message-----
From: Andrea Antonello [mailto:moovida at katamail.com] 
Sent: Tuesday, October 12, 2004 11:12 PM
To: Proj Mailinglist
Subject: [Proj] proj JNI wrapping


Dear all,
the need of proj and gdal inside the JGrass project (which is basically
a java 
written portable interface for GRASS with some standalone capabilities)
makes 
me think of the possibility to use the JNI java/C bindings to create a
set of 
java functions to use the proj library.

Proj and Gdal would that way be awailable to a lot of java based
projects.

Any comment?

Did anybody already try? Or even finish? :)

Is anybody willing to cooperate?

To test if all this makes a sense I would start by doing this with Proj,
which 
is a smaller lib, and then decide what to do next.

Please let me know what you think,
Best regards
Andrea Antonello




-- 
________________________________________________________________________
____
HydroloGIS - Environmental Open Source Solutions www.hydrologis.com

Andrea Antonello
Environmental Engineer
mobile:  +393288497722

"Let it be as much a great honour to take as to give learning, if you
want to be called wise." Skuggsja' - The King's mirror - 1240 Reykjavik
________________________________________________________________________
____


_______________________________________________
Proj mailing list
Proj at xserve.flids.com http://xserve.flids.com/mailman/listinfo/proj



More information about the Proj mailing list