Hi,

I don't know if this is any more efficient than the method you're using,
but... I've attached a workspace that uses a Grepper with the expression
^([^S]*)(.*)$ to split out the first part of the string from the symbol
code then does a ListExploder to generate the individual features.
There are a couple intermediate steps to clean up the text list before
doing the ListExploder.

There are a few cases where features get dropped by the ListExploder,
but as long as each feature entering this workspace has at least two
items (ID and SYMBOL) in the list, you should be OK.

Note for Safe:  This would be a lot easier there was a ListPopper
transformer (from either end).  Not sure how this would work with
multi-attribute lists though.

Jason
 

-----Original Message-----
From: annettefarrell [mailto:[EMAIL PROTECTED] 
Sent: Monday, March 07, 2005 08:05
To: [EMAIL PROTECTED]
Subject: [fme] listexploder transformer




Hi,

I'm wondering is there an easier way to use listexploder transformer?

I was to output everything but the last element of a list.  The last
element of the list will differ from the other elements in that it will
always begin with S e.g. 3102, 3128, S013

Length of the list will vary.

Here's a bit more detail.

I have (Irish) ntf data with point data with an attribute
feature_code_list. Basically this same as UK ntf data but points and
lines are not represented on multiple layers so this needs to be
handled.

Let's say for example the value of this feature_code_list attribute for
one point is 3102, 3128, S013

I want to output 2 point features
Associating the symbol information S013 with each point.  The attribute
beginning with S is the symbol information.  It will always be the last
element in the list.  

I can do this for a list of 3 elements in a convoluted manner using a
tester to compute length of lists etc.
What I've been doing in the
is computing the length of the list
getting the index number of the last element of the list: length of list
-1 and using a tester to compute if the length of the list > 2 and the
index number is >=2

Instead of hardcoding the value 2 I can using a value based on the
length of the feature list so that the method will work where the
FEATURE_CODE_LIST attribute contains more or less than 3 pieces of
information.

There should be a better way to do this.  Will the above method impact
on performace?

Here are my ideas:

Would using a grepper transformer to check if the list attribute
contains a character S?

I tried using Attribute Classifier but don't think integer will do the
trick.

Or what is the best method to use the listexploder, exploding everything
but the last element of the list?

Any thoughts would be appreciated.

Thanks

A









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/
 

Attachment: list_grepper.fmw
Description: list_grepper.fmw

Reply via email to