[mapserver-users] Draw roads WITHOUT anti-aliasing
lars.schylberg at blixtmail.se
lars.schylberg at blixtmail.se
Wed Oct 18 05:05:00 PDT 2017
Hi,
I did some quick tests with :
OUTPUTFORMAT
NAME "png_G0"
DRIVER AGG/PNG
MIMETYPE "image/png"
IMAGEMODE RGB
EXTENSION "png"
FORMATOPTION "GAMMA=0.0"
END
and shp2img with options -i
eg: shp2img -m 01_polygon_td_poly.map -o 01_polygon_td_poly.png -i png_G0
I did some tests with both polygons, polygon outlines and lines and they all seems to have anti-aliasing as far as I could see.
Would this be an ok way to test it? I also have some people that would like to do lines without anti-aliasing for a strange reason.
Lars Schylberg
-----Originalmeddelande-----
> Från: "Rahkonen Jukka (MML)" <jukka.rahkonen at maanmittauslaitos.fi>
> Till: "Eichner, Andreas - SID" <Andreas.Eichner at sid.sachsen.de>, "Erik H" <erik.h11.01 at gmail.com>
> Kopia: mapserver-users at lists.osgeo.org
> Datum: 2017-10-18 11:13
> Ämne: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
>
> Hi,
>
> I suppose that the amount of antialiasing with AGG is set with "gamma" parameter. Mapserver supports that at least for polygons as documented in http://www.mapserver.org/mapfile/outputformat.html but you could try if using gamma=0.0 has an effect on lines as well. It may be that it does not because search
> https://github.com/mapserver/mapserver/search?utf8=%E2%9C%93&q=gamma&type=
> seems to find only something that is tied to polygon outlines
> https://github.com/mapserver/mapserver/blob/branch-7-0/renderers/agg/include/agg_renderer_outline_aa.h
>
>
> If gamma does not work for lines then it could be worth making a feature request for adding a new formatoption "GAMMA_LINE=[].
>
> Couple of Mapnik links dealing with the same issue:
> http://gis.19327.n8.nabble.com/Turning-off-anti-aliasing-td5339458.html
> http://mapnik.org/mapnik-reference/#3.0.6/line-gamma-method
>
> -Jukka Rahkonen-
>
>
>
> -----Alkuperäinen viesti-----
> Lähettäjä: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta Eichner, Andreas - SID
> Lähetetty: 18. lokakuuta 2017 9:57
> Vastaanottaja: Erik H <erik.h11.01 at gmail.com>
> Kopio: mapserver-users at lists.osgeo.org
> Aihe: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
>
> Damn... missed attaching the images.
>
> > -----Ursprüngliche Nachricht-----
> > Von: mapserver-users [mailto:mapserver-users-bounces at lists.osgeo.org]
> > Im Auftrag von Eichner, Andreas - SID
> > Gesendet: Mittwoch, 18. Oktober 2017 08:28
> > An: Erik H
> > Cc: mapserver-users at lists.osgeo.org
> > Betreff: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
> >
> > Hi,
> >
> > I just meant that it seems to be pretty easy to implement aliased
> > rendering with AGG.
> > Simply changing the typedef in line 91 of mapagg.cpp from
> >
> > typedef mapserver::renderer_scanline_aa_solid<renderer_base>
> > renderer_scanline;
> >
> > to
> >
> > typedef mapserver::renderer_scanline_bin_solid<renderer_base>
> > renderer_scanline;
> >
> > turns of anti-aliased rendering. I've attached the output of "shp2img
> > -m line_simple.map" from the msautotests.
> > An additional member in class AGG2Renderer for the aliased rasterizer
> > and conditionally passing one or the other to render_scanlines()
> > depending on some value of strokeStyleObj might be enough.
> >
> > Regards
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: Erik H [mailto:erik.h11.01 at gmail.com]
> > > Gesendet: Dienstag, 17. Oktober 2017 17:34
> > > An: Eichner, Andreas - SID
> > > Cc: Richard Greenwood; mapserver-users at lists.osgeo.org
> > > Betreff: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
> > >
> > > As for Andreas' remark about 'simply the use of another scanline
> > > rasterizer.' - I'm sorry but I'm not much of a C++ developer. If I
> > have
> > > to do rasterizing, I'd skip MapServer altogether and generate the
> > > PNG
> > in
> > > Java.
> > >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20171018/bee3fbdf/attachment.htm>
More information about the MapServer-users
mailing list