Skip to main content
Solved

Sorter is not working correctly in 2018.1?


nicholas
Contributor
Forum|alt.badge.img+11

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

Best answer by nicholas

@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)

View original
Did this help you find an answer to your question?

9 replies

itay
Supporter
Forum|alt.badge.img+17
  • Supporter
  • August 29, 2019

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


gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • August 29, 2019

@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)


Forum|alt.badge.img
  • August 29, 2019

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

nicholas
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • August 30, 2019
danullen wrote:

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)


fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • August 30, 2019

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/


nicholas
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • August 30, 2019
fmelizard wrote:

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?


fmelizard
Safer
Forum|alt.badge.img+18
  • Safer
  • August 30, 2019
nicholas wrote:

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.


nicholas
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • August 30, 2019
fmelizard wrote:

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

CSV did work :-)


nicholas
Contributor
Forum|alt.badge.img+11
  • Author
  • Contributor
  • Best Answer
  • August 30, 2019

@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)


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings