[MAPSERVER-USERS] agg and line widths

thomas bonfort thomas.bonfort at gmail.com
Wed Apr 2 23:45:36 PDT 2008


tanya,
different symptoms but same "problem" here. even if your mapserver
layer is of type "LINE", your counties data is polygonal data and
therefore has duplicate edges, and mapserver will happilly draw these
edges twice. depending on how the linestrings of the polygon are
stored, the pattern of your dashes, the scale of your drawing, and a
small dose of black magic, dashes will show up well or not ;)
note that this isn't agg specific, the gd renderer has the same
limitations when using dashes.

--
Thomas Bonfort

Camptocamp France SAS
Tel : +33 (0)4 79 26 57 97
thomas dot bonfort at camptocamp dot com
http://www.camptocamp.com

On undefined, TC Haddad <tchaddad at gmail.com> wrote:
> hi thomas
>
> my situation might be similar to Duarte: i'm also drawing counties, but in
> my case I am drawing a line layer, not a polygon layer.
>
> my preference was for drawing the lines with a dashed symbol, but at certain
> scales (usually more zoomed out) the dashed lines will occasionally fail -
> and would draw as solid. the pattern of failure seems really hard to predict
> .... see the red circled area in the attached image.
>
> this effect remained the same no matter how large the gap between my dashes
> were, or how short my dash lengths (in this example basically 1 pixel dots,
> and there is still a failure to solid line). any ideas on a work around? -
> perhaps if I generalized the layer ?
>
> tanya
>
>
>
>
> On Wed, Apr 2, 2008 at 2:03 PM, thomas bonfort <thomas.bonfort at gmail.com>
> wrote:
>
> > hi,
> > it's one of the drawbacks of antialiasing in general, not a mapserver
> > specific issue. an analogy could be found when drawing on paper with a
> > felt-tip pen: if you pass twice on the same line the resulting effect
> > is that the paper is twice as saturated in ink and the line appears
> > thicker. this doesn't happen when drawing aliased bresenham lines as
> > with the gd renderer, as multiple passes on a given line produces the
> > same result as a single pass.
> > hth,
> > thomas
> >
> >
> >
> >
> > On Wed, Apr 2, 2008 at 9:51 PM, DNC <dncarreira at gmail.com> wrote:
> > >
> > >  Thomas,
> > >
> > >  I'm drawing administrative boundaries like counties. The data came from
> a
> > >  polygon shapefile and converted to PostGIS. The boundaries are
> topologically
> > >  correct in that shared boundaries are completely coincident and not
> > >  adjacent. I have never seen these polygons being drawn like you
> describe. It
> > >  didn't even occurred to me that MapServer would have any difficulties
> > >  drawing this kind of data... How do you publish for instance the US
> states?
> > >
> > >  Thanks,
> > >  Duarte
> > >
> > >
> > >
> > >
> > >  tbonfort wrote:
> > >  >
> > >  > hi,
> > >  > you're probably drawing polygons with adjacent borders right?
> > >  > in this case, each line except the outer ones is drawn twice, and
> thus
> > >  > its final width is larger than what is requested.
> > >  > I don't think there's much you can do about it except preprocess your
> > >  > data to transform it into a line layer with no duplicates.
> > >  >
> > >  > cheers,
> > >  > --
> > >  > Thomas Bonfort
> > >  >
> > >  > Camptocamp France SAS
> > >  > Tel : +33 (0)4 79 26 57 97
> > >  > thomas dot bonfort at camptocamp dot com
> > >  > http://www.camptocamp.com
> > >  >
> > >  > On Sat, Mar 29, 2008 at 1:22 PM, DNC <dncarreira at gmail.com> wrote:
> > >  >>
> > >  >>  Hi.
> > >  >>
> > >  >>  I'm having trouble getting thin lines to draw. The thinnest line I
> get
> > >  >> seems
> > >  >>  to be 2 pixels wide at least. Using GD the lines are indeed 1
> pixel.
> > >  >> Anyone
> > >  >>  can point out why this happens?
> > >  >>
> > >  >>  Some sections from the map file:
> > >  >>  OUTPUTFORMAT
> > >  >>   NAME 'AGG_Q'
> > >  >>   DRIVER AGG/PNG
> > >  >>   MIMETYPE "image/png"
> > >  >>   IMAGEMODE RGB
> > >  >>   FORMATOPTION "QUANTIZE_FORCE=ON"
> > >  >>   FORMATOPTION "QUANTIZE_DITHER=OFF"
> > >  >>   FORMATOPTION "QUANTIZE_COLORS=256"
> > >  >>  END
> > >  >>   LAYER
> > >  >>     NAME 'test'
> > >  >>     GROUP "test group"
> > >  >>     TYPE POLYGON
> > >  >>     #MINSCALE 250000
> > >  >>     CONNECTIONTYPE postgis
> > >  >>     CONNECTION 'bla'
> > >  >>     PROCESSING "CLOSE_CONNECTION=DEFER"
> > >  >>     DATA 'the_geom from table using unique gid'
> > >  >>     #FILTER ''
> > >  >>     METADATA
> > >  >>       'wms_title'           'some layer'
> > >  >>       "ows_abstract"    "some text"
> > >  >>       'wms_srs'             'EPSG:27492'
> > >  >>       "wms_opaque"    "0"
> > >  >>       "wms_group_title" "group title"
> > >  >>       "wms_group_abstract" "group text"
> > >  >>     END
> > >  >>     STATUS ON
> > >  >>     TRANSPARENCY 100
> > >  >>     PROJECTION
> > >  >>     'init=epsg:27492'
> > >  >>     END
> > >  >>     EXTENT -23893.143277 -173568.018533 62541.864515 -70038.622014
> > >  >>     MINSCALE 1
> > >  >>  #    MAXSCALE 100000
> > >  >>     # data is queryable
> > >  >>     DUMP TRUE
> > >  >>     HEADER   /ms_ogc_workshop/templates/rivers_query_header.html
> > >  >>     TEMPLATE /ms_ogc_workshop/templates/rivers_query_body.html
> > >  >>     # fuzziness for querying
> > >  >>     TOLERANCE 5
> > >  >>     CLASS
> > >  >>        NAME 'outlines'
> > >  >>        STYLE
> > >  >>          WIDTH 1
> > >  >>          OUTLINECOLOR 232 232 232
> > >  >>        END
> > >  >>     END
> > >  >>   END
> > >  >>
> > >  >>  Regards,
> > >  >>  Duarte
> > >  >>  --
> > >  >>  View this message in context:
> > >  >> http://www.nabble.com/agg-and-line-widths-tp16369480p16369480.html
> > >  >>  Sent from the Mapserver - User mailing list archive at Nabble.com.
> > >  >>
> > >  >>  _______________________________________________
> > >  >>  mapserver-users mailing list
> > >  >>  mapserver-users at lists.osgeo.org
> > >  >>  http://lists.osgeo.org/mailman/listinfo/mapserver-users
> > >  >>
> > >  > _______________________________________________
> > >  > mapserver-users mailing list
> > >  > mapserver-users at lists.osgeo.org
> > >  > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> > >  >
> > >  >
> > >
> > >  --
> > >  View this message in context:
> http://www.nabble.com/agg-and-line-widths-tp16369480p16450017.html
> > >
> > >
> > > Sent from the Mapserver - User mailing list archive at Nabble.com.
> > >
> > >  _______________________________________________
> > >  mapserver-users mailing list
> > >  mapserver-users at lists.osgeo.org
> > >  http://lists.osgeo.org/mailman/listinfo/mapserver-users
> > >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
> >
>
>



More information about the MapServer-users mailing list