I have a question concerning conditional attributing.
In this case it concerns the attributesetter.
I have a dem raster to wich i added a pallete.
I do a conditional setting to change the colors (kind of a colorrange) adn create a new colormap.
test
if _matched_parts{0} between 0,10
outputvalue @Value(_bandnr{0}) 73,255,255
elseif etc.etc.
This results in a error.
If i do this same in an attributevaluemapper i get the same error.
When i do the test in a testfilter and connect a attributecreator with the same tests and outputs it works. ( i do have to remove the evaluation in the attributesetter, else it will try to evaluate "@Value(_bandnr{0}) 73,255,255" wich is a simple concatenation.)
This is not desirable because i get a lot of transformers.
Am i correct to assume that the valuemapper and conditionalsetter try to evaluate "@Value(_bandnr{0}) 73,255,255"?
How do i prevent this?
Oh, and before you go all wild Takashi, i already have made a tcl script to do this ( only one tcl caller needed now)..tho i hav'nt made a phyton version... ;)
But i wanted to try and stick to an all fme transformer solution (at my office i am the only making tcl and phtyon scripts)
here is the error log
-----------------------------
AttributeSetter: Invalid Test Expression: TEST<at>Value<openparen>_matched_parts<opencurly>0<closecurly><closeparen>BETWEEN0<comma>10.
AttributeSetter: Failed to evaluate input expression: FME_CONDITIONAL:DEFAULT_VALUE'@Value(_bandnr{0})255,14,14'BOOL_OP;OR;COMPOSITE_TEST;<Unused>;(_matched_parts{0})BETWEEN0,10'@Value(_bandnr{0})73,255,255'BOOL_OP;OR;COMPOSITE_TEST;<Unused>;(_matched_parts{0})BETWEEN10,25'@Value(_bandnr{0})199,255,119'BOOL_OP;OR;COMPOSITE_TEST;<Unused>;(_matched_parts{0})BETWEEN25,50'@Value(_bandnr{0})239,218,60'BOOL_OP;OR;COMPOSITE_TEST;<Unused>;(_matched_parts{0})BETWEEN50,75'@Value(_bandnr{0})255,57,255'BOOL_OP;OR;COMPOSITE_TEST;<Unused>;(_matched_parts{0})BETWEEN75,100'@Value(_bandnr{0})72,66,255'FME_NUM_CONDITIONS6___
Storing feature(s) to FME feature store file `H:\\Documents\\My FME Workspaces/bewoningsdichtheid_log.ffs'
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Feature Type: `AttributeSetter_OUTPUT'
Attribute(encoded: utf-8): `_bandnr{0}' has value `0 '
Attribute(string) : `_element_count' has value `17'
Attribute(32 bit integer): `_element_index' has value `1'
Attribute(encoded: utf-8): `_list' has value `0 0,0,0'
Attribute(encoded: utf-8): `_matched_characters' has value `0 0,0,0'
Attribute(encoded: utf-8): `_matched_parts{0}' has value `0'
Attribute(string) : `_palette' has value `RGB24
0 0,0,0
1 41,41,41
2 26,26,26
3 43,43,43
4 63,63,63
5 79,79,79
6 96,96,96
7 75,75,75
8 94,94,94
9 91,91,91
10 164,164,164
11 255,255,255
12 209,209,209
13 161,161,161
14 200,200,200
'
Attribute(string) : `fme_basename' has value `SurfaceModeller'
Attribute(string) : `fme_geometry' has value `fme_aggregate'
Attribute(string) : `fme_type' has value `fme_raster'
Coordinate System: `_Netherlands-RDNew-2008_0'
Geometry Type: IFMERaster
Number of Columns : 4
Number of Rows : 4
Cell Origin : 0.5,0.5
Cell Spacing : 100,100
Origin : 93359.970232381,463951.217756797
Extents : (93359.970232381,463551.217756797),(93759.970232381,463951.217756797)
Rotation : 0
Number of Bands : 1
Band Name : Band 0 : Surface Model Raster Band
Interpretation Type : Band 0 : UINT16
Nodata Value : Band 0 : N/A
Selected : Band 0 : TRUE
Number of Palettes : Band 0 : 1
Palette Name : Band 0 : Palette 0 :
Interpretation Type : Band 0 : Palette 0 : RGB24
Selected : Band 0 : Palette 0 : TRUE
Number of Entries : Band 0 : Palette 0 : 15
Palette Keys -> Values : Band 0 : Palette 0 : 0 -> 0,0,0
Palette Keys -> Values : Band 0 : Palette 0 : 1 -> 41,41,41
Palette Keys -> Values : Band 0 : Palette 0 : 2 -> 26,26,26
Palette Keys -> Values : Band 0 : Palette 0 : 3 -> 43,43,43
Palette Keys -> Values : Band 0 : Palette 0 : 4 -> 63,63,63
Palette Keys -> Values : Band 0 : Palette 0 : 5 -> 79,79,79
Palette Keys -> Values : Band 0 : Palette 0 : 6 -> 96,96,96
Palette Keys -> Values : Band 0 : Palette 0 : 7 -> 75,75,75
Palette Keys -> Values : Band 0 : Palette 0 : 8 -> 94,94,94
Palette Keys -> Values : Band 0 : Palette 0 : 9 -> 91,91,91
Palette Keys -> Values : Band 0 : Palette 0 : 10 -> 164,164,164
Palette Keys -> Values : Band 0 : Palette 0 : 11 -> 255,255,255
Palette Keys -> Values : Band 0 : Palette 0 : 12 -> 209,209,209
Palette Keys -> Values : Band 0 : Palette 0 : 13 -> 161,161,161
Palette Keys -> Values : Band 0 : Palette 0 : 14 -> 200,200,200
===========================================================================
AttributeSetter: @Tcl2 -- failed to evaluate expression `AttributeSetter_eecd1ff7_96e1_4fe9_b07f_571bdec4c22d3_doSetAttr' -- A fatal error has occurred. Check the logfile above for details
@%0 -- failed to evaluate expression `%1' -- %2
A fatal error has occurred. Check the logfile above for details
A fatal error has occurred. Check the logfile above for details
The tests and the attriubtes to set do work when using a testfilter and a bunch of attributecreators as i said earlier.