Hi Ron,
Good grief this is a problem and a half! But I think I have a
solution. It works on the sample you provided - though I think you may
need to tinker to get it working on a full dataset.
I spent a while thinking about this and I can't see a way that the
Sorter transformer will do what you need. The only way that could
happen was if the point ID ran in order along the line; and I can see
from your example that it doesn't.
Furthermore a sort of this type (a bubble sort) requires some form of
iteration, Workbench doesn't really allow for that. The only way I
could see of achieving this is to use TCL.
The first thing I considered would be use a ListBuilder to create a
list of the attributes. Use a TCLCaller to call a TCL script. The
script would need to sort through the list elements repeatedly to find
each successive element. Tag the element with an ID number such as
list{x}.ID. Then back in Workbench use a ListExploder to convert the
list back to FME features, then use a Sorter to sort by list{x}.ID
But having said that I had a bit of a brainwave and created a
workspace that will do what you need. However it's complicated (17
transformers) and difficult to explain. The theory: It iterates though
a set of features by creating a copy of each feature for each
iteration you need. So I create a list of all the points for a feature
using the FeatureMerger and then create a separate feature that
contains the full list using a ListElementCounter/Cloner. Then I use
GlobalVariables to define the next point to be read and extract that
feature from the list of the next feature with a ListIndexer. Note the
use of the function @GlobalVariable(GV) in the ListSearcher to
determine which element in the list to read.
NB: It all works only because I'm relying on FME to process a single
feature as far as possible in the workspace. I don't know if many
people really understand that concept, but it's the entire basis for
this workspace. If I say so myself, it's a neat trick. In the same
vein the StatisticCalculators in there aren't needed for calculating
statistics; I use them to force FME to stop at that point and gather
all features together.
I really hope this helps. This is one of those problems that starts me
thinking to the extent I can't get any other work done until I've
solved it! And of course the only way to prove it works is to actually
create the solution.
I'll post the workspace to the files section of the group. Let me know
if you'd like me to email you a copy directly.
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
--- In [email protected], "Ron Cook" <[EMAIL PROTECTED]> wrote:
>
> Hello,
>
> I am trying to create lines using the pointconnector operator in
workbench.
> Each row of data refers to a NEXT_POINT(char) and a PREV_POINT(char)
> The first point has a PREV_POINT values of A and the last point has a
> NEXT_POINT value of Z. A unique line is define by the combination of
> TYP,ST_ID and JOB_NUM How do I sort the rows so that they are in the
correct
> order for the pointconnector? Any ideas would be greatly appreciated.
>
>
> TYP,ST_ID,PNT_ID,JOB_NUM,MEAS_ACC,NORTHING,EASTING,NEXT_POINT,PREV_POINT
> MM,0002,-4230-75,030932,1,63212.74,458589.08,-4138-33,-4138-32
> MM,0002,-4138-33,030932,1,63212.40,458579.29,-4138-34,-4230-75
> MM,0002,-4138-34,030932,1,63211.97,458581.98,-4138-35,-4138-33
> MM,0002,-4138-35,030932,1,63211.89,458565.12,-4138-36,-4138-34
> MM,0002,-4138-36,030932,1,63211.74,458553.82,-4138-37,-4138-35
> MM,0002,-4138-37,030932,1,63211.22,458554.15,-4138-38,-4138-36
> MM,0002,-4138-38,030932,1,63211.56,458564.37,-4138-39,-4138-37
> MM,0002,-4138-39,030932,1,63211.49,458567.05,-4138-8,-4138-38
> MM,0002,-4138-32,030932,1,63212.16,458588.87,-4230-75,A
> MM,0002,-4138-8,030932,1,63211.05,458577.80,Z,-4138-39
>
>
> Thank you
>
> Ron Cook B.Sc.
> Geo-Innovations Inc
> 11713 10a Avenue
> Edmonton AB
> T6J 7A7
> (780) 951-0050
>
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/