JM,
Dynamic filtering is doable in TCL or via .fme mapping files, but the 
real question is what are you doing to the features once they've been 
filtered?  In Workbench you've got to route the features to the next 
transformer.  Presumably if you don't know how many values there are, 
or what they are, you won't be able to connect the filter to the next 
transformers, or there must be some common thread to the subsequent 
processing.  What is it that you want to do differently for each 
filtered value?
rgds,
Peter


--- In [email protected], "Mark Ireland" <[EMAIL PROTECTED]> wrote:
> Hi JM,
> Well the separate file idea works as long as you aren't worried 
about
> the format of that file; as I said edit the workspace header by 
adding
> an INCLUDE <filename> statement and then in the file put the Macro
> definitions. 
> So instead of...
> 
> value1
> 
> use...
> 
> MACRO mymacro1 value1
> 
> So that changing the definitions in the file will alter how the
> attributeFilter operates in the workspace.
> 
> As to a variable number of values - I think you're asking too much 
here.
> The most I can suggest is to create 10 values (for example) and if 
you
> use only 6 of them set the other 4 macros to -9999 or some other 
value
> that you know isn't going to occur in your data.
> 
> For TCL I think you'd have to use it as a sort of ValueMapper - ie
> compare the attribute to one in a file and assign a new attribute on
> that basis (say a number from 1-10) - set up a permanent 
attributeFilter
> using these values and you'll have pretty much the same effect - 
still
> wouldn't use a variable number of values though.
> 
> 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: Jean-Martin Verreault [mailto:[EMAIL PROTECTED] 
> > Sent: January 20, 2005 9:06 PM
> > To: [email protected]
> > Subject: RE: [fme] Dynamic Attribute Filtering
> > 
> > 
> > 
> > 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
> > 
> > 
> > 
> >  
> > 
> > 
> > 
> >








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