[mapserver-users] Fwd: MapServer 7 arithmetic expressions do not work on STYLE attributes?
Andi p3 Domi
p3rand0r at gmail.com
Thu Jun 16 02:04:36 PDT 2022
I am trying to port my code from MapServer 5 (Oracle) to MapServer 7
(PostgreSQL), but I am encountering an issue when trying to apply
arithmetic expressions in the style class. So previously in MapServer 5 I
would have something like:
DATA "geom from (select pk, geom, size from sizes_of_thing) USING srid
3788 version 11g"
CLASS
MAXSCALEDENOM 5001
STYLE
COLOR [size*2]
Which worked perfectly fine: But if I convert it to MapServer 7 and
PostgreSQL like:
DATA "geom from (select pk, geom, size from sizes_of_thing sot) USING
unique pk USING srid=3788"
CLASS
STYLE
COLOR [size*2]
Throws an error such as:
msPostGISLayerWhichShapes(): Error (ERROR: column "size*2" does not exist
By any chance are these expressions not supported anymore in MapServer
7/PostGIS or am I doing something wrong?
What I have tried so far is to write something like
SIZE [size]*2
SIZE ([size]*2)
create an expression like:
EXPRESSION ("size2" "[size]*2")
And use it in something like:
SIZE [size2]
create a validation variable such as:
VALIDATION
"size2" '[size]*2'
and then
SIZE [size2]
But it seems like none of them work.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20220616/7a5b4277/attachment.htm>
More information about the MapServer-users
mailing list