[mapserver-users] numeric label without decimal ? [SEC=UNCLASSIFIED]

Kathleen Hirst K.Hirst at bom.gov.au
Sun Jun 6 16:37:37 PDT 2010


Hi Tonton and Carlos,

You can use an OGR connection to remove decimal points for labelling. I think you need GDAL 1.6 or later.

For example with a shapefile called test.shp with a field, testfld1, you can do the following

LAYER
   ..
   CONNECTIONTYPE OGR
   CONNECTION "test.shp"
   DATA "select CAST(testfld1 AS INTEGER (4)) from test"
   ..
   CLASS
       ...
       TEXT ([testfld1)]
       LABEL
        ..
       END
   END
END

Regards,

Kathleen

________________________________
From: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Carlos Ruiz
Sent: Saturday, 5 June 2010 1:05 AM
To: Tonton; mapserver-users at lists.osgeo.org
Subject: Re: [mapserver-users] numeric label without decimal ?

Tonton,

This is because de data domain, there's no way to apply a format with the LABEL tag, you have to change the
data domain from the data source directly

IC Carlos Ruiz

________________________________
From: Tonton <to.tonton at gmail.com>
To: mapserver-users at lists.osgeo.org
Sent: Fri, June 4, 2010 8:05:30 AM
Subject: [mapserver-users] numeric label without decimal ?

hello

i use shapefile  to render a map in wms layer.
it is working good but ...

the  column i use TXT  have number  ( 12 30 255 etc...)

so i see with 10 digits after the point ( 12.00000000  30.000000000 255.000000000 etc...)

if anybody know how to set that my label was text or integer and not decimal ? i haven't found it in mapserver documentation

Tonton

next the layer

LAYER
        NAME "LabelParcelle.shp"
        DATA "LabelParcelle.shp"
        TYPE POINT
        DEBUG 5
        DUMP TRUE
        LABELCACHE ON
        METADATA
        WMS_TITLE "LabelParcelle.shp"
        "WMS_SRS" "EPSG:27572"

        WFS_TITLE "LabelParcelle.shp"
        "WFS_SRS" "EPSG:27572"
        END
        LABELITEM TXT
CLASS
NAME "LabelParcelle.shp"
        STYLE
        SYMBOL 7
        SIZE 2
        OUTLINECOLOR 0 0 0
        COLOR 0 0 0
        END
        LABEL
        TYPE BITMAP
        POSITION AUTO
        SIZE MEDIUM
        COLOR 0 0 0
        End #LABEL
        END
END #Layer


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100607/a09156a6/attachment.htm>


More information about the MapServer-users mailing list