You didn't say if you're doing this in old or new style templates, but 
regardless you'd need to do this in javascript. I can illustrate easiest with a 
new style template since it's all in one place but the idea applies to either:

<!-- MapServer Template -->
<script>
  var length=0;
[resultset layer="layer1"]
  [feature]
    length += [length];
  [/feature]
[/resultset]
  alert("total length=" + length);
</script>

So, for each feature in layer1 we add to the overall length variable and then 
output it at the end. Does this help?

Steve

-----Original Message-----
From: [email protected] 
[mailto:[email protected]] On Behalf Of Eric Weisbender
Sent: Friday, March 19, 2010 3:38 PM
To: [email protected]
Subject: [mapserver-users] html query templates

I am trying to calculate the sum of several numeric values returned in a query 
template.  Is there a cgi variable for this or a way to distinguish say the 
first [length] of a line segment returned as apposed to subsequent [length] 
values returned for the same poly line shape.

Eric


_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to