Hello Mark,

This is cool stuff. I appreciate your input.
However this solution fills the job partially. 

With your proposed solution, you need to know before hand the amount of
filtervalues which will be used by the attributefilter thus the amount of
macros to write.
What I would like is for example say a separate file which would include a
set of filter values to be used by the attributefilter, i.e:
Value1
Value2
Value3
<eof>

So is it possible to "pass"/make use of these values in the AttributeFilter
at run time?
Is TCL the next level of customization to go with?

Thanks,
JM
 



-----Original Message-----
From: Mark Ireland [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 19, 2005 4:39 PM
To: [email protected]
Subject: RE: [fme] Dynamic Attribute Filtering

Hi JM,
This is advanced stuff, but yes this is possible to do dynamically by
setting macros within the AttributeFilter.

I've attached a small workspace and dataset that will show you how.

I created a Macro in the workspace header which results in a new setting
available in the navigator window under the CSV dataset. It is flagged
'always prompt' so you will be prompted for a value whenever you choose run
workspace (but not rerun workspace, so make sure you choose
file->run).

That macro is placed in the attributefilter as a value. When you run the
workspace set the value to 151 - you will see 7 points have an ID of 151 etc

You could get the macro values through a GUI (as I have done) or pass them
from the command line. However, in your case you may want to read the values
from a file rather than create header macros.
If that were the case I suggest you set up a file which you point to with an
include in the workspace header.

ie Tools->Edit Header
Add the line... INCLUDE myparams.fmi

And in the file myparams.fmi have...

MACRO mymacro1 <<value1>>
MACRO mymacro2 <<value2>>

...where mymacro is the name of macro you are going to use in the
AttributeFilter and <<value>> is the value you wish to filter against.

If you do this then you can set up your workspace and AttributeFilter and
run it whenever you like without changing anything. Edit the values in
myparams.fmi when required and Workbench will filter against these instead.

The other advantage is that when you use the 'Import' function in
AttributeFilter it will add values, and not replace them, so you would also
have to manually edit your connections using that method.

Hope this helps. These techniques are very useful for setting up user
defined settings and having them used within Workbench transformers.
They aren't always compatible, and sometimes you need to use [] brackets
instead of () - but I think this is a much-underused function.

BTW, Whatever you do don't right-click an AttributeFilter output port and
choose 'route to visualiser' when the value is a macro name - when you do
that the Visualiser name includes the macro name and things start to fall
apart! I'd also be careful to ensure you pass a value to every macro listed
in the filter, because without there may be problems.

Regards,

Mark

Mark Ireland, Product Support Engineer
Safe Software Inc. Surrey, BC, CANADA
[EMAIL PROTECTED] http://www.safe.com
Solutions for Spatial Data Translation, Distribution and Access


> -----Original Message-----
> From: spatial_it_2k [mailto:[EMAIL PROTECTED]
> Sent: January 18, 2005 8:39 AM
> To: [email protected]
> Subject: [fme] Dynamic Attribute Filtering
> 
> 
> 
> 
> Hello group,
> 
> Does anyone know how it is possible to dynamically specify an 
> AttibuteFilter? In other words, I would like to run a workspace where 
> the data which is to be converted filters the data on a predefined 
> attribute using runtime attribute values for the filter.
> 
> Is it possible to use a file with a list of attibute values for the 
> filter and then use this file one way or another to filter the data 
> based on those values.
> 
> Any ideas?
> 
> JM
> 
> 
> 
> 
> 
> 
> 
> 
> 
> Get the maximum benefit from your FME, FME Objects, or SpatialDirect 
> via our Professional Services team.  Visit www.safe.com/services for 
> details.
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
> 


Get the maximum benefit from your FME, FME Objects, or SpatialDirect via our
Professional Services team.  Visit www.safe.com/services for details. 
Yahoo! Groups Links



 






Get the maximum benefit from your FME, FME Objects, or SpatialDirect via our 
Professional Services team.  Visit www.safe.com/services for details. 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/fme/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to