[mapserver-users] Label attribute bindings

Tim Urwin t.urwin at ed.ac.uk
Thu Jun 5 07:25:51 EDT 2008


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.



More information about the mapserver-users mailing list