Hi there,
given a series of points with a custom attribute @att, how can I generate a series of groups (group1, group2, etc) based on points that share the same value in @att?
There's probably an easy solution, but I couldn't find any info about and I've already spent some time on it..
Thanks for any help
Grouping points with the same attribute value
6328 5 1- Andr1
- Member
- 118 posts
- Joined: Feb. 2016
- Offline
- circusmonkey
- Member
- 2624 posts
- Joined: Aug. 2006
- Offline
- Andr1
- Member
- 118 posts
- Joined: Feb. 2016
- Offline
hello thanks a lot for the help,
but I've have a slightly more complex situation: I need to create automatically more than 1 group, without manually specifying the value.
The attrib vop should run over all the points, assigning the currently evaluating point to a new group if it finds a different value in @myattribute
I was thinking of some nested loop solution, but I'm not quite sure it's the way to go, seems too much overkill for such a basic need.
but I've have a slightly more complex situation: I need to create automatically more than 1 group, without manually specifying the value.
The attrib vop should run over all the points, assigning the currently evaluating point to a new group if it finds a different value in @myattribute
I was thinking of some nested loop solution, but I'm not quite sure it's the way to go, seems too much overkill for such a basic need.
Edited by Andr1 - July 7, 2016 07:14:42
- blackpixel
- Member
- 182 posts
- Joined: April 2009
- Offline
that's what the partition sop is for.
you can use a rule like this:
where mygroup_ can be any string and `@att` will be replaced by the attribute value.
or if your attribute is a float and you need to round it to an integer with rint() :>
mygroup_1
mygroup_12
etc.
you can, of course, have more complex rules with more attributes like>
mygroup_1_4__16-something
mygroup_2_15__55-something
etc.
you can use a rule like this:
mygroup_`@att`
or if your attribute is a float and you need to round it to an integer with rint() :
mygroup_`rint(@att)`
mygroup_1
mygroup_12
etc.
you can, of course, have more complex rules with more attributes like
mygroup_`@att`_`rint(@v_att.x)`__`rint(@v_att2.z)`-something
mygroup_1_4__16-something
mygroup_2_15__55-something
etc.
- Saiyawong
- Member
- 4 posts
- Joined: Oct. 2010
- Offline
blackpixelThank you so much. it's work!!
that's what the partition sop is for.
you can use a rule like this:where mygroup_ can be any string and `@att` will be replaced by the attribute value.mygroup_`@att`
or if your attribute is a float and you need to round it to an integer with rint() :>mygroup_`rint(@att)`
mygroup_1
mygroup_12
etc.
you can, of course, have more complex rules with more attributes like>mygroup_`@att`_`rint(@v_att.x)`__`rint(@v_att2.z)`-something
mygroup_1_4__16-something
mygroup_2_15__55-something
etc.
- Andr
- Member
- 899 posts
- Joined: Feb. 2016
- Offline
-
- Quick Links