[Proj] proj JNI wrapping

Andrea Antonello moovida at katamail.com
Wed Oct 13 11:02:24 EDT 2004

Hy Martin, thanks for your reply.

> I've done this with proj and gdal.  JNI works really well.  

The first question, which I guess you expect, is: is the work you have already 
done available? How come it is not officially known?

> The only 
> concern you will have is thread safety, but that is easily solved on the
> java side by synchronizing your jni wrappers.  

Why that? I would use it for certain queries, transformations and imports, 
which will way for the data to come back. Could you please explain me?

> 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

Yeah, that is a good idea, I'm in a study phase, do you have any concrete 

> 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.

Yeah, I know, I've done some JNI, and got only lots of troubles... even if it 
workes well...

Let me know,

> 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

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

More information about the Proj mailing list