Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-11-06 Thread Eichner, Andreas - SID


> -Ursprüngliche Nachricht-
> Von: Erik H [mailto:erik.h11...@gmail.com]
> Gesendet: Montag, 6. November 2017 17:09
> An: Eichner, Andreas - SID
> Cc: mapserver-users@lists.osgeo.org
> Betreff: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
> 
> Thanks again - I'm getting there. I installed libxml2-devel and added
> flags for LIBXML2 and WMS, and now I can compile 'master'.
> 
> I was also able to merge it with my branch and compile it without
> problems.  Rebasing my branch onto the latest and greatest commit in
> 'master' worked as well.

That's great - glad to hear this!

> 
> Was unable to push my changes to the Github repo in order to create a
> PR, though.
> 
> The 'WorkingWithGit' Wiki page says that I have to checkout 'master',
> merge my branch, and push it back; this seems a bit strange to me (I
> expected to have to push my own branch), and it does not seem to work
> anyway:
> 
> 403 Forbidden while accessing https://erik-
> h...@github.com/mapserver/mapserver.git/info/refs
> 
> 
> 
> Same error when trying to push my own branch. Do I need to be granted
> access first, or should I somehow create a PR first?
> 

AFAIK only the core devs have write access to the mapserver/* repos. The usual 
way is to create an account on GitHub, fork off the MapServer-Repo, clone a 
local copy from this, do the changes, merge with latest master, push it back to 
your GitHub repo and create a PR on GitHub.
Not sure but I believe after creating your account and creating the fork you 
can simply set the '"pushurl' for '[remote "origin"]' in .git/config to your 
repo and push:

[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = https://github.com/mapserver/mapserver
pushurl = https://github.com//mapserver.git


You may also ask on the mapserver-dev mailing list for additional help to get 
it to work.

HTH
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-11-06 Thread Erik H
Thanks again - I'm getting there. I installed libxml2-devel and added flags
for LIBXML2 and WMS, and now I can compile 'master'.

I was also able to merge it with my branch and compile it without
problems.  Rebasing my branch onto the latest and greatest commit in
'master' worked as well.

Was unable to push my changes to the Github repo in order to create a PR,
though.

The 'WorkingWithGit' Wiki page says that I have to checkout 'master', merge
my branch, and push it back; this seems a bit strange to me (I expected to
have to push my own branch), and it does not seem to work anyway:

403 Forbidden while accessing
https://erik...@github.com/mapserver/mapserver.git/info/refs


Same error when trying to push my own branch. Do I need to be granted
access first, or should I somehow create a PR first?





On Mon, Nov 6, 2017 at 8:33 AM, Eichner, Andreas - SID <
andreas.eich...@sid.sachsen.de> wrote:

> Ah, you need libxml2, so enable it: -DWITH_LIBXML2=ON
>
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-11-06 Thread Eichner, Andreas - SID
Ah, you need libxml2, so enable it: -DWITH_LIBXML2=ON

> -Ursprüngliche Nachricht-
> Von: Erik H [mailto:erik.h11...@gmail.com]
> Gesendet: Montag, 6. November 2017 14:29
> An: Eichner, Andreas - SID
> Cc: mapserver-users@lists.osgeo.org
> Betreff: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
> 
> Thanks for looking into this, Andreas, but I tried again and I'm still
> getting errors.
> 
> 
> 
> This is my script:
> 
> git pull
> rm -Rf build
> mkdir build
> cd build
> export JAVA_HOME=/usr/java/jdk
> export PYTHON_INCLUDE_DIR=/usr/include/python2.6/
> export PYTHON_LIBRARY=/usr/lib64/python2.6/config/libpython2.6.so
> export GDAL_DIR=/usr/local/src/gdal-2.1.3/
> cmake -DCMAKE_PREFIX_PATH=/usr/local/ WITH_GDAL=$GDAL_DIR  -
> DWITH_FRIBIDI=OFF -DWITH_WFS=OFF   -DWITH_WCS=OFF -
> DWITH_PROJ=/usr/local/lib  -DWITH_LIBXML2=OFF   WITH_POSTGIS=/usr/bin
> -DWITH_CLIENT_WFS=OFF -DWITH_WMS=OFF-DWITH_CLIENT_WMS=OFF
> -DWITH_CURL=OFF -DWITH_SOS=OFF -DWITH_PHP=OFF -
> DWITH_PERL=OFF -DWITH_RUBY=OFF -DWITH_JAVA=ON -
> DWITH_CSHARP=OFF   -DWITH_HARFBUZZ=OFF  -DWITH_PYTHON=ON -
> DWITH_GEOS=0-DWITH_SVGCAIRO=OFF -DWITH_ORACLESPATIAL=OFF
> -DWITH_CAIRO=OFF -DWITH_THREAD_SAFETY=ON  -DWITH_FCGI=OFF   -DWITH_GIF=0
> ../ >../configure.out.txt
> make
> 
> -->
> 
> [ 61%] Building C object CMakeFiles/mapserver.dir/mapmetadata.c.o
> /home//work/mapserver/mapmetadata.c:41: error: expected ‘=’, ‘,’,
> ‘;’, ‘asm’ or ‘__attribute__’ before ‘_msMetadataGetCharacterString’
> ...
> 
> 
> 
> > git log
> commit bf73b5cdfe0bcecc06f8241ddf844a99b5fa7f4b
> Author: Even Rouault <even.roua...@spatialys.com>
> Date:   Fri Nov 3 15:45:20 2017 +0100
> 
> 
> 
> On Mon, Nov 6, 2017 at 3:23 AM, Eichner, Andreas - SID
> <andreas.eich...@sid.sachsen.de> wrote:
> 
> 
>   Hi Erik,
> 
>   just tried building a freshly pulled mapserver/master and I got
> strange CMake errors too.
>   In my case wiping the build/ directory recreating it solved the
> problem.
> 
>   HTH
> 
>   > -Ursprüngliche Nachricht-
>   > Von: mapserver-users [mailto:mapserver-users-
> boun...@lists.osgeo.org <mailto:mapserver-users-boun...@lists.osgeo.org>
> ] Im
>   > Auftrag von Erik H
>   > Gesendet: Freitag, 3. November 2017 21:24
>   > An: mapserver-users@lists.osgeo.org <mailto:mapserver-
> us...@lists.osgeo.org>
>   > Betreff: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
>   >
>   > I made some changes to the mapserver 7 source code that achieve
> what I
>   > want (I'm now able to switch between aliased and antialiased
> lines,
>   > based on the ANTIALIAS keyword in the STYLE section).
>   >
>   > I tried to put up a pull request for it but I'm having problems
>   > compiling the code in the 'master' branch - compilation errors
> for
>   > mapmetadata.c. My code was branched off the release-7 branch and
> did not
>   > have that problem.
>   >
>   > The cmake command I used was
>   >
>   > cmake -DCMAKE_PREFIX_PATH=/usr/local/ WITH_GDAL=$GDAL_DIR  -
>   > DWITH_FRIBIDI=OFF -DWITH_WFS=OFF   -DWITH_WCS=OFF -
>   > DWITH_PROJ=/usr/local/lib  -DWITH_LIBXML2=OFF
> WITH_POSTGIS=/usr/bin
>   > -DWITH_CLIENT_WFS=OFF -DWITH_WMS=OFF-
> DWITH_CLIENT_WMS=OFF
>   > -DWITH_CURL=OFF -DWITH_SOS=OFF -DWITH_PHP=OFF
> -
>   > DWITH_PERL=OFF -DWITH_RUBY=OFF -DWITH_JAVA=ON
> -
>   > DWITH_CSHARP=OFF   -DWITH_HARFBUZZ=OFF  -DWITH_PYTHON=ON
> -
>   > DWITH_GEOS=0-DWITH_SVGCAIRO=OFF -
> DWITH_ORACLESPATIAL=OFF
>   > -DWITH_CAIRO=OFF -DWITH_THREAD_SAFETY=ON  -DWITH_FCGI=OFF   -
> DWITH_GIF=0
>   > ../ >../configure.out.txt
>   >
>   >
>   > Any suggestions?
>   >
>   > Thanks
>   >
>   > On Thu, Oct 19, 2017 at 11:04 AM, Erik H <erik.h11...@gmail.com>
> wrote:
>   >
>   >
>   >   I just did what Andreas spelled out yesterday:
>   >
>   >   Simply changing the typedef in line 91 of mapagg.cpp from
>   >
>   > typedef
> mapserver::renderer_scanline_aa_solid
>   > renderer_scanline;
>   >
>   >   to
>   >
>   > typedef
> mapserver::renderer_scanline_bin_solid
>   > renderer_scanline;
>   >
>   >
>   >
> 

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-11-06 Thread Eichner, Andreas - SID
Hi Erik,

just tried building a freshly pulled mapserver/master and I got strange CMake 
errors too. 
In my case wiping the build/ directory recreating it solved the problem.

HTH

> -Ursprüngliche Nachricht-
> Von: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] Im
> Auftrag von Erik H
> Gesendet: Freitag, 3. November 2017 21:24
> An: mapserver-users@lists.osgeo.org
> Betreff: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
> 
> I made some changes to the mapserver 7 source code that achieve what I
> want (I'm now able to switch between aliased and antialiased lines,
> based on the ANTIALIAS keyword in the STYLE section).
> 
> I tried to put up a pull request for it but I'm having problems
> compiling the code in the 'master' branch - compilation errors for
> mapmetadata.c. My code was branched off the release-7 branch and did not
> have that problem.
> 
> The cmake command I used was
> 
> cmake -DCMAKE_PREFIX_PATH=/usr/local/ WITH_GDAL=$GDAL_DIR  -
> DWITH_FRIBIDI=OFF -DWITH_WFS=OFF   -DWITH_WCS=OFF -
> DWITH_PROJ=/usr/local/lib  -DWITH_LIBXML2=OFF   WITH_POSTGIS=/usr/bin
> -DWITH_CLIENT_WFS=OFF -DWITH_WMS=OFF-DWITH_CLIENT_WMS=OFF
> -DWITH_CURL=OFF -DWITH_SOS=OFF -DWITH_PHP=OFF -
> DWITH_PERL=OFF -DWITH_RUBY=OFF -DWITH_JAVA=ON -
> DWITH_CSHARP=OFF   -DWITH_HARFBUZZ=OFF  -DWITH_PYTHON=ON -
> DWITH_GEOS=0-DWITH_SVGCAIRO=OFF -DWITH_ORACLESPATIAL=OFF
> -DWITH_CAIRO=OFF -DWITH_THREAD_SAFETY=ON  -DWITH_FCGI=OFF   -DWITH_GIF=0
> ../ >../configure.out.txt
> 
> 
> Any suggestions?
> 
> Thanks
> 
> On Thu, Oct 19, 2017 at 11:04 AM, Erik H <erik.h11...@gmail.com> wrote:
> 
> 
>   I just did what Andreas spelled out yesterday:
> 
>   Simply changing the typedef in line 91 of mapagg.cpp from
> 
> typedef mapserver::renderer_scanline_aa_solid
> renderer_scanline;
> 
>   to
> 
> typedef mapserver::renderer_scanline_bin_solid
> renderer_scanline;
> 
> 
> 
>   However, I'd like to be able to switch between rasterizer via some
> option in the .map file, so I'd welcome any suggestion on how to do
> that.
> 
>   On Thu, Oct 19, 2017 at 10:07 AM, Lime, Steve D (MNIT)
> <steve.l...@state.mn.us> wrote:
> 
> 
>   Glad this was figured out! What was the code change exactly?
> 
> 
>   From: mapserver-users  boun...@lists.osgeo.org <mailto:mapserver-users-boun...@lists.osgeo.org>
> > on behalf of Erik H <erik.h11...@gmail.com>
>   Sent: Wednesday, October 18, 2017 8:07:42 PM
>   To: Eichner, Andreas - SID
>   Cc: mapserver-users@lists.osgeo.org <mailto:mapserver-
> us...@lists.osgeo.org>
>   Subject: Re: [mapserver-users] Draw roads WITHOUT anti-
> aliasing
> 
>   Andreas,
> 
>   I made that change in mapagg.cpp and it seems to do exactly
> what I need. Wunderbar!
> 
>   As for providing an option to switch rasterizer based on an
> option, how about reviving the FORMATOPTION 'ANTIALIAS'?
> 
>   Thanks, Erik
> 
>   On Wed, Oct 18, 2017 at 9:18 AM, Eichner, Andreas - SID
> <andreas.eich...@sid.sachsen.de <mailto:andreas.eich...@sid.sachsen.de>
> > wrote:
> 
> 
>   Nope, this won't work:
> 
> r->default_gamma = atof(msGetOutputFormatOption(
> format, "GAMMA", "0.75" ));
> if(r->default_gamma <= 0.0 || r->default_gamma >=
> 1.0) {
>   r->default_gamma = 0.75;
> }
> 
>   From mapagg.cpp lines 844-847 forces 0 < GAMMA < 1
>   Also note that MapServer uses a linear gamma function
> defined as
> 
>  double operator() (double x) const
>   {
>   if(x < m_start) return 0.0;
>   if(x > m_end) return 1.0;
>   return (x - m_start) / (m_end - m_start);
>   }
> 
>   Where m_start is _always_ set to 0 and m_end is set to
> the GAMMA value given by you (or the default 0.75).
>   I think someone should check this - to me it seems a
> power function was intented...
> 
>   HTH
> 
>   > -Ursprüngliche Nachricht-
>           > Von: mapse

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-11-03 Thread Erik H
I made some changes to the mapserver 7 source code that achieve what I want
(I'm now able to switch between aliased and antialiased lines, based on the
ANTIALIAS keyword in the STYLE section).

I tried to put up a pull request for it but I'm having problems compiling
the code in the 'master' branch - compilation errors for mapmetadata.c. My
code was branched off the release-7 branch and did not have that problem.

The cmake command I used was

cmake -DCMAKE_PREFIX_PATH=/usr/local/ WITH_GDAL=$GDAL_DIR
-DWITH_FRIBIDI=OFF -DWITH_WFS=OFF   -DWITH_WCS=OFF
-DWITH_PROJ=/usr/local/lib  -DWITH_LIBXML2=OFF   WITH_POSTGIS=/usr/bin
-DWITH_CLIENT_WFS=OFF -DWITH_WMS=OFF-DWITH_CLIENT_WMS=OFF
 -DWITH_CURL=OFF -DWITH_SOS=OFF -DWITH_PHP=OFF
 -DWITH_PERL=OFF -DWITH_RUBY=OFF -DWITH_JAVA=ON
 -DWITH_CSHARP=OFF   -DWITH_HARFBUZZ=OFF  -DWITH_PYTHON=ON
 -DWITH_GEOS=0-DWITH_SVGCAIRO=OFF -DWITH_ORACLESPATIAL=OFF
 -DWITH_CAIRO=OFF -DWITH_THREAD_SAFETY=ON  -DWITH_FCGI=OFF   -DWITH_GIF=0
../ >../configure.out.txt

Any suggestions?

Thanks

On Thu, Oct 19, 2017 at 11:04 AM, Erik H <erik.h11...@gmail.com> wrote:

> I just did what Andreas spelled out yesterday:
>
>
>
>
>
>
>
> *Simply changing the typedef in line 91 of mapagg.cpp from  typedef
> mapserver::renderer_scanline_aa_solid renderer_scanline;to
> typedef mapserver::renderer_scanline_bin_solid
> renderer_scanline;*
>
>
> However, I'd like to be able to switch between rasterizer via some option
> in the .map file, so I'd welcome any suggestion on how to do that.
>
> On Thu, Oct 19, 2017 at 10:07 AM, Lime, Steve D (MNIT) <
> steve.l...@state.mn.us> wrote:
>
>> Glad this was figured out! What was the code change exactly?
>> --
>> *From:* mapserver-users <mapserver-users-boun...@lists.osgeo.org> on
>> behalf of Erik H <erik.h11...@gmail.com>
>> *Sent:* Wednesday, October 18, 2017 8:07:42 PM
>> *To:* Eichner, Andreas - SID
>> *Cc:* mapserver-users@lists.osgeo.org
>> *Subject:* Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
>>
>> Andreas,
>>
>> I made that change in mapagg.cpp and it seems to do exactly what I need.
>> Wunderbar!
>>
>> As for providing an option to switch rasterizer based on an option, how
>> about reviving the FORMATOPTION 'ANTIALIAS'?
>>
>> Thanks, Erik
>>
>> On Wed, Oct 18, 2017 at 9:18 AM, Eichner, Andreas - SID <
>> andreas.eich...@sid.sachsen.de> wrote:
>>
>>> Nope, this won't work:
>>>
>>>   r->default_gamma = atof(msGetOutputFormatOption( format, "GAMMA",
>>> "0.75" ));
>>>   if(r->default_gamma <= 0.0 || r->default_gamma >= 1.0) {
>>> r->default_gamma = 0.75;
>>>   }
>>>
>>> From mapagg.cpp lines 844-847 forces 0 < GAMMA < 1
>>> Also note that MapServer uses a linear gamma function defined as
>>>
>>>double operator() (double x) const
>>> {
>>> if(x < m_start) return 0.0;
>>> if(x > m_end) return 1.0;
>>> return (x - m_start) / (m_end - m_start);
>>> }
>>>
>>> Where m_start is _always_ set to 0 and m_end is set to the GAMMA value
>>> given by you (or the default 0.75).
>>> I think someone should check this - to me it seems a power function was
>>> intented...
>>>
>>> HTH
>>>
>>> > -Ursprüngliche Nachricht-
>>> > Von: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org]
>>> Im
>>> > Auftrag von lars.schylb...@blixtmail.se
>>> > Gesendet: Mittwoch, 18. Oktober 2017 14:05
>>> > An: mapserver-users@lists.osgeo.org
>>> > Betreff: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
>>> >
>>> > 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
>>> >
>>

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-19 Thread Lime, Steve D (MNIT)
Glad this was figured out! What was the code change exactly?

From: mapserver-users <mapserver-users-boun...@lists.osgeo.org> on behalf of 
Erik H <erik.h11...@gmail.com>
Sent: Wednesday, October 18, 2017 8:07:42 PM
To: Eichner, Andreas - SID
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

Andreas,

I made that change in mapagg.cpp and it seems to do exactly what I need. 
Wunderbar!

As for providing an option to switch rasterizer based on an option, how about 
reviving the FORMATOPTION 'ANTIALIAS'?

Thanks, Erik

On Wed, Oct 18, 2017 at 9:18 AM, Eichner, Andreas - SID 
<andreas.eich...@sid.sachsen.de<mailto:andreas.eich...@sid.sachsen.de>> wrote:
Nope, this won't work:

  r->default_gamma = atof(msGetOutputFormatOption( format, "GAMMA", "0.75" ));
  if(r->default_gamma <= 0.0 || r->default_gamma >= 1.0) {
r->default_gamma = 0.75;
  }

>From mapagg.cpp lines 844-847 forces 0 < GAMMA < 1
Also note that MapServer uses a linear gamma function defined as

   double operator() (double x) const
{
if(x < m_start) return 0.0;
if(x > m_end) return 1.0;
return (x - m_start) / (m_end - m_start);
}

Where m_start is _always_ set to 0 and m_end is set to the GAMMA value given by 
you (or the default 0.75).
I think someone should check this - to me it seems a power function was 
intented...

HTH

> -Ursprüngliche Nachricht-
> Von: mapserver-users 
> [mailto:mapserver-users-boun...@lists.osgeo.org<mailto:mapserver-users-boun...@lists.osgeo.org>]
>  Im
> Auftrag von lars.schylb...@blixtmail.se<mailto:lars.schylb...@blixtmail.se>
> Gesendet: Mittwoch, 18. Oktober 2017 14:05
> An: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org>
> Betreff: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
>
> 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.rahko...@maanmittauslaitos.fi<mailto:jukka.rahko...@maanmittauslaitos.fi>>
> > Till: "Eichner, Andreas - SID" 
> > <andreas.eich...@sid.sachsen.de<mailto:andreas.eich...@sid.sachsen.de>>, 
> > "Erik
> H" <erik.h11...@gmail.com<mailto:erik.h11...@gmail.com>>
> > Kopia: 
> > mapserver-users@lists.osgeo.org<mailto:mapserver-users@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=gamma
> e=
> > 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-<mailto:mapserver-users->
> boun...@lists.osgeo.org<mailto:boun...@lists.osgeo.org>] Puolesta Eichner, 
> Andreas - SID
> > Lähetetty: 18. lokakuuta 2017 9:57
> > Vastaanottaja: Erik H <erik.h11...@gmail.com<mailto:erik.h11...@gmail.c

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-18 Thread Erik H
Andreas,

I made that change in mapagg.cpp and it seems to do exactly what I need.
Wunderbar!

As for providing an option to switch rasterizer based on an option, how
about reviving the FORMATOPTION 'ANTIALIAS'?

Thanks, Erik

On Wed, Oct 18, 2017 at 9:18 AM, Eichner, Andreas - SID <
andreas.eich...@sid.sachsen.de> wrote:

> Nope, this won't work:
>
>   r->default_gamma = atof(msGetOutputFormatOption( format, "GAMMA", "0.75"
> ));
>   if(r->default_gamma <= 0.0 || r->default_gamma >= 1.0) {
> r->default_gamma = 0.75;
>   }
>
> From mapagg.cpp lines 844-847 forces 0 < GAMMA < 1
> Also note that MapServer uses a linear gamma function defined as
>
>double operator() (double x) const
> {
> if(x < m_start) return 0.0;
> if(x > m_end) return 1.0;
> return (x - m_start) / (m_end - m_start);
> }
>
> Where m_start is _always_ set to 0 and m_end is set to the GAMMA value
> given by you (or the default 0.75).
> I think someone should check this - to me it seems a power function was
> intented...
>
> HTH
>
> > -Ursprüngliche Nachricht-
> > Von: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] Im
> > Auftrag von lars.schylb...@blixtmail.se
> > Gesendet: Mittwoch, 18. Oktober 2017 14:05
> > An: mapserver-users@lists.osgeo.org
> > Betreff: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
> >
> > 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.rahko...@maanmittauslaitos.fi>
> > > Till: "Eichner, Andreas - SID" <andreas.eich...@sid.sachsen.de>, "Erik
> > H" <erik.h11...@gmail.com>
> > > Kopia: mapserver-users@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=gamma
> > e=
> > > 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-
> > boun...@lists.osgeo.org] Puolesta Eichner, Andreas - SID
> > > Lähetetty: 18. lokakuuta 2017 9:57
> > > Vastaanottaja: Erik H <erik.h11...@gmail.com>
> > > Kopio: mapserver-users@lists.osgeo.org
> > > Aihe: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
> > >
> > > Damn... missed attaching the images.
> > >
> > > > -Ursprüngliche Nachricht-
> > > > Von: mapserver-users [mailto:mapse

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-18 Thread Eichner, Andreas - SID
Nope, this won't work:

  r->default_gamma = atof(msGetOutputFormatOption( format, "GAMMA", "0.75" ));
  if(r->default_gamma <= 0.0 || r->default_gamma >= 1.0) {
r->default_gamma = 0.75;
  }

From mapagg.cpp lines 844-847 forces 0 < GAMMA < 1
Also note that MapServer uses a linear gamma function defined as

   double operator() (double x) const
{
if(x < m_start) return 0.0;
if(x > m_end) return 1.0;
return (x - m_start) / (m_end - m_start);
}

Where m_start is _always_ set to 0 and m_end is set to the GAMMA value given by 
you (or the default 0.75).
I think someone should check this - to me it seems a power function was 
intented...

HTH

> -Ursprüngliche Nachricht-
> Von: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] Im
> Auftrag von lars.schylb...@blixtmail.se
> Gesendet: Mittwoch, 18. Oktober 2017 14:05
> An: mapserver-users@lists.osgeo.org
> Betreff: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
> 
> 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.rahko...@maanmittauslaitos.fi>
> > Till: "Eichner, Andreas - SID" <andreas.eich...@sid.sachsen.de>, "Erik
> H" <erik.h11...@gmail.com>
> > Kopia: mapserver-users@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=gamma
> e=
> > 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-
> boun...@lists.osgeo.org] Puolesta Eichner, Andreas - SID
> > Lähetetty: 18. lokakuuta 2017 9:57
> > Vastaanottaja: Erik H <erik.h11...@gmail.com>
> > Kopio: mapserver-users@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-
> boun...@lists.osgeo.org]
> > > Im Auftrag von Eichner, Andreas - SID
> > > Gesendet: Mittwoch, 18. Oktober 2017 08:28
> > > An: Erik H
> > > Cc: mapserver-users@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_scanline;
> > >
> > > to
> > >
> > >   typedef mapserver::renderer_scanline_bin_solid
> > > renderer_scanline;
> > >
> > > turns of anti-aliased rendering. I've attached the output of
> "shp2img
> > > -m 

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-18 Thread Rahkonen Jukka (MML)
Hi Lars,

I had not tried that myself but did some tests now. I do not really see any 
difference in the output  with any values of gamma. Perhaps it is broken.

I have been thinking that one of the most common use cases is to draw adjacent 
polygons with just fill but no outlines so that the whole area gets unique 
color even when the fill has some transparency set in STYLE with somehow like

 CLASS
NAME "polygon_test"
STYLE
COLOR 100 50 0
OPACITY 50
END
 END

I am not sure if this test makes sense and I know that I can get rid of the 
borders between the polygons by using COMPOSITE-OPACITY at the LAYER level.

When GD renderer was removed the support to render without anti-aliasing was 
recognized as a good feature http://mapserver.org/development/rfc/ms-rfc-99.html
-Jukka Rahkonen-


Lähettäjä: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] 
Puolesta lars.schylb...@blixtmail.se
Lähetetty: 18. lokakuuta 2017 15:05
Vastaanottaja: mapserver-users@lists.osgeo.org
Aihe: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing


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.rahko...@maanmittauslaitos.fi<mailto:jukka.rahko...@maanmittauslaitos.fi>>
> Till: "Eichner, Andreas - SID" 
> <andreas.eich...@sid.sachsen.de<mailto:andreas.eich...@sid.sachsen.de>>, 
> "Erik H" <erik.h11...@gmail.com<mailto:erik.h11...@gmail.com>>
> Kopia: mapserver-users@lists.osgeo.org<mailto:mapserver-users@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=gamma=
> 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-boun...@lists.osgeo.org<mailto:mapserver-users-boun...@lists.osgeo.org>]
>  Puolesta Eichner, Andreas - SID
> Lähetetty: 18. lokakuuta 2017 9:57
> Vastaanottaja: Erik H <erik.h11...@gmail.com<mailto:erik.h11...@gmail.com>>
> Kopio: mapserver-users@lists.osgeo.org<mailto:mapserver-users@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-boun...@lists.osgeo.org<mailto:mapserver-users-boun...@lists.osgeo.org>]
> > Im Auftrag von Eichner, Andreas - SID
> > Gesendet: Mittwoch, 18. Oktober 2017 08:28
> > An: Erik H
> > Cc: mapserver-users@lists.osgeo.org<mailto:mapserver-users@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_scanline;
> >
> > to
> >
> >   typedef mapserver::renderer_scanline_bin_solid
> > 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 AGG2Rende

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-18 Thread lars . schylberg

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.rahko...@maanmittauslaitos.fi> 
> Till: "Eichner, Andreas - SID" <andreas.eich...@sid.sachsen.de>, "Erik H" 
> <erik.h11...@gmail.com> 
> Kopia: mapserver-users@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=gamma=
> 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-boun...@lists.osgeo.org] 
> Puolesta Eichner, Andreas - SID
> Lähetetty: 18. lokakuuta 2017 9:57
> Vastaanottaja: Erik H <erik.h11...@gmail.com>
> Kopio: mapserver-users@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-boun...@lists.osgeo.org] 
> > Im Auftrag von Eichner, Andreas - SID
> > Gesendet: Mittwoch, 18. Oktober 2017 08:28
> > An: Erik H
> > Cc: mapserver-users@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_scanline;
> > 
> > to
> > 
> >   typedef mapserver::renderer_scanline_bin_solid
> > 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...@gmail.com]
> > > Gesendet: Dienstag, 17. Oktober 2017 17:34
> > > An: Eichner, Andreas - SID
> > > Cc: Richard Greenwood; mapserver-users@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@lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users





-- 
 

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-18 Thread Rahkonen Jukka (MML)
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=gamma=
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-boun...@lists.osgeo.org] 
Puolesta Eichner, Andreas - SID
Lähetetty: 18. lokakuuta 2017 9:57
Vastaanottaja: Erik H <erik.h11...@gmail.com>
Kopio: mapserver-users@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-boun...@lists.osgeo.org] 
> Im Auftrag von Eichner, Andreas - SID
> Gesendet: Mittwoch, 18. Oktober 2017 08:28
> An: Erik H
> Cc: mapserver-users@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_scanline;
> 
> to
> 
>   typedef mapserver::renderer_scanline_bin_solid
> 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...@gmail.com]
> > Gesendet: Dienstag, 17. Oktober 2017 17:34
> > An: Eichner, Andreas - SID
> > Cc: Richard Greenwood; mapserver-users@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@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-18 Thread Eichner, Andreas - SID
Damn... missed attaching the images.

> -Ursprüngliche Nachricht-
> Von: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] Im
> Auftrag von Eichner, Andreas - SID
> Gesendet: Mittwoch, 18. Oktober 2017 08:28
> An: Erik H
> Cc: mapserver-users@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_scanline;
> 
> to
> 
>   typedef mapserver::renderer_scanline_bin_solid
> 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...@gmail.com]
> > Gesendet: Dienstag, 17. Oktober 2017 17:34
> > An: Eichner, Andreas - SID
> > Cc: Richard Greenwood; mapserver-users@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@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-18 Thread Eichner, Andreas - SID
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_scanline;

to

  typedef mapserver::renderer_scanline_bin_solid 
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...@gmail.com]
> Gesendet: Dienstag, 17. Oktober 2017 17:34
> An: Eichner, Andreas - SID
> Cc: Richard Greenwood; mapserver-users@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@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-17 Thread Erik H
We've considered vector tiles but the problem is that (just like image
tiles) they would involve a lot of redrawing and would require a high
bandwidth.

We envision something like 'color cycling' which is sometimes used in
graphics: see http://www.effectgames.com/demos/canvascycle/?sound=0 .

It's a bit like coloring books: you specify a palette (1=red, 2=yellow and
so on), and if you decide you want different colors, you erase the colors
that need to be changed and color them in again with the new color - no
need to have a new book shipped to you, or even to color the entire page if
some colors are unchanged.

Of course, a coloring book is not very useful if it specifies numbers that
are not in the palette, or (worse) if some numbers exist in the palette but
are just wrong (you don't want to color part of Belle's dress with the
color that was meant for Ariel's hair).

On a more technical note, we get pretty far by filtering out the pixels
with alpha != 255 (see screenshots) but some incorrect pixels remain.
Ideally, we would like to preserve some kind of anti-aliasing but we need
about 22 bits just to encode the road segments, not sure how that would
work.

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.

Thanks.


On Tue, Oct 17, 2017 at 4:53 AM, Eichner, Andreas - SID <
andreas.eich...@sid.sachsen.de> wrote:

> I'd guess it's simply the use of another scanline rasterizer. The demo
>   http://www.antigrain.com/demo/rasterizers.cpp.html
> is an example of drawing as polygon aliased and anti-aliased side by side.
>
>
> > -Ursprüngliche Nachricht-
> > Von: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] Im
> > Auftrag von Richard Greenwood
> > Gesendet: Dienstag, 17. Oktober 2017 03:44
> > An: Erik H
> > Cc: mapserver-users@lists.osgeo.org
> > Betreff: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
> >
> > On Mon, Oct 16, 2017 at 1:23 PM, Erik H <erik.h11...@gmail.com> wrote:
> >
> >
> >   I don't think we have much use for lines that are one pixel wide.
> >
> >   I'm surprised at how difficult this is; isn't there some driver
> > other than AGG/PNG I could use?
> >
> >
> > In mapserver versions before 7.0 there is the GD driver. I use it for 8
> > bit GIFs. Not sure what it does with 24 images.
> >
> > Rich
> >
> >
> >
> >
> >
> >
> >   On Mon, Oct 16, 2017 at 2:50 PM, Lime, Steve D (MNIT)
> > <steve.l...@state.mn.us> wrote:
> >
> >
> >   So you really do need 24-bit output. I was looking back
> > through the mailing list archives and it was mentioned back in 2012 that
> > aliased output could be implemented for simple (1 pixel-wide) lines and
> > polygons – so there is hope but I don’t believe (looking through the
> > source) that Thomas ever fully implemented it. In mapagg.cpp there are
> > ifdef’s for a symbol named AGG_ALIASED_ENABLED which makes me wonder if
> > work was started. I tried setting that in mapagg.cpp but ran into
> > compile errors and didn’t try and track those down.
> >
> >
> >
> >   Of course you’d have to live with 1 pixel wide lines…
> >
> >
> >
> >   Steve
> >
> >
> >
> >       From: Erik H [mailto:erik.h11...@gmail.com]
> >   Sent: Monday, October 16, 2017 1:15 PM
> >   To: Lime, Steve D (MNIT) <steve.l...@state.mn.us>
> >   Cc: mapserver-users@lists.osgeo.org <mailto:mapserver-
> > us...@lists.osgeo.org>
> >   Subject: Re: [mapserver-users] Draw roads WITHOUT anti-
> > aliasing
> >
> >
> >
> >   Thanks for your reply, but I should have mentioned that I
> > have a LOT of different colors to be displayed, almost a million...
> >
> >
> >
> >   I should also have mentioned that I've already tried to
> > filter out the anti-aliased pixels by setting all alpha bytes to 255 and
> > then assuming that all pixels that don't have alpha=255 in the PNG can
> > be removed, but that assumption seems to be wrong.
> >
> >
> >
> >   On Mon, Oct 16, 2017 at 2:00 PM, Lime, Steve D (MNIT)
> > <steve.l...@state.mn.us> wrote:
> >
> >   Hmmm… I wonder if you just could use a pre-computed
> > palette to control quantizing to 8 bits. You can supply a palette file
> > (RGB or RGBA) and the MapServer will map 24/32-bit values to those 

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-17 Thread Eichner, Andreas - SID
I'd guess it's simply the use of another scanline rasterizer. The demo
  http://www.antigrain.com/demo/rasterizers.cpp.html
is an example of drawing as polygon aliased and anti-aliased side by side.


> -Ursprüngliche Nachricht-
> Von: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] Im
> Auftrag von Richard Greenwood
> Gesendet: Dienstag, 17. Oktober 2017 03:44
> An: Erik H
> Cc: mapserver-users@lists.osgeo.org
> Betreff: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
> 
> On Mon, Oct 16, 2017 at 1:23 PM, Erik H <erik.h11...@gmail.com> wrote:
> 
> 
>   I don't think we have much use for lines that are one pixel wide.
> 
>   I'm surprised at how difficult this is; isn't there some driver
> other than AGG/PNG I could use?
> 
> 
> In mapserver versions before 7.0 there is the GD driver. I use it for 8
> bit GIFs. Not sure what it does with 24 images.
> 
> Rich
> 
> 
> 
> 
> 
> 
>   On Mon, Oct 16, 2017 at 2:50 PM, Lime, Steve D (MNIT)
> <steve.l...@state.mn.us> wrote:
> 
> 
>   So you really do need 24-bit output. I was looking back
> through the mailing list archives and it was mentioned back in 2012 that
> aliased output could be implemented for simple (1 pixel-wide) lines and
> polygons – so there is hope but I don’t believe (looking through the
> source) that Thomas ever fully implemented it. In mapagg.cpp there are
> ifdef’s for a symbol named AGG_ALIASED_ENABLED which makes me wonder if
> work was started. I tried setting that in mapagg.cpp but ran into
> compile errors and didn’t try and track those down.
> 
> 
> 
>   Of course you’d have to live with 1 pixel wide lines…
> 
> 
> 
>   Steve
> 
> 
> 
>   From: Erik H [mailto:erik.h11...@gmail.com]
>   Sent: Monday, October 16, 2017 1:15 PM
>   To: Lime, Steve D (MNIT) <steve.l...@state.mn.us>
>   Cc: mapserver-users@lists.osgeo.org <mailto:mapserver-
> us...@lists.osgeo.org>
>   Subject: Re: [mapserver-users] Draw roads WITHOUT anti-
> aliasing
> 
> 
> 
>   Thanks for your reply, but I should have mentioned that I
> have a LOT of different colors to be displayed, almost a million...
> 
> 
> 
>   I should also have mentioned that I've already tried to
> filter out the anti-aliased pixels by setting all alpha bytes to 255 and
> then assuming that all pixels that don't have alpha=255 in the PNG can
> be removed, but that assumption seems to be wrong.
> 
> 
> 
>   On Mon, Oct 16, 2017 at 2:00 PM, Lime, Steve D (MNIT)
> <steve.l...@state.mn.us> wrote:
> 
>   Hmmm… I wonder if you just could use a pre-computed
> palette to control quantizing to 8 bits. You can supply a palette file
> (RGB or RGBA) and the MapServer will map 24/32-bit values to those in
> the palette. Format options are:
> 
> 
> 
>FORMATOPTION "PALETTE_FORCE=TRUE"
> 
>   FORMATOPTION "PALETTE=palette.txt"
> 
> 
> 
>   This will definitely limit the colors in your output
> image to those you specify. The question is whether or not the anti-
> aliased colors will map to the right color and that will depend on your
> palette. I did write a simple test with a 5 color palette (black, white,
> red, green and blue) and it seems to work ok but that’s a very simple
> palette… Based on your application it might work though.
> 
> 
> 
>   -  http://maps1.dnr.state.mn.us/cgi-
> bin/mapserv70?map=/usr/local/mapserver/apps/test/palette/test.map=m
> ap <http://maps1.dnr.state.mn.us/cgi-
> bin/mapserv70?map=/usr/local/mapserver/apps/test/palette/test.map=m
> ap>  (24-bit)
> 
>   -  http://maps1.dnr.state.mn.us/cgi-
> bin/mapserv70?map=/usr/local/mapserver/apps/test/palette/test.map=m
> ap=png8 <http://maps1.dnr.state.mn.us/cgi-
> bin/mapserv70?map=/usr/local/mapserver/apps/test/palette/test.map=m
> ap=png8>  (8-bit w/5 colors)
> 
> 
> 
>   Steve
> 
> 
> 
>   From: mapserver-users [mailto:mapserver-users-
> boun...@lists.osgeo.org <mailto:mapserver-users-boun...@lists.osgeo.org>
> ] On Behalf Of Erik H
>   Sent: Monday, October 16, 2017 10:58 AM
>   To: mapserver-users@lists.osgeo.org <mailto:mapserver-
> us...@lists.osgeo.org>
>   Subject: [mapserver-users] Draw roads WITHOUT anti-
> aliasing
> 
> 
> 
>   I'm running a tiling 

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-16 Thread Richard Greenwood
On Mon, Oct 16, 2017 at 1:23 PM, Erik H <erik.h11...@gmail.com> wrote:

> I don't think we have much use for lines that are one pixel wide.
>
> I'm surprised at how difficult this is; isn't there some driver other than
> AGG/PNG I could use?
>

In mapserver versions before 7.0 there is the GD driver. I use it for 8 bit
GIFs. Not sure what it does with 24 images.

Rich



>
>
>
> On Mon, Oct 16, 2017 at 2:50 PM, Lime, Steve D (MNIT) <
> steve.l...@state.mn.us> wrote:
>
>> So you really do need 24-bit output. I was looking back through the
>> mailing list archives and it was mentioned back in 2012 that aliased output
>> could be implemented for simple (1 pixel-wide) lines and polygons – so
>> there is hope but I don’t believe (looking through the source) that Thomas
>> ever fully implemented it. In mapagg.cpp there are ifdef’s for a symbol
>> named AGG_ALIASED_ENABLED which makes me wonder if work was started. I
>> tried setting that in mapagg.cpp but ran into compile errors and didn’t try
>> and track those down.
>>
>>
>>
>> Of course you’d have to live with 1 pixel wide lines…
>>
>>
>>
>> Steve
>>
>>
>>
>> *From:* Erik H [mailto:erik.h11...@gmail.com]
>> *Sent:* Monday, October 16, 2017 1:15 PM
>> *To:* Lime, Steve D (MNIT) <steve.l...@state.mn.us>
>> *Cc:* mapserver-users@lists.osgeo.org
>> *Subject:* Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
>>
>>
>>
>> Thanks for your reply, but I should have mentioned that I have a LOT of
>> different colors to be displayed, almost a million...
>>
>>
>>
>> I should also have mentioned that I've already tried to filter out the
>> anti-aliased pixels by setting all alpha bytes to 255 and then assuming
>> that all pixels that don't have alpha=255 in the PNG can be removed, but
>> that assumption seems to be wrong.
>>
>>
>>
>> On Mon, Oct 16, 2017 at 2:00 PM, Lime, Steve D (MNIT) <
>> steve.l...@state.mn.us> wrote:
>>
>> Hmmm… I wonder if you just could use a pre-computed palette to control
>> quantizing to 8 bits. You can supply a palette file (RGB or RGBA) and the
>> MapServer will map 24/32-bit values to those in the palette. Format options
>> are:
>>
>>
>>
>>  FORMATOPTION "PALETTE_FORCE=TRUE"
>>
>> FORMATOPTION "PALETTE=palette.txt"
>>
>>
>>
>> This will definitely limit the colors in your output image to those you
>> specify. The question is whether or not the anti-aliased colors will map to
>> the right color and that will depend on your palette. I did write a simple
>> test with a 5 color palette (black, white, red, green and blue) and it
>> seems to work ok but that’s a very simple palette… Based on your
>> application it might work though.
>>
>>
>>
>> -  http://maps1.dnr.state.mn.us/cgi-bin/mapserv70?map=/usr/loca
>> l/mapserver/apps/test/palette/test.map=map (24-bit)
>>
>> -  http://maps1.dnr.state.mn.us/cgi-bin/mapserv70?map=/usr/loca
>> l/mapserver/apps/test/palette/test.map=map=png8
>> (8-bit w/5 colors)
>>
>>
>>
>> Steve
>>
>>
>>
>> *From:* mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] *On
>> Behalf Of *Erik H
>> *Sent:* Monday, October 16, 2017 10:58 AM
>> *To:* mapserver-users@lists.osgeo.org
>> *Subject:* [mapserver-users] Draw roads WITHOUT anti-aliasing
>>
>>
>>
>> I'm running a tiling server that uses MapServer 7.0.4 to generate PNGs.
>>
>>
>>
>> My colleagues came up with an ingenious idea to animate traffic
>> conditions that would require them to identify road segments based on their
>> color. They asked me to generate tiles with a predetermined RGBA value per
>> road segment.
>>
>>
>>
>> I configured a layer of type LINE, with a STYLE section containing 'COLOR
>> [palette]' (palette being a field in the database query). Initially, I
>> thought I was creating the images my colleagues needed, but it seems that
>> the anti-aliasing causes some pixels to have colors other than the one I
>> specified; this prevents us from identifying the road segments.
>>
>>
>>
>> We can live without anti-aliasing, but I was unable to turn it off; I
>> tried both the AGG/PNG and GD/PNG drivers and messed with various
>> FORMATOPTION identifiers, but nothing seemed to make any difference.
>>
>>
>>
>> Any suggestions?
>>
>>
>>
>> Thanks.
>>
>>
>>
>
>
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>



-- 
Richard W. Greenwood, PLS
www.greenwoodmap.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-16 Thread Lime, Steve D (MNIT)
AGG is all about high quality and high performance so aliased output is 
antithetical. I doubt the author ever thought (or cared) about that as a use 
case.
Maybe Cairo supports this? I suppose one could write a special rendering 
backend that only draws aliased lines and bails on most everything else. The 
algorithm for drawing a line is well known.


From: Erik H <erik.h11...@gmail.com>
Sent: Monday, October 16, 2017 2:23:33 PM
To: Lime, Steve D (MNIT)
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

I don't think we have much use for lines that are one pixel wide.

I'm surprised at how difficult this is; isn't there some driver other than 
AGG/PNG I could use?



On Mon, Oct 16, 2017 at 2:50 PM, Lime, Steve D (MNIT) 
<steve.l...@state.mn.us<mailto:steve.l...@state.mn.us>> wrote:
So you really do need 24-bit output. I was looking back through the mailing 
list archives and it was mentioned back in 2012 that aliased output could be 
implemented for simple (1 pixel-wide) lines and polygons – so there is hope but 
I don’t believe (looking through the source) that Thomas ever fully implemented 
it. In mapagg.cpp there are ifdef’s for a symbol named AGG_ALIASED_ENABLED 
which makes me wonder if work was started. I tried setting that in mapagg.cpp 
but ran into compile errors and didn’t try and track those down.

Of course you’d have to live with 1 pixel wide lines…

Steve

From: Erik H [mailto:erik.h11...@gmail.com<mailto:erik.h11...@gmail.com>]
Sent: Monday, October 16, 2017 1:15 PM
To: Lime, Steve D (MNIT) <steve.l...@state.mn.us<mailto:steve.l...@state.mn.us>>
Cc: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org>
Subject: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

Thanks for your reply, but I should have mentioned that I have a LOT of 
different colors to be displayed, almost a million...

I should also have mentioned that I've already tried to filter out the 
anti-aliased pixels by setting all alpha bytes to 255 and then assuming that 
all pixels that don't have alpha=255 in the PNG can be removed, but that 
assumption seems to be wrong.

On Mon, Oct 16, 2017 at 2:00 PM, Lime, Steve D (MNIT) 
<steve.l...@state.mn.us<mailto:steve.l...@state.mn.us>> wrote:
Hmmm… I wonder if you just could use a pre-computed palette to control 
quantizing to 8 bits. You can supply a palette file (RGB or RGBA) and the 
MapServer will map 24/32-bit values to those in the palette. Format options are:

 FORMATOPTION "PALETTE_FORCE=TRUE"
FORMATOPTION "PALETTE=palette.txt"

This will definitely limit the colors in your output image to those you 
specify. The question is whether or not the anti-aliased colors will map to the 
right color and that will depend on your palette. I did write a simple test 
with a 5 color palette (black, white, red, green and blue) and it seems to work 
ok but that’s a very simple palette… Based on your application it might work 
though.

-  
http://maps1.dnr.state.mn.us/cgi-bin/mapserv70?map=/usr/local/mapserver/apps/test/palette/test.map=map
 (24-bit)
-  
http://maps1.dnr.state.mn.us/cgi-bin/mapserv70?map=/usr/local/mapserver/apps/test/palette/test.map=map=png8
 (8-bit w/5 colors)

Steve

From: mapserver-users 
[mailto:mapserver-users-boun...@lists.osgeo.org<mailto:mapserver-users-boun...@lists.osgeo.org>]
 On Behalf Of Erik H
Sent: Monday, October 16, 2017 10:58 AM
To: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org>
Subject: [mapserver-users] Draw roads WITHOUT anti-aliasing

I'm running a tiling server that uses MapServer 7.0.4 to generate PNGs.

My colleagues came up with an ingenious idea to animate traffic conditions that 
would require them to identify road segments based on their color. They asked 
me to generate tiles with a predetermined RGBA value per road segment.

I configured a layer of type LINE, with a STYLE section containing 'COLOR 
[palette]' (palette being a field in the database query). Initially, I thought 
I was creating the images my colleagues needed, but it seems that the 
anti-aliasing causes some pixels to have colors other than the one I specified; 
this prevents us from identifying the road segments.

We can live without anti-aliasing, but I was unable to turn it off; I tried 
both the AGG/PNG and GD/PNG drivers and messed with various FORMATOPTION 
identifiers, but nothing seemed to make any difference.

Any suggestions?

Thanks.


___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-16 Thread Erik H
I don't think we have much use for lines that are one pixel wide.

I'm surprised at how difficult this is; isn't there some driver other than
AGG/PNG I could use?



On Mon, Oct 16, 2017 at 2:50 PM, Lime, Steve D (MNIT) <
steve.l...@state.mn.us> wrote:

> So you really do need 24-bit output. I was looking back through the
> mailing list archives and it was mentioned back in 2012 that aliased output
> could be implemented for simple (1 pixel-wide) lines and polygons – so
> there is hope but I don’t believe (looking through the source) that Thomas
> ever fully implemented it. In mapagg.cpp there are ifdef’s for a symbol
> named AGG_ALIASED_ENABLED which makes me wonder if work was started. I
> tried setting that in mapagg.cpp but ran into compile errors and didn’t try
> and track those down.
>
>
>
> Of course you’d have to live with 1 pixel wide lines…
>
>
>
> Steve
>
>
>
> *From:* Erik H [mailto:erik.h11...@gmail.com]
> *Sent:* Monday, October 16, 2017 1:15 PM
> *To:* Lime, Steve D (MNIT) <steve.l...@state.mn.us>
> *Cc:* mapserver-users@lists.osgeo.org
> *Subject:* Re: [mapserver-users] Draw roads WITHOUT anti-aliasing
>
>
>
> Thanks for your reply, but I should have mentioned that I have a LOT of
> different colors to be displayed, almost a million...
>
>
>
> I should also have mentioned that I've already tried to filter out the
> anti-aliased pixels by setting all alpha bytes to 255 and then assuming
> that all pixels that don't have alpha=255 in the PNG can be removed, but
> that assumption seems to be wrong.
>
>
>
> On Mon, Oct 16, 2017 at 2:00 PM, Lime, Steve D (MNIT) <
> steve.l...@state.mn.us> wrote:
>
> Hmmm… I wonder if you just could use a pre-computed palette to control
> quantizing to 8 bits. You can supply a palette file (RGB or RGBA) and the
> MapServer will map 24/32-bit values to those in the palette. Format options
> are:
>
>
>
>  FORMATOPTION "PALETTE_FORCE=TRUE"
>
> FORMATOPTION "PALETTE=palette.txt"
>
>
>
> This will definitely limit the colors in your output image to those you
> specify. The question is whether or not the anti-aliased colors will map to
> the right color and that will depend on your palette. I did write a simple
> test with a 5 color palette (black, white, red, green and blue) and it
> seems to work ok but that’s a very simple palette… Based on your
> application it might work though.
>
>
>
> -  http://maps1.dnr.state.mn.us/cgi-bin/mapserv70?map=/usr/
> local/mapserver/apps/test/palette/test.map=map (24-bit)
>
> -  http://maps1.dnr.state.mn.us/cgi-bin/mapserv70?map=/usr/
> local/mapserver/apps/test/palette/test.map=map=png8
> (8-bit w/5 colors)
>
>
>
> Steve
>
>
>
> *From:* mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] *On
> Behalf Of *Erik H
> *Sent:* Monday, October 16, 2017 10:58 AM
> *To:* mapserver-users@lists.osgeo.org
> *Subject:* [mapserver-users] Draw roads WITHOUT anti-aliasing
>
>
>
> I'm running a tiling server that uses MapServer 7.0.4 to generate PNGs.
>
>
>
> My colleagues came up with an ingenious idea to animate traffic conditions
> that would require them to identify road segments based on their color.
> They asked me to generate tiles with a predetermined RGBA value per road
> segment.
>
>
>
> I configured a layer of type LINE, with a STYLE section containing 'COLOR
> [palette]' (palette being a field in the database query). Initially, I
> thought I was creating the images my colleagues needed, but it seems that
> the anti-aliasing causes some pixels to have colors other than the one I
> specified; this prevents us from identifying the road segments.
>
>
>
> We can live without anti-aliasing, but I was unable to turn it off; I
> tried both the AGG/PNG and GD/PNG drivers and messed with various
> FORMATOPTION identifiers, but nothing seemed to make any difference.
>
>
>
> Any suggestions?
>
>
>
> Thanks.
>
>
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-16 Thread Lime, Steve D (MNIT)
So you really do need 24-bit output. I was looking back through the mailing 
list archives and it was mentioned back in 2012 that aliased output could be 
implemented for simple (1 pixel-wide) lines and polygons – so there is hope but 
I don’t believe (looking through the source) that Thomas ever fully implemented 
it. In mapagg.cpp there are ifdef’s for a symbol named AGG_ALIASED_ENABLED 
which makes me wonder if work was started. I tried setting that in mapagg.cpp 
but ran into compile errors and didn’t try and track those down.

Of course you’d have to live with 1 pixel wide lines…

Steve

From: Erik H [mailto:erik.h11...@gmail.com]
Sent: Monday, October 16, 2017 1:15 PM
To: Lime, Steve D (MNIT) <steve.l...@state.mn.us>
Cc: mapserver-users@lists.osgeo.org
Subject: Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

Thanks for your reply, but I should have mentioned that I have a LOT of 
different colors to be displayed, almost a million...

I should also have mentioned that I've already tried to filter out the 
anti-aliased pixels by setting all alpha bytes to 255 and then assuming that 
all pixels that don't have alpha=255 in the PNG can be removed, but that 
assumption seems to be wrong.

On Mon, Oct 16, 2017 at 2:00 PM, Lime, Steve D (MNIT) 
<steve.l...@state.mn.us<mailto:steve.l...@state.mn.us>> wrote:
Hmmm… I wonder if you just could use a pre-computed palette to control 
quantizing to 8 bits. You can supply a palette file (RGB or RGBA) and the 
MapServer will map 24/32-bit values to those in the palette. Format options are:

 FORMATOPTION "PALETTE_FORCE=TRUE"
FORMATOPTION "PALETTE=palette.txt"

This will definitely limit the colors in your output image to those you 
specify. The question is whether or not the anti-aliased colors will map to the 
right color and that will depend on your palette. I did write a simple test 
with a 5 color palette (black, white, red, green and blue) and it seems to work 
ok but that’s a very simple palette… Based on your application it might work 
though.


-  
http://maps1.dnr.state.mn.us/cgi-bin/mapserv70?map=/usr/local/mapserver/apps/test/palette/test.map=map
 (24-bit)

-  
http://maps1.dnr.state.mn.us/cgi-bin/mapserv70?map=/usr/local/mapserver/apps/test/palette/test.map=map=png8
 (8-bit w/5 colors)

Steve

From: mapserver-users 
[mailto:mapserver-users-boun...@lists.osgeo.org<mailto:mapserver-users-boun...@lists.osgeo.org>]
 On Behalf Of Erik H
Sent: Monday, October 16, 2017 10:58 AM
To: mapserver-users@lists.osgeo.org<mailto:mapserver-users@lists.osgeo.org>
Subject: [mapserver-users] Draw roads WITHOUT anti-aliasing

I'm running a tiling server that uses MapServer 7.0.4 to generate PNGs.

My colleagues came up with an ingenious idea to animate traffic conditions that 
would require them to identify road segments based on their color. They asked 
me to generate tiles with a predetermined RGBA value per road segment.

I configured a layer of type LINE, with a STYLE section containing 'COLOR 
[palette]' (palette being a field in the database query). Initially, I thought 
I was creating the images my colleagues needed, but it seems that the 
anti-aliasing causes some pixels to have colors other than the one I specified; 
this prevents us from identifying the road segments.

We can live without anti-aliasing, but I was unable to turn it off; I tried 
both the AGG/PNG and GD/PNG drivers and messed with various FORMATOPTION 
identifiers, but nothing seemed to make any difference.

Any suggestions?

Thanks.

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-16 Thread Erik H
Thanks for your reply, but I should have mentioned that I have a LOT of
different colors to be displayed, almost a million...

I should also have mentioned that I've already tried to filter out the
anti-aliased pixels by setting all alpha bytes to 255 and then assuming
that all pixels that don't have alpha=255 in the PNG can be removed, but
that assumption seems to be wrong.

On Mon, Oct 16, 2017 at 2:00 PM, Lime, Steve D (MNIT) <
steve.l...@state.mn.us> wrote:

> Hmmm… I wonder if you just could use a pre-computed palette to control
> quantizing to 8 bits. You can supply a palette file (RGB or RGBA) and the
> MapServer will map 24/32-bit values to those in the palette. Format options
> are:
>
>
>
>  FORMATOPTION "PALETTE_FORCE=TRUE"
>
> FORMATOPTION "PALETTE=palette.txt"
>
>
>
> This will definitely limit the colors in your output image to those you
> specify. The question is whether or not the anti-aliased colors will map to
> the right color and that will depend on your palette. I did write a simple
> test with a 5 color palette (black, white, red, green and blue) and it
> seems to work ok but that’s a very simple palette… Based on your
> application it might work though.
>
>
>
> -  http://maps1.dnr.state.mn.us/cgi-bin/mapserv70?map=/usr/
> local/mapserver/apps/test/palette/test.map=map (24-bit)
>
> -  http://maps1.dnr.state.mn.us/cgi-bin/mapserv70?map=/usr/
> local/mapserver/apps/test/palette/test.map=map=png8
> (8-bit w/5 colors)
>
>
>
> Steve
>
>
>
> *From:* mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] *On
> Behalf Of *Erik H
> *Sent:* Monday, October 16, 2017 10:58 AM
> *To:* mapserver-users@lists.osgeo.org
> *Subject:* [mapserver-users] Draw roads WITHOUT anti-aliasing
>
>
>
> I'm running a tiling server that uses MapServer 7.0.4 to generate PNGs.
>
>
>
> My colleagues came up with an ingenious idea to animate traffic conditions
> that would require them to identify road segments based on their color.
> They asked me to generate tiles with a predetermined RGBA value per road
> segment.
>
>
>
> I configured a layer of type LINE, with a STYLE section containing 'COLOR
> [palette]' (palette being a field in the database query). Initially, I
> thought I was creating the images my colleagues needed, but it seems that
> the anti-aliasing causes some pixels to have colors other than the one I
> specified; this prevents us from identifying the road segments.
>
>
>
> We can live without anti-aliasing, but I was unable to turn it off; I
> tried both the AGG/PNG and GD/PNG drivers and messed with various
> FORMATOPTION identifiers, but nothing seemed to make any difference.
>
>
>
> Any suggestions?
>
>
>
> Thanks.
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-16 Thread Lime, Steve D (MNIT)
Hmmm… I wonder if you just could use a pre-computed palette to control 
quantizing to 8 bits. You can supply a palette file (RGB or RGBA) and the 
MapServer will map 24/32-bit values to those in the palette. Format options are:

 FORMATOPTION "PALETTE_FORCE=TRUE"
FORMATOPTION "PALETTE=palette.txt"

This will definitely limit the colors in your output image to those you 
specify. The question is whether or not the anti-aliased colors will map to the 
right color and that will depend on your palette. I did write a simple test 
with a 5 color palette (black, white, red, green and blue) and it seems to work 
ok but that’s a very simple palette… Based on your application it might work 
though.


-  
http://maps1.dnr.state.mn.us/cgi-bin/mapserv70?map=/usr/local/mapserver/apps/test/palette/test.map=map
 (24-bit)

-  
http://maps1.dnr.state.mn.us/cgi-bin/mapserv70?map=/usr/local/mapserver/apps/test/palette/test.map=map=png8
 (8-bit w/5 colors)

Steve

From: mapserver-users [mailto:mapserver-users-boun...@lists.osgeo.org] On 
Behalf Of Erik H
Sent: Monday, October 16, 2017 10:58 AM
To: mapserver-users@lists.osgeo.org
Subject: [mapserver-users] Draw roads WITHOUT anti-aliasing

I'm running a tiling server that uses MapServer 7.0.4 to generate PNGs.

My colleagues came up with an ingenious idea to animate traffic conditions that 
would require them to identify road segments based on their color. They asked 
me to generate tiles with a predetermined RGBA value per road segment.

I configured a layer of type LINE, with a STYLE section containing 'COLOR 
[palette]' (palette being a field in the database query). Initially, I thought 
I was creating the images my colleagues needed, but it seems that the 
anti-aliasing causes some pixels to have colors other than the one I specified; 
this prevents us from identifying the road segments.

We can live without anti-aliasing, but I was unable to turn it off; I tried 
both the AGG/PNG and GD/PNG drivers and messed with various FORMATOPTION 
identifiers, but nothing seemed to make any difference.

Any suggestions?

Thanks.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] Draw roads WITHOUT anti-aliasing

2017-10-16 Thread Erik H
I'm running a tiling server that uses MapServer 7.0.4 to generate PNGs.

My colleagues came up with an ingenious idea to animate traffic conditions
that would require them to identify road segments based on their color.
They asked me to generate tiles with a predetermined RGBA value per road
segment.

I configured a layer of type LINE, with a STYLE section containing 'COLOR
[palette]' (palette being a field in the database query). Initially, I
thought I was creating the images my colleagues needed, but it seems that
the anti-aliasing causes some pixels to have colors other than the one I
specified; this prevents us from identifying the road segments.

We can live without anti-aliasing, but I was unable to turn it off; I tried
both the AGG/PNG and GD/PNG drivers and messed with various FORMATOPTION
identifiers, but nothing seemed to make any difference.

Any suggestions?

Thanks.
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users