[mapserver-dev] Using area expression in label text

Steve Lime sdlime at gmail.com
Wed Jul 15 13:13:43 PDT 2020


Sorry, been on vacation... Anyway, presumably you're not using a database
backend? If that's the case then I don't know that what you're trying to do
is possible. The shape, when made available to the labeling code, has
already been transformed (and I think clipped). I'm not sure why
[map_cellsize] resolves to 0 though since the value is well known at that
point in the processing. I don't recall who/when that support was added.

On Thu, Jul 9, 2020 at 3:21 PM Tamas Szekeres <szekerest at gmail.com> wrote:

> 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
>
> _______________________________________________
> mapserver-dev mailing list
> mapserver-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20200715/deb2fbf6/attachment.html>


More information about the mapserver-dev mailing list