Skip to main content
Hello,

 

 

I'm creating a work bench to turn a polygon dataset into a raster and then adds it to various existing rasters. I want to use a parameter so I only need to create one workspace and the user can select which raster they want to use for the addition. I've created the parameter with a drop down list for options.

 

Firstly, I'm using a Joiner to add a spreadsheet to the dataset which contains 7 fields and those fields match the options in the parameter and the 'fields to add' variable is set to my parameter value, so far this stage works.

 

The problem occurs in the next step where I have the 3D Forcer. I have the elevation variable set to my parameter but when I run it I get the following error: 2014-12-29 10:13:36|   0.6|  0.0|WARN  |3DForcer_2: Failed to evaluate TCL expression: crops

 

2014-12-29 10:13:36|   0.6|  0.0|WARN  |3DForcer_2: TCL Error Message: invalid bareword "crops"

 

in expression "crops";

 

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

 

2014-12-29 10:13:36|   0.6|  0.0|STATS |Storing feature(s) to FME feature store file `S:\\fme _work\\SBC\\PolytoRastTool/AllTest_log.ffs'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Feature Type: `3DForcer_2_OUTPUT'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(string)                 : `HabClass' has value `Intact hedge'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(string)                 : `SHAPE_GEOMETRY' has value `shape_polygon'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(string)                 : `_JoinChoice' has value `crops'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(32 bit unsigned integer): `_matched_records' has value `1'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(string)                 : `crops' has value `100'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(string)                 : `fme_basename' has value `HabitatLayer'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(string)                 : `fme_dataset' has value `E:\\Projects\\Matt\\SBC\\Update_Tool\\HabitatLayer.shp'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(string)                 : `fme_feature_type' has value `HabitatLayer'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(string)                 : `fme_geometry' has value `fme_polygon'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(entangled: string)      : `fme_type' has value `fme_area'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |          entangled to  SHAPE_GEOMETRY]

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(32 bit integer)         : `multi_reader_full_id' has value `0'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(32 bit integer)         : `multi_reader_id' has value `0'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(string)                 : `multi_reader_keyword' has value `SHAPE_1'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Attribute(string)                 : `multi_reader_type' has value `SHAPE'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Coordinate System: `BritishNatGrid'

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Geometry Type: IFMEPolygon

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |Boundary:

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |   Geometry Type: IFMELine

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |   Number of Coordinates: 36 -- Coordinate Dimension: 2

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |   (349569.207114486,589619.939759698)(349571.239999999,589616.689500002)(349568.139999998,589614.09)(349563.415,589610.265000001)(349558.039999998,589606.289999999)

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |   (349552.6125,589602.978000002)(349546.941743891,589598.486077951)(349544.306699998,589604.373999999)(349537.801299999,589600.579199999)(349532.306699999,589597.374)

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |   ...Skipping coordinates...

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |   (349509.376720743,589614.411194774)(349514.18394296,589617.132493654)(349521.293849998,589620.653300001)(349528.4067,589621.313999998)(349535.126699999,589621.915599999)

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |   (349541.385900001,589621.5764)(349546.716243719,589620.73925744)(349553.614149999,589618.5648)(349557.630447912,589618.522411076)(349564.675239373,589618.294556824)

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |   (349569.207114486,589619.939759698)

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |===========================================================================

 

2014-12-29 10:13:36|   0.6|  0.0|ERROR |3DForcer_2: ZValue function cannot convert 'crops' to floating point value

 

2014-12-29 10:13:36|   0.6|  0.0|WARN  |3DForcer_2: Failed to evaluate TCL expression: crops

 

2014-12-29 10:13:36|   0.6|  0.0|WARN  |3DForcer_2: TCL Error Message: invalid bareword "crops"

 

in expression "crops";

 

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

 

Before creating the parameter and haven't the values hard coded it worked perfectly fine. If anybody has any work arounds for this then it would be greatly appreciated!

 

 

Thank you
Hi,

 

 

Probably the reason for the error is that the parameter value was not numeric. From the error messages, I guess the parameter contained a character string "crops".

 

Check if the parameter values are always numeric.

 

 

Takashi
Hi Takashi, yea I noticed that in the error message but the values are numeric. I connected an inspector after the joiner and the values contained within the "crops" field are numeric. And as I said, if I specify the field to add as "crops" and the 3D forcer to "crops" it runs and creates an output. Is there away for me to force the field to be numeric instead of it thinking it's a string before the data enters the 3D forcer?

 

Do you think the 3D forcer, instead of looking at the field "crops", is treating the parameter as a value and is trying to force that string into a Z value?

 

 

Is there a way to get around that by changing the way I created the parameter?

 

 

 

 

 
Hi,

 

 

could it be that you need an AttributeDereferencer first?

 

 

David
I suppose that you are going to allow users to select attribute ("Animals", "crops" etc) that contains numeric value to be used as Z for the 3DForcer.

 

There should be several ways, Tcl script may be relatively easy.

 

For example, this TclCaller retrieves a value held by "$(JoinChoice)" attribute, and add it as new attribute called "_result" to the feature.

 

-----

 

Tcl Expression: FME_GetAttribute "$(JoinChoice)"

 


Hi David.

 

 

I haven't used the AttDereferencer before and I just tried it out. I set it to my parameter value but the created field is populated with <missing>. I assume this is the same problem as it thinks the parameter is a string and not a field to look at?

 

 

Takashi, that's correct, the drop down options match a column on the spreadsheet and each attribute contains numeric values. I just tried your TclCaller and that seems to be doing exactly what I want! I'll spend some time making sure the whole process is working correctly now.

 

 

Thanks to both of you for your time and help with this
Hi,

 

 

good to hear you got it working. Yes, I see now that the AttributeDereferencer might not be what you need here. But I believe you will find that the TCLCaller above can be replaced by an AttributeFetcher.

 

 

David
Hello again, do you know if AttributeFetcher has been renamed? I'm running FME2014 SP4 and I feel very silly that I can't find it. I've also just tried typing fetcher and that doesn't seem to find any relevant transformers

 

 
You're right. I'm sorry, it should be the ParameterFetcher. It's still there in FME 2014 SP5.

 

 

David
If you use the ParameterFetcher to fetch the parameter value (i.e. attribute name), I think you will have to add the AttributeDereferencer to complete the requirement.

 

This procedure produces the same result as the TclCaller.

 


Reply