[Mapserver-users] Mapfile problem - polygon layer and labels

Mike Reilly mikereilly_7 at hotmail.com
Sat Mar 6 22:15:29 EST 2004


Hi:

I've got a work around for the problem I'm having right now, however, it 
causes me to use two layers where I feel one would be more than adequate.  I 
have a polygon layer called mergeplys, and in one layer declaration I only 
want to display the layers that contain "food harvest" in the "USE1" field.  
To this end, I built the following layers:

  LAYER # TUS polygon layer begins here
    NAME         tusfoodharvest
    DATA         "mergeplys"
    STATUS       ON
    TYPE         POLYGON
    TOLERANCE 3
    PROJECTION
#      "init=epsg:4326"
    END
    CLASSITEM "USE1"
    CLASS
      EXPRESSION   "food harvest"
      TEMPLATE	   "templates/land_query.html"
      COLOR        100 255 100
      OUTLINECOLOR 0 255 0
#      LABEL
#        COLOR 0 0 0
#	TYPE TRUETYPE
#	FONT arial
#	SIZE 12
#       POSITION CC
#        PARTIALS FALSE
#        BUFFER 2
#      END
    END
  END # TUS polygon layer ends her

  LAYER
    NAME	tusfoodharvest
    DATA	"mergeplys"
    STATUS      ON
    MAXSCALE	5000000000
    TYPE	ANNOTATION
    LABELITEM	"USE1"
    CLASSITEM	"USE1"
    LABELMAXSCALE 500000000
    CLASS
      EXPRESSION "food harvest"
      COLOR	0 0 0
      LABEL
        COLOR 0 0 0
	TYPE TRUETYPE
	FONT arial
	SIZE 12
        POSITION CC
        PARTIALS FALSE
        BUFFER 2
      END
    END
  END

The first layer displays the polygon layer and the second one adds the label 
to the polygon.  I would like to be able to combine these two into a single 
layer.  My attempt at this is commented out in the POLYGON layer above.  
What am I missing here?

On a separate note, I am creating a separate LAYER for each EXPRESSION.  Is 
there a more efficient way to do this?  My .map file is getting very large, 
and I suspect there's got to be a better way, however, I haven't devised one 
as yet.

TIA,
Mike Reilly

_________________________________________________________________
MSN Premium includes powerful parental controls and get 2 months FREE*   
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines




More information about the mapserver-users mailing list