[Mapserver-users] Config for Antialiased Lines

Paul Dugas Paul at DugasEnterprises.com
Wed Dec 10 12:10:27 PST 2003


Hi all,

I'm using a nightly shapshot from back on Nov-18 and gd-2.0.15 on a
RedHat-9 machine.  I'm using 'shp2img' to generate PNG24 images that are
used by other marts of my system (no webserver, CGIs, or MapScript).  I'm
trying to figure out how to get my map-file setup to render using GD's
ability to draw antialiased lines and am quite stumped.  I ended up
hacking 'mapgd.c' to force it to always pass gdAntiAliased to the
imagePolyline() routine but I'd really like to figure out why my configs
arent' doing the trick.  The relevant (I think) parts of the config are:

  MAP
    ...
    SYMBOL
      NAME 'smooth'
      TYPE ELLIPSE
      POINTS 1 1 END
      FILLED TRUE
      ANTIALIAS TRUE
    END
    ...
    LAYER
      NAME Interstates
      TYPE LINE
      ...
      CLASS
        COLOR 34 86 136
        STYLE
          SYMBOL "smooth"
          ANTIALIAS TRUE
        END
      END
    END
    ...
  END

I can't seem to get the antialiasing turned on.  I've tried to follow the
'mapfile.c' and 'mapsymbol.c' files to understand how the parser works but
I quickly got lost.  I could figure it out, I'm sure, if I spent a bit
more time on it but reverse-engineering the proper config file from the
source code seems strange.  Is there updated documentation somewhere that
might help?

While we're on the topic of the config file, has anyone considered moving
to a XML file instead?  I've dome this with many of my systems as libxml
now ships with my target platforms (Solaris and RedHat).  The parser
library is simple to use and the resulting in-memory tree is simple to
iterate through.  I believe a DTD/schema validator is also included in the
library so you could rely on it to parse and validate the config allowing
your code to assume the resulting structure is okay.  Just a thought.

Last thought, I'm using 'shp2img' in the build scripts fo my program.  The
map-file I pass it has the size of the resulting image in it but I can't
override it on the command line as I can do with the extents.  Would it be
possible to do one of two things:

  - add argument to 'shp2img' to specify the desired image size
  - have 'shp2img' read its map-file from STDIN

Without either of these, I generate a temporary map-file from a template 
replacing the "SIZE" values.  Kind of messy to someone as retentive as I
am.

Thanks in advance,

Paul

--
Paul A. Dugas <paul at dugasenterprises.com>              phone: 404.932.1355
Dugas Enterprises, LLC                                   fax: 770.516.4841
1711 Indian Ridge Drive, Woodstock, GA 30189 USA
--
On-site at Georgia DOT, TMCx1015, 404.635.8013, paul.dugas at dot.state.ga.us



More information about the MapServer-users mailing list