[Mapserver-users] Problem with background color ://: Symbology

Stéphane RIFF stephane.riff at cerene.fr
Wed Mar 24 03:49:07 EST 2004


First i have a problem with background color of map....
   the problem is when i turn off a specific layer (here : 
'Numero_Departements', see .map file below), background color of map is 
changed and it restore the good color when i turn back on this layer
Does anybody already saw this ???

The second question is about symbology...
   I want to set a symbology on a layer but i can't figure how to do it :
                          One layer with 3 classes based on one field 
'product' which can be 'GPS', 'MEASURE','FIXED'. This select the symbol 
for each class  .... here
                   no problems
                           Now i want to set the color of symbols based 
on another field 'state' which can be 'DONE','CLOSED','TOBEDONE'. This 
can be done by a layer                     with 3*3 class with each 
class with an expression like : [product] = 'GPS' AND [state] = 'DONE' . 
But i would keep my layer with only 3 class is it
                    possible ???

Here is my .map file for the first problem :

#
# Start of map file
#
NAME CRN
STATUS ON
SIZE 600 600
EXTENT 47673.624 1616618.5 1197873.624 2677218.5
UNITS METERS
SHAPEPATH "../data"
IMAGECOLOR 80 80 80
TRANSPARENT OFF
SYMBOLSET "../symbols/symbols.sym"
FONTSET "../fonts/font.list"

IMAGETYPE PNG


#
# Start of web interface definition
#
WEB
  MINSCALE 5000
  MAXSCALE 100000000
  IMAGEPATH "/var/mapserver/www/tmp/"
  IMAGEURL "/tmp/"
  #ERROR "/mapServ/error.html"
  METADATA
    WMS_SRS "EPSG:27582"
  END
END

QUERYMAP
  SIZE -1 -1
  STATUS ON
  STYLE HILITE
  COLOR 255 255 0
END


#
# Start of reference map
#
REFERENCE
  STATUS ON
  EXTENT -2646.55843466 1564942.61318 1257407.47103 2722306.80918
  IMAGE ../img/nrefmap.png
  SIZE 115 106
  OUTLINECOLOR 0 0 255
  COLOR -1 -1 -1
END
#
# Start of legend
#
LEGEND
  STATUS ON
  KEYSIZE 18 12
END

#
# Start of scalebar
#
SCALEBAR
  IMAGECOLOR 80 80 80
  LABEL
    COLOR 255 255 255
    SIZE tiny
  END
  STYLE 1
  SIZE 600 2
  COLOR 255 255 255
  UNITS KILOMETERS
  INTERVALS 6
  TRANSPARENT FALSE
  STATUS ON
END

#
# Start of layer definitions
#

LAYER
  NAME "250000"
  TILEINDEX "250000"
  TILEITEM "LOCATION"
  TYPE RASTER
  STATUS OFF
  OFFSITE 0
  MAXSCALE 500000
  GROUP "Images"
  CLASS
    NAME "Fond Raster 250000"
  END
  METADATA
    LYRNAME "250000"
    WMS_SRS  "EPSG:27582"
    QUERYING_FILEDS ""
    WMS_ORDER "0"
  END
END

LAYER
  CONNECTIONTYPE postgis
  NAME "Contour_France"
  CONNECTION "host=localhost dbname=mapserver port=5432 user=nobody"
  DATA "the_geom from giscontourfrance"
  TYPE LINE
  STATUS ON
  GROUP "Contour"
  HEADER blank.html
  FOOTER blank.html
  CLASS
    NAME "Contour_France"
    SYMBOL "dashline"
    COLOR 0 153 255
    SIZE 3
  END

  METADATA
    LYRNAME "France"
    TABLE_NAME "giscontourfrance"
    RESULT_FIELDS ""
    QUERYABLE_FIELDS ""
    WMS_SRS  "EPSG:27582"
    WMS_ORDER "1"
  END

END

LAYER
  CONNECTIONTYPE postgis
  NAME "Contour_Departements"
  CONNECTION "host=localhost dbname=mapserver port=5432 user=nobody"
  DATA "the_geom from giscontourdepartement"
  TYPE LINE
  STATUS ON
  MAXSCALE 100000000
  MINSCALE 450000
  GROUP "Contour"
  HEADER blank.html
  FOOTER blank.html
  CLASS
   NAME "Contour_Departements"
   COLOR 255 128 64
  END
  METADATA
   LYRNAME "Départements"
   TABLE_NAME "giscontourdepartement"
   RESULT_FIELDS ""
   QUERYABLE_FIELDS ""
   WMS_SRS  "EPSG:27582"
   WMS_ORDER "2"
  END
END

LAYER
  CONNECTIONTYPE postgis
  CONNECTION "host=localhost dbname=mapserver port=5432 user=nobody"
  DATA "the_geom from giscontourcommune"
  NAME "Contour_Communes"
  TYPE POLYGON
  STATUS ON
    MINSCALE 5000
  MAXSCALE 450000
  GROUP "Contour"
  HEADER "blank.html"
  FOOTER "blank.html"
  LABELITEM "nom_comm"
  CLASS
    NAME "Contour_Communes"
    OUTLINECOLOR 250 194 5
    SIZE 4
    SYMBOL "dashline"
    LABEL
     TYPE TRUETYPE
     FONT "Arialbd"
     buffer 1
     outlinecolor 255 255 255
     COLOR 0 0 255
     POSITION CC
     SIZE 10
    END
  END

  METADATA
    LYRNAME "Communes"
    TABLE_NAME "giscontourcommune"
    RESULT_FIELDS ""
    QUERYABLE_FIELDS ""
    WMS_SRS  "EPSG:27582"
    WMS_ORDER "3"
  END
END


LAYER
  CONNECTIONTYPE postgis
  CONNECTION "host=localhost dbname=mapserver port=5432 user=nobody"
  DATA "the_geom from gistxtdepartement"
  NAME "Numero_Departements"
  TYPE POINT
  STATUS ON
  MAXSCALE 100000000
  MINSCALE 450000
  GROUP "Texte"
  LABELITEM "textstring"
  HEADER blank.html
  FOOTER blank.html
  CLASS
    NAME "Numero_Departements"
    COLOR 244 190 80
    SIZE 8
    SYMBOL "point1"
    LABEL
      TYPE TRUETYPE
      FONT "Arialbd"
      BUFFER 1
      outlinecolor 255 255 0
      COLOR 255 0 0
      POSITION CC
      SIZE 8
      PARTIALS TRUE
      FORCE TRUE
    END
  END
 METADATA
    LYRNAME "N° de Départements"
    TABLE_NAME "gistxtdepartement"
    RESULT_FIELDS ""
    QUERYABLE_FIELDS ""
    WMS_SRS "EPSG:27582"
    WMS_ORDER "5"
  END
END



END # Map File




More information about the mapserver-users mailing list