MapServer Templates: Item tags to modify output data

You can add item tags to the [] in MapServer template files. Useful for tidying number fields, strings etc and coping with NULL fields

  • name: the name of the attribute to be exposed
  • format: a simple string containing the token(s) $value, default format is the result of any processing
  • nullformat: string to return if value is NULL or empty (length=0)
  • uc: convert string to upper case
  • lc: convert string to lower case
  • substr: perform a perl-like substring operation by providing offset, and optionally length (un-implemented as of 3/13/07)
  • commify: add commas to a numeric string (12345 would become 12,345), note, supports only North American notation at the moment
  • escape: what type of escaping to do (default is html), permissible values would be html, url, none
  • precision: number of decimals to retain after the decimal point
  • pattern: regular expression that must validate (against the column value) to process the tag

Example: [item name=SUM_MB_N precision=2]

http://mapserver.org/development/rfc/ms-rfc-9.html

Comments

Comments are closed on this post.
Find out more