Opened 18 years ago

Closed 8 years ago

#60 closed enhancement (fixed)

Label formatting

Reported by: assefa Owned by: assefa
Priority: high Milestone: FUTURE
Component: MapServer C Library Version: 4.1
Severity: minor Keywords:
Cc: stephan.holl@…, jmckenna, dmorissette, sdlime

Description (last modified by dmorissette)

There was a request from a client to be able to format the output of his labels 
:
 For example the dbf file contains something like 1000.000 and he would like to 
display this value like an integer (1000).

 I should discuss this with Steve before going ahead. AY

Change History (9)

comment:1 Changed 16 years ago by dmorissette

Cc: steve.lime@… added
Version: 3.54.1
Maybe in 4.1?

comment:2 Changed 11 years ago by assefa

Milestone: FUTURE

comment:3 Changed 10 years ago by sholl

Cc: stephan.holl@… added

Since this ticket is quite old I am also interested in this feature and willing to test patches if available. In discussion with Steve he told me that this issue will be adressed in 6.0.

comment:4 Changed 9 years ago by jmckenna

Cc: jmckenna added

comment:5 Changed 9 years ago by dmorissette

Cc: dmorissette sdlime added
Description: modified (diff)

If we want this to happen we should talk about the way to specify the format string.

Adding Steve to CC to get his input. There is some basic format support in maptemplate.c for query result field values, but it seems quite limited. I wonder if we could use the same or if we would be better use a print-like format string.

comment:6 Changed 9 years ago by jmckenna

Some background: the dataset to be used in the FOSS4G2010 WMS benchmarking exercise has a label field with precision of 15. It would be really nice if we could tackle this ticket, as a showcase of the features added through the benchmarking exercise.

I can help through giving opinions, testing, and documenting.

comment:7 Changed 9 years ago by sdlime

I'm planning on tackling this through the extensions to the bison parser so that you could run text through formatting functions like so:

TEXT (commify(precision([area], 2)) + "sq mi")

or whatever.

Steve

comment:8 Changed 9 years ago by dmorissette

See also ticket #2950

comment:9 Changed 8 years ago by dmorissette

Resolution: fixed
Status: newclosed

Implemented in RFC 64 (MapServer 6.0), see also ticket #2950.

The syntax is something like:

      TEXT ("[area]")

      TEXT (tostring([area],"%.2f"))

      TEXT ("Area is: " + tostring([area],"%.2f"))
Note: See TracTickets for help on using tickets.