Skip to main content
Excuse my knowlege of TCL (it is very rusty).

 

 

I have a stream of featues (fme_line), with the attribute:

 

 

Attribute(encoded: utf-8) : `type' has value `Ferry Route'

 

 

or

 

 

Attribute(encoded: utf-8) : `type' has value `Major Highway'

 

 

I am trying to use the TestFilter to find the ferrys.

 

 

I have the following StringFinder call, but it always returns -1:

 

 

@FindString(@Value(type) , "ferry", 0, FALSE)

 

 

also I have tried something simpler

 

 

@Value(type) = "Ferry Route"

 

 

But that also is always failing.

 

 

And this also does not work:

 

 

@Value(type) CONTAINS "Ferry"

 

 

any ideas?

 

 

 

Hi,

 

 

The FindString function seems not to trim white spaces in the parameter string. Try these expressions: @FindString(@Value(type),"ferry", 0, FALSE) or @FindString(@Value(type),ferry, 0, FALSE)    But, I believe these expressions would work. Sounds strange... @Value(type) = "Ferry Route" @Value(type) CONTAINS "Ferry"

 

Takashi
But all of these varients, I listed in my original message as NOT WORKING. I just retried them exactly as you specifed (in an expression evaluator,

 

 

the FindString() is returning -1 always

 

and the others are false.

 

 

And the other two crash the expression evaluator

 

 

RoadMaker_ExpressionEvaluator: Failed to evaluate TCL expression: Major Highway CONTAINS "Ferry"

RoadMaker_ExpressionEvaluator: TCL Error Message: invalid bareword "Major"

in expression "Major Highway CONTAINS "Fer...";

should be "$Major" or "{Major}" or "Major(...)" or ...

 

 

Which seems to point a TCL syntax issues of quoatation,

 

 

 

 

 


I reproduced the error message with the ExpressionEvaluator. Did you perhaps type this expression directly in the editor of ExpressionEvaluator? @Value(type) CONTAINS "Ferry"   If so, it will be transformed like this, when receiving a feature. Major Highway CONTAINS "Ferry" Naturally it is not a valid expression to be interpreted by the Tcl interpreter.   If you want to use the ExpressionEvaluator, try this expression. @FindString(@Value(type),ferry,0,FALSE)   Or, consider using the Tester transformer with this setting. Left Value  |  Operator  |  Right Value type  |  Contains  |  Ferry * type is the attribute name, Ferry is a constant value.
@Value(type) CONTAINS "Ferry" was the only magic verison that works (for the TestFilter Transform). But it does work, so thank you.

 

 

 


I'm sorry 

 

 

It really should be

 

 

@Value(type) CONTAINS Ferry (with no quotes).

 

 

 


Reply