Pre-RFC, pulling rendering/labeling parameters from attributes...

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Tue Jun 6 21:55:01 EDT 2006

Frank Warmerdam wrote:
> Stephen Woodbridge wrote:
>> Ok, glad I read this one before posting the exact same thing! only I 
>> would have done my example like:
>>  SIZE [sizeattribute]
>>  ANGLE ([angleattribute] - 90.0)
>>   TEXT ("Label: " . [labelattribute] . ".")
>>  END
>> This would require a lot of changes, but could be fully backwards 
>> compatible.
> SteveW,
> I assume part of the benefit here is that we can use the same substitution
> engine used for expressions?  (and I guess actually evaluating in the
> expressions in the ANGLE case above).
> I certainly like this degree of generality, though internally I would like
> to see a fixed value and possibly a simple variable substitution handled
> via some sort of short cut to reduce the amount of expression processing 
> for
> each feature.  I would hate to have ANGLE 0 result in a full expression 
> parse
> and evaluation for each feature.
> Best regards,


I like the generalization, but I agree in the need for not using the 
expression evaluation if you don't need to. For example:

ANGLE [angleattribute]

Would not need expression evaluation, but any clause starting with "(" 
would be assumed to be an expression. I could live without the 
expressions but I think they are handy for a lot of simple or low volume 

I guess what I would like to see is a generalized attribute substitution 
for any single value that can be placed in a layer definition. This 
would imply that you would need three columns for COLOR [R] [G] [B], 
although it might be made smart enough to recognize COLOR 
[colorattribute] as a string and parse it.

Steve have you given any thought into URL parameter substitution and how 
it might or might not play with this. For example:

ANGLE %angle%
ANGLE [%angleattribute%]

So all values can be either:


where expression may/may not contain any of the items above. OK, this is 
getting into the grand unification theory of variable substitution :)


More information about the mapserver-dev mailing list