Skip to main content
Solved

Group points using count rule

  • June 28, 2016
  • 5 replies
  • 74 views

Forum|alt.badge.img

Hello, probably this is something easy to achieve but I'm still new to FME. 

I'm reading a set of points from a DWG file. These are definition points from a dimension feature. Each dimension object has 3 definition points, but there is no dimension ID. All that I have is a set of points listed consecutively; the first 3 points belong to one feature, the next 3 points belong to another feature and so on. I want to group all points using a count or split rule but so far I can't find a way to implement it. 

Here is an example of what I want to accomplish. 

Count   fme_feature_type
1  Dimension |
2  Dimension      |--> Group 1 
3 Dimension |

4 Dimension | 
5 Dimension |--> Group 2 
6 Dimension |

Thanks 

Best answer by ebygomm

Use an attributecreator you can set the attribute value of a new attribute called group using ceil(@Value(count)/3)

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

5 replies

gio
Contributor
Forum|alt.badge.img+15
  • Contributor
  • June 28, 2016

group = ceiling (count/3).


Forum|alt.badge.img
  • Author
  • June 28, 2016

group = ceiling (count/3).

Thanks for the reply, but could you tell me what type of transformer should I use?


ebygomm
Influencer
Forum|alt.badge.img+46
  • Influencer
  • Best Answer
  • June 28, 2016

Use an attributecreator you can set the attribute value of a new attribute called group using ceil(@Value(count)/3)


Forum|alt.badge.img
  • Author
  • June 28, 2016

Use an attributecreator you can set the attribute value of a new attribute called group using ceil(@Value(count)/3)

Nice solution, thanks much!


Forum|alt.badge.img+5

The other way would be to use a Counter and a ModuloCounter. Take the modulo count away from the full count (ExpressionEvaluator) and you get a unique ID for that group (the ID would be 3, 6, 9, 12, etc instead of 1, 2, 3, 4; but it will be unique for that group)