[Mapserver-users] Raster geotiff turns background yellow (now turns vectors gray)

Steve Lime steve.lime at dnr.state.mn.us
Tue Feb 4 09:18:00 PST 2003


Are you using 24-bit output? The reason vector layers would turn grey is
that (with 8-bit output) the map's color
palette is probably full with greyscale colors. If there is no room for
another color the software tries to find
the closest match. If everything allocated previously is shades of grey
and you try to draw something in red you're
gonna get funky output. Older versions of MapServer avoided this by
pre-allocating colors used by vector
layers prior to drawing any raster data. 

You have 2 options:

  - use a 24-bit output format
  - condense the number of colors in your orthophotography

You should be able to get by with 64, 32 or 16 levels of grey for most
applications. The human eye has trouble with
differentiating grey levels, more so than with colors. You'd need a
common palette across images. There are other
benefits to doing that. A big one would be greatly reducing file size.

Steve

Stephen Lime
Data & Applications Manager

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

>>> randy james <rjames57 at yahoo.com> 01/30/03 12:17PM >>>
Hi

Well I've recompiled with GD-2.0.11 and the
orthophotos still turn all the vector layers gray if
they are loaded before the vectors.

Seems like I am the only one experiencing this problem
with raster layers?

I'll attach a couple of files from the tmp dir for
your info.

Cheers
Randy

--- Dylan Keon <keon at nacse.org> wrote:
> Randy, what versions of GD and GDAL are you using? 
> I believe there are 
> issues with vector layers and the use of GD < 2.0.11
> with MS 3.7.  Since 
> you're using MS 3.7 you should probably also be
> using GD 2.0.11 and GDAL 
> 1.1.8.
> 
> Yes, both tiled and single raster layers can be made
> transparent.  There 
> are also new ways to handle transparency and image
> output in 3.7, via 
> use of the OUTPUTFORMAT object.  Take a look at 
>
http://mapserver.gis.umn.edu/cgi-bin/wiki.pl?MigrationGuide 
> for more info.
> 
> 
> 
> randy james wrote:
> > Hi
> > 
> > To answer my own question: Rasters can be made
> > transparent using the TRANSPARENCY (0-100) tag.
> > 
> > I have tried with a raster layer loaded through
> > tileindex, but not with loading a raster the
> normal
> > way yet.
> > 
> > But i would hope that at some point i will be able
> to
> > load the orthophotos under the vectors without
> been
> > transparent, rather than on top of the vectors and
> > transparent.
> > 
> > 
> > --- randy james <rjames57 at yahoo.com> wrote:
> > 
> >>Hi
> >>
> >>Upgrading to 3.7 solved the problem of the tiff
> >>image
> >>turning the background yellow, but caused another
> >>problem:
> >>
> >>Any vector layer that is loaded on top if the tiff
> >>image now turns gray. When i load the vectors
> after
> >>the tiff nothing changes color at least, but i
> >>cannot
> >>see the vector layers.
> >>
> >>Can Raster layers be transparent?
> >>
> >>Cheers 
> >>Randy
> >>
> >>
> >>--- Frank Warmerdam <warmerdam at pobox.com> wrote:
> >>
> >>>randy james wrote:
> >>>
> >>>>Hi
> >>>>--- Ed McNierney <ed at topozone.com> wrote:
> >>>>
> >>>>
> >>>>>Randy -
> >>>>>
> >>>>>Can you describe exactly what you did
> >>>>
> >>differently
> >>
> >>>>>between those two images?
> >>>>>
> >>>>
> >>>>Well the difference is: 
> >>>>the tif that does not work has: a 256 RGB,
> >>>>colorinterp=palette, is projected on the fly,
> >>>
> >>and
> >>
> >>>is a
> >>>
> >>>>newer version of an orthophoto.
> >>>>I have used tiff2bw and gdal_translate to make
> >>>
> >>it
> >>
> >>>>grayscale, so i have a few versions of the file
> >>>
> >>>(5),
> >>>
> >>>>and all make the same error.
> >>>
> >>>Randy,
> >>>
> >>>I haven't been following this issue closely, but
> >>
> >>if
> >>
> >>>the problem occurs in
> >>>3.7 and if you can prepare a small test case that
> >>>demonstrates the problem
> >>>just using "shp2img" then please file it in
> >>
> >>bugzilla
> >>
> >>>(attaching the small
> >>>sample map file and data file(s)) and assign to
> >>
> >>me.
> >>
> >>>Best regards,
> >>>
> >>>-- 
> >>>
> >>
> >
>
---------------------------------------+--------------------------------------
> > 
> >>>I set the clouds in motion - turn up   | Frank
> >>>Warmerdam, warmerdam at pobox.com 
> >>>light and sound - activate the windows |
> >>>http://pobox.com/~warmerdam 
> >>>and watch the world go round - Rush    |
> >>
> >>Geospatial
> >>
> >>>Programmer for Rent
> >>>
> >>>
> >>
> >>
> >>__________________________________________________
> >>Do you Yahoo!?
> >>Yahoo! Mail Plus - Powerful. Affordable. Sign up
> >>now.
> >>http://mailplus.yahoo.com 
> >>_______________________________________________
> >>Mapserver-users mailing list
> >>Mapserver-users at lists.gis.umn.edu 
> >>
> > 
> >
>
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users 
> > 
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> > http://mailplus.yahoo.com 
> > _______________________________________________
> > Mapserver-users mailing list
> > Mapserver-users at lists.gis.umn.edu 
> >
>
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users 
> 
> -- 
> ************************************************
>   Dylan Keon
>   GIS/Database Research Specialist
>   Northwest Alliance for Computational
>   Science and Engineering (NACSE)
>   Oregon State University
>   Corvallis, OR 97331
>   keon at nacse.org        (541) 737-6608
> ************************************************
> 
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu 
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users 

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com



More information about the MapServer-users mailing list