<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div style="font-size:small">
<div>
                
<p>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:</p>
<pre><code>DATA "geom from (select pk, geom, size from sizes_of_thing) USING srid 3788 version 11g"
CLASS
    MAXSCALEDENOM <span>5001</span>
    STYLE
        COLOR [size<span>*</span><span>2</span>]
</code></pre>
<p>Which worked perfectly fine:
But if I convert it to MapServer 7 and PostgreSQL like:</p>
<pre><code>DATA "geom from (select pk, geom, size from sizes_of_thing sot) USING unique pk USING srid=3788"
CLASS
    STYLE
        COLOR [size<span>*</span><span>2</span>]
</code></pre>
<p>Throws an error such as:</p>
<pre><code>msPostGISLayerWhichShapes(): Error (ERROR:  <span>column</span> "size*2" does <span>not</span> exist
</code></pre>
<p>By any chance are these expressions not supported anymore in MapServer 7/PostGIS or am I doing something wrong?</p>
<p>What I have tried so far is to write something like</p>
<pre><code>SIZE [size]<span>*</span><span>2</span>
SIZE ([size]<span>*</span><span>2</span>)
</code></pre>
<p>create an expression like:</p>
<pre><code>EXPRESSION ("size2" "[size]*2")
</code></pre>
<p>And use it in something like:</p>
<pre><code>SIZE [size2]
</code></pre>
<p>create a validation variable such as:</p>
<pre><code>VALIDATION
"size2" <span>'[size]*2'</span>
</code></pre>
<p>and then</p>
<pre><code>SIZE [size2]
</code></pre>
<p>But it seems like none of them work.</p>
    </div><br></div></div>
</div></div>