[mapserver-users] Expression statement (FWD)

Stephen Woodbridge woodbri at swoodbridge.com
Mon Jan 14 16:59:45 EST 2002


Stephen,

CLASSITEM and EXPRESSION items are case sensitive. Column names in my
shape files are all uppercase (but then I never tried to make any that
were mixed case :)

So, you might want to check the case with dbfdump --info Gr_nhs.dbf if
you have the perl version of dbfdump installed. Otherwise you might try:

LAYER
        NAME Gr_nhs
        TYPE POLYGON
        STATUS DEFAULT
        DATA Gr_nhs
        CLASSITEM "GRID_CODE"

CLASS
        Name "Unknown"
        EXPRESSION ([GRID_CODE] eq -9999)
        COLOR 210 275 25
END
END
END # Map file

Hope this helps,
  -Steve
   http://swoodbridge.com
   http://web-maps.org

teb wrote:
> 
> ------------- Begin Forwarded Message -------------
> 
> X-Sender: geo402 at mailms.abdn.ac.uk
> Date: Mon, 14 Jan 2002 16:58:06 +0000
> To: mapserver-info at lists.gis.umn.edu
> From: "Stephen D. King" <s.d.king at abdn.ac.uk>
> Subject: Expression statement
> Mime-Version: 1.0
> X-Scanner: exiscan *16QAUW-0003fz-00*CIeUL4fe4fk*
> 
> Hi,
> 
> I am trying to get mapserver to display classes from one shapefile -
> without success - I just get a blank image. I can get it to display the
> shapefile without the class divisions.
> 
> The shapefile is called Gr_nhs.shp
> 
> It is divided up into 23 classes. Each class takes its value from the
> Grid_code attribute field. -9999 is unknown, the remaining values are from
> 1-22
> 
> In my map file, the layer definition is as follows:
> 
> LAYER
>         NAME Gr_nhs
>         TYPE POLYGON
>         STATUS DEFAULT
>         DATA Gr_nhs
>         CLASSITEM "Grid_code"
> 
> CLASS
>         Name "Unknown"
>         EXPRESSION ([Grid_code] eq -9999)
>         COLOR 210 275 25
> END
> END
> END # Map file
> 
> I have tried various combinations for the expression - can anyone help?
> 
> Thanks,
> 
> Stephen
> 
> ------------- End Forwarded Message -------------



More information about the mapserver-users mailing list