[mapserver-dev] Using area expression in label text

Tamas Szekeres szekerest at gmail.com
Thu Jul 9 13:21:17 PDT 2020


Hi Devs,

I wanted to add label text to a layer to display the computed area value in
the label. Tried using this expression:

TEXT (area([shape]))

but that calculates the area in pixel space which is useless for the
purpose. I've also tried to utilize [map_cellsize] in the expression to
convert the area to map units, but [map_cellsize] always returns 0 in this
use case.

Can anyone explain how to use area in the text expression to get correct
result?

Thanks,

Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20200709/082bc435/attachment.html>


More information about the mapserver-dev mailing list