Skip to main content

Hello all,

I am running FME(R) 2018.1.2.1 (20190319 - Build 18592 - WIN64)

I have a dataset of points (along a road) and I want to use the LineBuilder to create lines.

Each point has a ROAD_SECTION_ID (character field) which uniquely identifies the road.

Each point also has a TDIST (numeric field) which is the distance along the road.

I am trying to sort the points appropriately before they go into the LineBuilder. They should be sorted firstly by ROAD_SECTION_ID and secondly by TDIST.

However, the result of the sort is wrong. The features are sorted firstly in ascending order of TDIST, then in descending order of ROAD_SECTION_ID

I have reversed the order in the Sorter, but there is no difference

The outcome is that the LineBuilder does not work like it should

You might want to try the NaturalSorter transformer from the Hub. It offers the possibility to set a group -by which in your case is the ROAD_SECTIO_ID


@Nicholas

 

Sorting seems ok.

But u expect it to sort with the keys compounded.

In such cases I create a compound sort key.In this case csk is concatenation of the attributes.

 

You can also sort by tdist, aggregate by road_section_id and deaggregate.

Or counter by road_section_id and then use this counter as first sortkey (rather than road_section_id;

you would be replacing a string by a number)


Just to get some more info, what happens if you only sort on ROAD_SECTION_ID ascending? Do you get the expected result below?

10M

 

10M

 

10M

 

10M

 

10N

 

10N

 

10N

 

10N

Just to get some more info, what happens if you only sort on ROAD_SECTION_ID ascending? Do you get the expected result below?

10M

 

10M

 

10M

 

10M

 

10N

 

10N

 

10N

 

10N

Yes, I I sort only on ROAD_SECTION_ID (Alphabetic, Ascending) then I do get the expected result as you describe.

Also, if I sort only on TDIST (Numeric, Ascending) then I get a proper result

0

0

0.01

0.01

0.02

0.02

and so on

My problem is when I attempt to sort on two attributes (first by ROAD_SECTION_ID, then by TDIST)


Hi @nicholas Are you reading from a geodatabase? If so then this problem with the Sorter was just recently fixed. Please try the latest 2019.2 beta from https://www.safe.com/support/support-resources/fme-downloads/beta/


Hi @nicholas Are you reading from a geodatabase? If so then this problem with the Sorter was just recently fixed. Please try the latest 2019.2 beta from https://www.safe.com/support/support-resources/fme-downloads/beta/

Yes, I am reading from a file geodatabase.

I cannot upgrade to 2019.2 I need to maintain version parity with my workplace's FME server.

I will instead experiment with saving my dataset in a different format. Maybe a CSV or oracle database?


Yes, I am reading from a file geodatabase.

I cannot upgrade to 2019.2 I need to maintain version parity with my workplace's FME server.

I will instead experiment with saving my dataset in a different format. Maybe a CSV or oracle database?

CSV will work. Let me know if you have trouble with an Oracle database.


CSV will work. Let me know if you have trouble with an Oracle database.

CSV did work :-)


@danatsafe asked if my Reader was an ESRI file geodatabase, which it was.

I switched my raw data to a different format and my problem was solved.

@danatsafe also recommended I upgrade, but that is not a good solution for me (My workplace is using 2018.1 currently)


Reply