[Mapserver-users] Problem with colours when displaying a GEOTiff image along with vector layers

Covariance Covariance at shaw.ca
Tue Oct 14 20:27:30 PDT 2003


This is a multi-part message in MIME format.

------=_NextPart_000_0012_01C392A2.5B99F700
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Ed:
	thank you very much, it worked like a charm. I wonder why this
problem only started in this latest version of the MapServer? - just
curious.

	Bob Bruce

-----Original Message-----
From: Ed McNierney [mailto:ed at topozone.com]
Sent: Tuesday, October 14, 2003 9:52 PM
To: Covariance at shaw.ca; Mapserver Users Mailing List
Subject: RE: [Mapserver-users] Problem with colours when displaying a
GEOTiff image along with vector layers


Bob -

This normally occurs because the relevant portion of the monochrome TIFF
input uses all available colors in the output image palette.  That is,
since the layers are drawn in order, and colors are allocated in order,
if the monochrome raster image uses 256 distinct shades of gray, then
there will be no colors left (in an 8-bit output image) and the vector
layers will use whatever shade of gray most closely matches the
requested color (which usually isn't very close).

Since you're using GDAL for input, you can add the statement

	PROCESSING "COLOR_MATCH_THRESHOLD=3"

to the raster image layer.  This will tell GDAL that when an input pixel
of a new color is encountered, if the RGB distance between it and an
existing color is 3 or less (that is, delta R + delta G + delta B <= 3)
then consider the existing color to be a match and use it.  This will
reduce the number of shades of gray used by the raster image to somewhat
less than 256, leaving you with enough room to allocate the intended
colors for the vector data.

	- Ed


Ed McNierney
President and Chief Mapmaker
TopoZone.com
ed at topozone.com


-----Original Message-----
From: Covariance [mailto:Covariance at shaw.ca] 
Sent: Tuesday, October 14, 2003 10:22 PM
To: 'Mapserver Users Mailing List'
Subject: [Mapserver-users] Problem with colours when displaying a
GEOTiff image along with vector layers

I recently downloaded and installed version 4.0 for WIN32 and started
going
through my example files that I had implemented with version 3.5 on
another
computer. Everything was going fine and I was able to display all of my
examples OK until I hit one that had a GEOTiff file, then the colours on
the
vector layer suddenly became monochrome along with the GEOTiff image. If
I
turn off the raster layer then the colours appear fine.

Help on getting the vector colours back along with displaying the raster
layer would be much appreciated.

thanks,
		Bob Bruce

The listing of the MapServer version is:

C:\Program Files\Apache Group\Apache2\cgi-bin>MAPSERV.EXE -v
MapServer version 4.0 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PDF OUTPUT=SWF SUPPORTS=P
ROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT
SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIEN
T INPUT=EPPL7 INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

and the listing of the mapfile (with the raster layer commented out) is:

NAME T12R02E_s2ex2
EXTENT 620000 5537250 631000 5547350
SIZE 400 400
SHAPEPATH "c:/apache/htdocs/tileswwinnipeg"

# LAYER # Single ortho image display
#   NAME "6205531GeoTIFF"
#   DATA "orthodata/6205531G.tiff"
#   STATUS DEFAULT
#   TYPE RASTER
# # OFFSITE 0
# END

LAYER # DLS Polys
  NAME "DLSPolys"
  DATA "t12r02e/t12r02ev03_DLSPolygons"
  STATUS DEFAULT
  TYPE POLYGON
  CLASSITEM "PART"
  CLASS # Whole DLS Parcel
#   STATUS OFF
    NAME "WHOLE DLSPOLY"
    EXPRESSION ""
    COLOR 255 202 149
    OUTLINECOLOR 0 0 0
  END # end of Whole DLS Parcel class object
  CLASS # Part DLS Parcel
    NAME "PART DLSPOLY"
    EXPRESSION "PT"
    COLOR 255 164 72
    OUTLINECOLOR 0 0 0
  END # end of Part DLS Parcel class object
END # end of layer object

LAYER # Plan Parcel Layer
  NAME "Plan Parcels"
  DATA "t12r02e/t12r02ev03_LotPolygons"
  STATUS DEFAULT
  TYPE POLYGON

  CLASSITEM "PART"
  CLASS # Whole Plan Parcels
    NAME "Whole Plan Parcels"
    EXPRESSION ""
    COLOR 212 178 176
    OUTLINECOLOR 0 0 0
  END # end of Whole Plan Parcels class
  CLASS # Part Plan Parcels
    NAME "Part Plan Parcels"
    EXPRESSION "PT"
    COLOR 170 103 100
    OUTLINECOLOR 0 0 0
  END # end of Whole Plan Parcels class
END  # end of water features layer

END # end of map file

_______________________________________________
Mapserver-users mailing list
Mapserver-users at lists.gis.umn.edu
http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

------=_NextPart_000_0012_01C392A2.5B99F700
Content-Type: application/ms-tnef;
	name="winmail.dat"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
	filename="winmail.dat"

eJ8+Ih8DAQaQCAAEAAAAAAABAAEAAQeQBgAIAAAA5AQAAAAAAADoAAEIgAcAGAAAAElQTS5NaWNy
b3NvZnQgTWFpbC5Ob3RlADEIAQ2ABAACAAAAAgACAAEGgAMADgAAANMHCgAOABYAGwAAAAIAJQEB
A5AGAFgOAAAlAAAACwACAAEAAAALACMAAAAAAAMAJgAAAAAACwApAAAAAAADAC4AAAAAAAMANgAA
AAAAHgBwAAEAAABgAAAAW01hcHNlcnZlci11c2Vyc10gUHJvYmxlbSB3aXRoIGNvbG91cnMgd2hl
biBkaXNwbGF5aW5nIGEgR0VPVGlmZiBpbWFnZSBhbG9uZyB3aXRoIHZlY3RvciBsYXllcnMAAgFx
AAEAAAAWAAAAAcOSzEPAsuchWE6gRf2k6j0m03k6tgAAAgEdDAEAAAAYAAAAU01UUDpDT1ZBUklB
TkNFQFNIQVcuQ0EACwABDgAAAABAAAYOABqfMcySwwECAQoOAQAAABgAAAAAAAAAYFJcLJdu7UGr
E9KZNFj7RYKBAAADABQOAQAAAAsAHw4BAAAAAgEJEAEAAAAeCgAAGgoAAIAUAABMWkZ1UQ+6IQMA
CgByY3BnMTI14jIDQ3RleAVBAQMB9/8KgAKkA+QHEwKAD/MAUARWPwhVB7IRJQ5RAwECAGNo4QrA
c2V0MgYABsMRJfYzBEYTtzASLBEzCO8J97Y7GB8OMDURIgxgYwBQMwsJAWQzNhZQC6YgRZxkOgqi
CoEBkSB0E+CQbmsgeQhgIHYEkAh5IG0a0GgsIGkVBUB3BbBrCYAgbGkRH4AgYSAT0m0uINpJH0Fu
BIEfQGgeoB3QGw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ElO
VEhJU0xBVEVTVFZFUlNJT05PRlRIRU1BUFNFUgAAAAB/xQ==

------=_NextPart_000_0012_01C392A2.5B99F700--




More information about the MapServer-users mailing list