[Mapserver-users] java connector

Steve Lime steve.lime@dnr.state.mn.us
Tue, 20 May 2003 23:04:48 -0500


Hi Folks: This is an important topic and one that should get lot's of
attention post user group meeting. It's at the top of my to-do list if
some funding could be found. Ideally MapScript SWIG/JNI/Java will
provide the main means of interaction. I've also kicked around the idea
of a GeoTools/MapServer integration using MapScript. It will be awhile
until this can be used in a production environment.

That said, there are work arounds. I've built a simple java wrapper
(implemented as a bean) for the standard CGI application. Basically you
build up queries to the CGI, post them via streams and get at the
results using MapServer templates. In our case the template ammounts to
a text file consisting of name=value pairs. This file is yanked into a
Java hash and returned as output from the bean. The calling application
can do with the results what it wishes.

Low-tech, but it works nicely.

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> Pedro Salazar <pedro-b-salazar@ptinovacao.pt> 05/20/03 11:12 AM >>>
Hi,

> Our current solution is a simple process.Exec wrapper around mapserv. 
> 

I put my perl scripts inside the "cgi-bin" Apache HTTP server directory
and I invoke them through a HTTP connection. It may be not so fast as
invoke them directly but it's more flexible that way - and HTTP is a
very light protocol.

> We also did some tweaking to mapserv.c to make calling it from Java a
> bit easier so you could say we cheated a bit. We also removed a lot
the
> map file parsing code as it was not very thread safe.
> 

I'm not clear about the gain of performance but for now I prefer to not
touch the original mapserv.c.

> What value does the perl script you are calling give you over calling
> Mapserv directly?
> 

I don't know if I understood well what you asked, but my perl scripts
work also with query string parameters as the mapserv do, and they can
give me an extent text to be parsed or just images...

> We looked at JNI and saw that it would be very easily achievable for
the
> general case but did not warrant the effort for our specific use.  
> 
> A nice JNI interface would be sweet to develop if there were enough
> hands around.
> 

I think the same about using JNI, but right now I don't have time for
that adventure :-) It would be interesting indeed and a big improvement
for mapserver.

Pedro.
-- 
PS
pedro-b-salazar@ptinovacao.pt
PGP:0E129E31D803BC61

_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

_______________________________________________
Mapserver-users mailing list
Mapserver-users@lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users