--- In [EMAIL PROTECTED]com,
"Cifelli, Scott T." <scott.cifelli@...> wrote:
>
>
All-
>
> Is it possible to filter objects on the INPUT clause of a
factory by
> the feature name? For example, I have some features coming in
like
> this:
>
> POLE_EXI_LOCATION
>
POLE_RET_LOCATION
> POLE_ANNOTATION
> PRIMARY_EXI_ROUTE
>
...etc
>
> I want only the features that have the word POLE and
LOCATION in the
> name to actually enter the factory.
>
> I
am working with .fme files and workbench is not an option. I'm
> assuming
I need to use TCL but am looking for a simplier option if
> it
exists.
Hi Scott,
Specifying POLE* or *LOCATION won't work, as
you've probably noticed.
Since you're already using mapping files, TCL isn't
any more paintful.
The TestFactory adds an attribute 'match' with value
'good' if the
FeatureType contains POLE or LOCATION. Then, the input to
the
SamplingFactory is limited by the match attribute.
Best
Regards,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Safe
Software Inc. Dan Iseminger
Surrey, BC, CANADA Product
Specialist
tel:604.501.9985.278 [EMAIL PROTECTED]com
fax:604.501.9965
http://www.safe.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
=================================================================
READER_TYPE
NULL
NULL_SOURCE_DATASET null
#
=================================================================
WRITER_TYPE
NULL
NULL_DATASET NULL
#
=================================================================
FACTORY_DEF
* CreationFactory \
CREATE_AT_END no \
NUMBER_TO_CREATE 1 \
OUTPUT
FEATURE_TYPE JUST_LOCATION
#
=================================================================
FACTORY_DEF
* TeeFactory FACTORY_NAME Copier \
INPUT FEATURE_TYPE JUST_LOCATION
\
OUTPUT FEATURE_TYPE POLE_EXI_LOCATION \
OUTPUT FEATURE_TYPE
POLE_RET_LOCATION \
OUTPUT FEATURE_TYPE POLE_ANNOTATION \
OUTPUT
FEATURE_TYPE PRIMARY_EXI_ROUTE \
OUTPUT FEATURE_TYPE *
#
=================================================================
FACTORY_DEF
* TestFactory FACTORY_NAME "POLE or LOCATION" \
INPUT FEATURE_TYPE *
\
TEST @Tcl2("expr [regexp -nocase LOCATION $FME_FeatureType]") =
1
\
TEST @Tcl2("expr [regexp -nocase POLE $FME_FeatureType]") = 1
\
BOOLEAN_OPERATOR OR \
OUTPUT PASSED FEATURE_TYPE * match good
\
OUTPUT FAILED FEATURE_TYPE *
#
=================================================================
FACTORY_DEF
* SamplingFactory FACTORY_NAME "limit" \
SAMPLE_RATE 1 \
INPUT
FEATURE_TYPE * match good \
OUTPUT SAMPLED FEATURE_TYPE * \
how_many
@Count("POLE or LOCATION") @Log("POLE or LOCATION")
#
=================================================================
**** For your information: the Rhode Island Operations of New England Gas Company have been acquired by National Grid and are now doing business under that name. ****
This e-mail and any files transmitted with it, are confidential to National Grid and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error, please reply to this message and let the sender know.