[mapserver-users] anchor label positions

Schylberg Lars lars.schylberg at saabgroup.com
Wed Sep 11 23:52:45 PDT 2013


Hello,
I have read the following discussion below but have not found out if anything has happened since then.
http://lists.osgeo.org/pipermail/mapserver-users/2008-December/059123.html
http://lists.osgeo.org/pipermail/mapserver-users/2010-November/067312.html
I have shape files with anchor  point positions:
7 8 9
4 5 6
1 2 3
That corresponds:
ul uc ur
cl cc cr
ll lc lr
I wrote my mapfile as shown below.  Is there a more  simple and shorter way to express this today?
TJUST variable is the POSITION expressed as a integer between 1 and 9 in my shape files
If there is no way to do this, could I remap the shape file with ogr2ogr to add an extra column in the table with mapserver positions?
/Lars
LAYER
        NAME 'LAKESNAMES'
          TYPE POINT
        GROUP 'default'
        PROJECTION
            'init=epsg:32633'
        END
        STATUS ON
        SIZEUNITS PIXELS
        DATA 'sve1milj_32633/tx_riks'
        CLASSITEM KKOD
          CLASS
                   NAME "TextLake5"
                   EXPRESSION /87|86/
                   LABEL
                             EXPRESSION ([TJUST] = 7)
                             SIZE 8
                             FONT 'sc'
                             TYPE truetype
                             POSITION ul
                        ANGLE [TRIKT]
                             COLOR 0 0 0
                        TEXT '[TEXT]'
                   END
                   LABEL
                             EXPRESSION ([TJUST] = 8)
                             SIZE 8
                             FONT 'sc'
                             TYPE truetype
                             POSITION uc
                        ANGLE [TRIKT]
                             COLOR 0 0 0
                        TEXT "[TEXT]"
                   END
                   LABEL
                             EXPRESSION ([TJUST] = 9)
                             SIZE 8
                             FONT 'sc'
                             TYPE truetype
                             POSITION ur
                        ANGLE [TRIKT]
                             COLOR 0 0 0
                        TEXT "[TEXT]"
                   END
                   LABEL
                             EXPRESSION ([TJUST] = 4)
                             SIZE 8
                             FONT 'sc'
                             TYPE truetype
                             POSITION cl
                        ANGLE [TRIKT]
                             COLOR 0 0 0
                        TEXT "[TEXT]"
                   END
                   LABEL
                             EXPRESSION ([TJUST] = 5)
                             SIZE 8
                             FONT 'sc'
                             TYPE truetype
                             POSITION cc
                        ANGLE [TRIKT]
                             COLOR 0 0 0
                        TEXT "[TEXT]"
                   END
                   LABEL
                             EXPRESSION ([TJUST] = 6)

... and 5 more expressions in the same way.






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


More information about the MapServer-users mailing list