[mapserver-users] Labeling

Steve Lime Steve.Lime at dnr.state.mn.us
Thu Mar 26 09:46:05 PDT 2009


The decimal truncation simply can't be done with a shapefile at the moment. There's a ticket in place
to add this functionality but it will be a 6.0 improvement. Wish I have better news.

One the other question you can use the class TEXT property along with a wrap character to achieve
the multiline labels. E.g.:

CLASS
  ...
  TEXT "[col1]|[col2]|[col3]"
  LABEL
    ...
    WRAP "|"
  END
END

and that should get you a multi-line label based on 3 attributes.

Steve

>>> On 3/26/2009 at 10:57 AM, in message
<D7A5EAC385604446AB1DD24BF4F5A9181E06947F21 at MG-Mail.ci.maple-grove.mn.us>, Jay
Kapalczynski <jkapalczynski at ci.maple-grove.mn.us> wrote:
> Yea I can do that but then I have to build processes to do all the 
> converting...
> I want to read this data live.
> 
> Anyone else have any ideas?
> 
> Thanks
> 
> One Last thought, don't know if I should enter a new topic...
> 
> I have three labels I want to label.  Right now I am using an Offset to push 
> one above, and one below (UC, CC, LC) with offsets.
> And as such these are three separate layers in my app
> I tried to combine all three into one map file but it only labels the first 
> one (I copied the original code in the original email and simply changed the 
> label field)(no matter what I do it just labels the first one it reads)
> 
> Can I combine these into one and still have them label on three different 
> rows
> 
> Value 1
> Value 2
> Value 3
> 
> Can I concatenate like this?
> 
> LABELITEM  'Value 1' & 'VALUE 2' & 'VALUE 3'
> 
> But how would I specify they are supposed to create 3 lines???
> 
> THANKS
> 
> 
> From: Fawcett, David [mailto:David.Fawcett at state.mn.us] 
> Sent: Thursday, March 26, 2009 9:38 AM
> To: Jay Kapalczynski; mapserver-users at lists.osgeo.org 
> Subject: RE: [mapserver-users] Labeling
> 
> It is always an option to create a string column and then populate it with 
> your numbers formatted the way that you want them to appear.  I am sure that 
> you realize this, but it is something that I have done in the past.
> 
> David.
> -----Original Message-----
> From: mapserver-users-bounces at lists.osgeo.org 
> [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Jay 
> Kapalczynski
> Sent: Thursday, March 26, 2009 9:14 AM
> To: 'mapserver-users at lists.osgeo.org'
> Subject: [mapserver-users] Labeling
> 
> Is there any way to eliminate the decimal places here...I looked online but 
> was unable to find anything.
> 
> Thanks
> 
> The fields I am labeling are numeric...so I get this
> 
> 3434.000000000000
> 1232222.000000000000
> 
> I am looking to drop all the extra decimal places...
> 
> Or maybe set it to keep two
> 
> 3434.00
> 
> THANKS
> 
> 
> 
> LAYER # Maple Grove Parcels
>                     NAME Parcel_Labels
>                     DATA './parcels.shp'
>                     STATUS DEFAULT
>                     TYPE annotation
>                     MAXSCALE 2000
>                     MINSCALE 100
>                     LABELITEM 'EMV_LAND'
> 
> 
>                                 LABELCACHE ON
>                      CLASS
>                        COLOR -1 -1 -1
>                        LABEL
>                                 POSITION UC
>                                 TYPE TRUETYPE
>                                 FONT vera_sans
>                                 MAXSIZE 7
>                                 SIZE 7
>                                 OFFSET 0 10
>                                 MINSIZE 4
>                                 #ANTIALIAS TRUE
>                                 COLOR 0 0 0
>                                 OUTLINECOLOR 255 255 128
>                                 BUFFER 2
>                        END
>                      END
>   END # Maple Grove Parcels




More information about the MapServer-users mailing list