[mapserver-users] getting rid of GD and dependencies

Steve Lime steve.lime at dnr.state.mn.us
Wed Jul 17 14:01:50 EDT 2002


I agree with Jan about waiting until 3.7, but for different reasons.
Version 3.7 is aimed at isolating GD dependancies so that different
output drivers could be employed. For example, colors are now stored
interally as rgba instead of using color indicies. The GD driver then is
responsible for allocation of colors. 3.7 will support the traditional
GD output, GDAL output (e.g GeoTIFF) although that just converts from
8/24-bit GD image structures to whatever, Flash and PDF. There's no
reason another raster driver, one with it's own rendering capabilities
couldn't be added. There are some MapServer specific drawing routines,
but in reality those are simply extensions to GD wouldn't need to be
re-written IF the target driver had a similar option. For example, GD
does not support multi part shape rendering so I wrote versions that
did, and at the heart they use the GD API.

By not ripping out GD, but rather defining another output driver
there's a much better chance for integration with the main MapServer
core. I'd be happy to chat more about this topic.

Steve

Stephen Lime
Data & Applications Manager

Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937

>>> "Jan Hartmann" <jhart at frw.uva.nl> 07/17/02 07:44AM >>>
It is not very difficult to replace all GD routines with something
from
other graphic libraries; Mapserver only uses about 30 basic GD calls
and
they can very easily be translated into some other package, which can
be
linked into the MapServer executable. I tried this out with the Ming
library
to get Flash output. However, just replacing the base GD-calls will not
give
you better looking output. Lots of rasterizing is done within
MapServer
itself (e.g. filling polygons), so the more advanced functions of your
graphics package won't be used at al. To use those, you  have to
rewrite
MapServer vector functions on a much higher level, and this is really
much
more complex than just rewriting the base GD-calls. Moreover,
GD-bitmaps are
used exensively within MapServer as internal buffers, and this will
certainly cause problems when ported to other systems.

Probably a better way would be to wait for the extended vector output
facilities of MapServer 3.7. Perhaps you could do something with
formats
like Flash, GML or SVG.

Jan Hartmann
Department of Geography
University of Amsterdam
jhart at frw.uva.nl 


-----Original Message-----
From: owner-mapserver-users at lists.gis.umn.edu 
[mailto:owner-mapserver-users at lists.gis.umn.edu]On Behalf Of Alex Rice
Sent: Wednesday, July 17, 2002 10:33 AM
To: mapserver-users at lists.gis.umn.edu 
Subject: [mapserver-users] getting rid of GD and dependencies


I have this crazy idea to take the Mapserver code base and rip out all
the GD/libJPEG/libPNG/etc. code and rewrite the graphics routines to
use
Cocoa's AppKit rendering on Mac OS X. Cocoa is Apple's Objective-C
framework, formerly called OpenStep. The advantages of this that I can
see:

1) It would remove most or all of the difficult compile and dependency
problems that mapserver has on OS X. It might be necessary to wrap
mapserver in an Objective-C application, or a loadable bundle, but
that
won't present a problem.

2) I suspect it would look a whole lot better. Cocoa has a
Postscript-like imaging model and uses PDF, antialiasing and vector
graphics. No jaggies! Just nice smooth images. Appkit also has a lot
of
neat features for compositing images with both raster and vector
content. And Unicode support. It's just a really neat graphics
environment through and through.

3) Whatever work I did could theoretically, eventually be ported to
GNUStep, and thus run on any other Unix platform.
(http://www.gnustep.org). Although I hear that currently the GnuStep
Appkit stuff still needs a lot of refinement.

So mainly I just want to bounce this idea off you all...

-- Would anyone take offense if I did this to the mapserver source
code?

-- Is there anyone on the list who knows Objective-C and Appkit
programming?

-- Good idea? Crazy idea?

-- The license to mapserver looks very um, flexible. Are there any
commercial products based on it? I don't know if this project I am
describing would be open-source or not, I haven't talked with my
employer about legal shtuff yet. I would push it to be open-source
though.

Thanks in advance,

Alex Rice, Software Developer
Architectural Research Consultants, Inc.
alex_rice at arc.to 
alrice at swcp.com 





More information about the mapserver-users mailing list