[mapserver-users] Label attribute bindings

deangadoury at subpixelmedia.com deangadoury at subpixelmedia.com
Thu Jun 5 08:44:51 EDT 2008


This is only a partial answer, but if you have a label angle as an attribute in your data you should be able to use LABELANGLEITEM. 

LABELANGLEITEM [attribute]
    Item name in attribute table to use for class annotation angles. Values should be in degrees.

Dean Gadoury

Subpixel Media
subpixelmedia.com

> -------- Original Message --------
> Subject: [mapserver-users] Label attribute bindings
> From: Tim Urwin <t.urwin at ed.ac.uk>
> Date: Thu, June 05, 2008 4:25 am
> To: mapserver-users at lists.osgeo.org
> 
> Hi all,
> 
> This is a questuion about label attribute bindings.
> 
> We are about to migrate some of our Ordnance Survey MasterMap data from 
> a propriety system to using mapserver serving the data from a PostGIS 
> database for screen maps. We are currently using Mapserver 5.02 and are 
> very happy with the results we have achieved so far, however, due to 
> only being able to set a single value for the position of a label has 
> caused much of the text to be badly misaligned with the underlying features.
> 
> OS has determined the best position for the label and provide this as 
> attribute data for each text label point and we would like to be able to 
> utilise it. Is there anyway to make the position label attribute accept 
> a binding as some of the other values do, e.g. angle which we also use. 
> The problem we have is that no single value works with the data to 
> provide a good map result, therefore we would like to be able to use 
> each feature's value as opposed to a global value.
> 
> Any help or insights in how to achieve this will be gratefully received. 
> At the moment our applications access Mapserver via CGI mode directly 
> without the use of mapscript although we could investigate that option.
> 
> The following is an example of one of the entries in the mapfile for a 
> label layer.
> 
> LAYER
> 
>    NAME "Heritage labels"
> 
>    METADATA
>       "wms_title" "Heritage labels"
>       "wms_srs"   "EPSG:27700"
>       "wms_extent"   "0.0 0.0 700000.0 1300000.0"
>    END
> 
>    STATUS OFF
> 
>    CONNECTIONTYPE postgis
>    CONNECTION "user=XXXX password=XXXX dbname=XXXX host=XXXX port=XXXX"
>    DATA '"anchorpoint" from "cartographictext" using unique "fid" using 
> SRID=27700'
> 
>    PROCESSING    "CLOSE_CONNECTION=DEFER"
> 
>    TYPE Annotation
> 
>    LABELITEM 'textstring'
> 
>    FILTER ("layer" = '59')
> 
>    CLASS
>       NAME 'Antiquity Text (82)'
>          LABEL
>            COLOR     0 0 0
>            OUTLINECOLOR 255 255 255
>            TYPE      TRUETYPE
>            FONT      arial-italic
>            SIZE      8
>            ANGLE  [angle]
>            ANTIALIAS TRUE
>            POSITION  CC
>            PARTIALS  TRUE
>            ENCODING 'UTF-8'
>          END
>    END
> 
>    MINSCALEDENOM 100.0
>    MAXSCALEDENOM 5500.0
> 
>    PROJECTION
>    "init=epsg:27700"
>    END
> END
> 
> 
> many thanks
> 
> Tim
> 
> -- 
> 
> Tim Urwin
> EDINA
> The University of Edinburgh
> Causewayside House
> 160 Causewayside
> Edinburgh EH9 1PR
> 
> tel:   +44 (0) 131 650 3310
> fax:   +44 (0) 131 650 3308
> email: t.urwin at ed.ac.uk
> 
> 
> The University of Edinburgh is a charitable body, registered in
> Scotland, with registration number SC005336.
> 
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users


More information about the mapserver-users mailing list