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

Mike Reilly mikereilly_7 at hotmail.com
Sun Mar 7 16:27:35 EST 2004


Top posting a short thanks to Sean - thanks, man, I'm a lone wolf building 
this system with nobody but the list for feedback and your assistance here 
is greatly appreciated :)


>From: Sean Gillies <sgillies at frii.com>
>To: "Mike Reilly" <mikereilly_7 at hotmail.com>
>CC: mapserver-users at lists.gis.umn.edu
>Subject: Re: [Mapserver-users] Mapfile problem - polygon layer and labels
>Date: Sun, 7 Mar 2004 08:33:47 -0700
>
>On Mar 6, 2004, at 8:15 PM, Mike Reilly wrote:
>
>>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
>>
>
>Mike,
>
>I see right away that the first layer does not define a LABELITEM.  That
>may not be the _only_ problem, but you won't get a label without it.
>
>Instead of a separate LAYER for each expression, use another CLASS.
>
>    CLASS
>      EXPRESSION   "food harvest"
>      TEMPLATE	   "templates/land_query.html"
>      COLOR        100 255 100
>      OUTLINECOLOR 0 255 0
>      ...
>    END
>    CLASS
>      EXPRESSION   "other expression"
>      TEMPLATE	   "templates/land_query.html"
>      COLOR        200 55 200
>      OUTLINECOLOR 0 255 0
>      ...
>    END
>
>Hope this helps,
>Sean
>
>--
>Sean Gillies
>sgillies at frii dot com
>http://users.frii.com/sgillies
>
>_______________________________________________
>Mapserver-users mailing list
>Mapserver-users at lists.gis.umn.edu
>http://lists.gis.umn.edu/mailman/listinfo/mapserver-users

_________________________________________________________________
MSN Premium: Up to 11 personalized e-mail addresses and 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