Hi Mark,
 
What I am trying to do is assign route measures for linear referencing.
So, if a bunch of segments have the same route id I want to assign from
and to measures for each segment in the group. The measures are based on
the length of the line, and need to be in some sort of order so that I
can perform dynamic segmentation. 
 
Actually, I have found a better way to do this than what I was trying to
do yesterday, though I'm still having some problems. What I'm doing is
using Coordinate Fetcher to add the start and end x and y values and in
parallel use LineJoiner, like you mention. I feed both of these into
FeatureMerger with the joined lines as the requestor. I then send this
to ListExploder, which gives me each original feature but instead of the
original geometry I have the joined lines. I can then send this to
LengthToPointCalculator to get the start and end distance. I send this
and the original segments into another FeatureMerger and then I have the
measures on each of the original segments with the original geometry.
This seems to work great for the most part, but I am getting some
records were the begin and end measures are the same, so I am currently
trying to figure out why this is happening. 
 
Thanks for the info. I was still curious about the list processing even
though I had abandoned that approach.  
 
Chad Nielsen 
 

        -----Original Message-----
        From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of mark2atsafe
        Sent: Thursday, January 04, 2007 4:23 PM
        To: [email protected]
        Subject: [fme] Re: reordering attribute lists
        
        

        Hi Chad,
        It's tricky because I'm not really sure why you need to do this.
If
        it's to join together all lines with a similar ROUTEID then the
        LineJoiner might be the very simple answer.
        
        As you'll have noted it isn't really possible to test within a
list.
        What I've done before is count the number of list elements (say
x),
        create x copies of the feature using the Cloner, demote
attributes for
        each one using the ListIndexer (on the ID created by the Cloner)
and
        then compare them using Global variables. Not very pretty, but
it
        worked for the example I had. It was for reading a CSV dataset,
and
        you can find it on fmepedia at...
        
        http://www.fmepedia.com/index.php/CSV_Reader_Workspace_3
<http://www.fmepedia.com/index.php/CSV_Reader_Workspace_3> 
        
        ...really it's almost exactly what you are doing, but using an
ID
        number where you are using coordinates.
        
        Anyway, that method was before looping was permitted. What I'd
do now
        is run the feature through a loop in a custom transformer (loop#
=
        1...n) demoting attributes using the ListIndexer (list item =
loop#)
        and then do a compare... not too sure how because I've never
needed to
        try this yet.
        
        I hope this helps; but I really can't help feeling they'll be an
        easier way to achieve your final aim, if you can explain a
little more.
        
        Regards,
        
        Mark
        
        Mark Ireland, Senior Product Specialist
        Safe Software Inc. Surrey, BC, CANADA
        [EMAIL PROTECTED] <mailto:support%40safe.com>
http://www.safe.com <http://www.safe.com> 
        Solutions for Spatial Data Translation, Distribution and Access
        
        --- In [email protected] <mailto:fme%40yahoogroups.com> ,
"NIELSEN Chad M" <[EMAIL PROTECTED]> wrote:
        >
        > Hello,
        > 
        > In FME Workbench I am trying to figure out how to reorder an
attribute
        > list created from aggregated line features such that where
part 0 ends
        > part 1 starts and where part 1 ends part 2 starts, and so on. 
        > 
        > I am using CoordinateFetcher to add fields that store the
start x, start
        > y, end x and end y values for each line feature. I then use
Aggregator
        > based on a field called ROUTEID which gives me the unordered
list of
        > parts. I want to be able to compare the start/end x/y values
to the
        > other elements in the list, if the start x/y of one part
matches the end
        > x/y of another part then assign an index value that indicates
the
        > relative position in the list. It seems I don't really need to
sort them
        > until the new index values are set. Once the new index values
are set I
        > can use ListSorter to put the parts in order. 
        > 
        > My main problem is figuring out how I can test the elements of
the list
        > with other elements in the list then assign a value to an
element in a
        > list. I'm not sure if this is possible. Am I way off track
here? Any
        > suggestions?
        > 
        > Thanks,
        > 
        > Chad M. Nielsen
        > GIS Analyst
        > Oregon Department of Transportation
        > (503) 986-3163
        > [EMAIL PROTECTED]
        >
        
        

         

Reply via email to