Using MapServer as a C/C++ library
Bart van den Eijnden
BEN at SYNCERA-ITSOLUTIONS.NL
Thu Dec 29 06:38:12 PST 2005
Hi Brian,
the company I work for, Syncera, looked into using the Mapserver library from Delphi earlier this year and many of the same questions were raised.
There is dll called libmap.dll but it's interface is not (well) defined. It has been on the developer's wish list to make a more clear dll interface, but there never has been funding to do this.
Wrt Mapscript, it uses SWIG mainly and there is no C/C++ interface, so that won't be an option.
Hope this helps. This is more the type of question for the dev list, but many people of the dev list are also on the users list.
Best regards,
Bart
Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG DELFT
tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl
>>> Brian Peschel <brianp at OCCINC.COM> 12/29/2005 3:32:24 PM >>>
So I am curious about using MapServer inside an existing C++ program. A
previous query about this suggested I shell out to the OS and call shp2image
to create the image which I could then read in. Shelling to the OS is not
my prefered way of doing anything (there are limitations in the C system()
call I would prefer to avoid). So, I would rather use MapServer as a
library call.
Looking at the makefile generated by MapServer, I see that the CGI program
can be compiled as a library (the shp2img program uses a static library
version), so that should work for me.
Looking at the PHP/MapScript documentation
(http://mapserver.gis.umn.edu/docs/reference/phpmapscript-class) and the
code for shp2img, I see how the mapObj is created which creates an imageObj
which writes out to a file. I could (I suppose) write out to a file and use
GD to read the file back in to I can get access to the pixels for my
display. I would prefer to skip the write to file/read the file part for speed.
Is there another reference on the classes I am missing? The online docs
don't seem to give an indication of what the actual classes do, just methods
in the classes. Is there a better place to look for this? Is this more of
a question for the DEV list rather than the USER list?
I haven't actually installed MapScript itself. From the Readme in the
MapServer download, it says it is a module, and does not list C or C++ as a
language it supports.
Thanks in advance for any help...
- Brian
More information about the MapServer-users
mailing list