bonassus Posted November 6, 2018 Share Posted November 6, 2018 How can I access the ptnum of the points coming in though the second input of of a wrangle? I tried to do it with a point expression but i don't know what to put for the atttibute_name. s@name = point(1,"ptnum", @ptnum); I want to concat the second input's point ptnum with the first input's name attribute after a copy to points sop. the copy and transform sop creates a copynum attribute which works to rename copies. but copytopoints doesn't How can i do this? thanks Quote Link to comment Share on other sites More sharing options...
Atom Posted November 6, 2018 Share Posted November 6, 2018 (edited) The result of this point call would be an integer. So try... int local_ptnum = point(1,"ptnum"@ptnum); s = s@name; s@name = sprintf("%s_%03d",s,local_ptum); This will zero pad the point number by 3 digits. Edited November 6, 2018 by Atom Quote Link to comment Share on other sites More sharing options...
forton Posted November 7, 2018 Share Posted November 7, 2018 Hi, There's a comma missing after the first "ptnum". Quote Link to comment Share on other sites More sharing options...
j00ey Posted November 7, 2018 Share Posted November 7, 2018 (edited) I'm perhaps misunderstanding the question but if you lookup the point number of a point in another geometry using @ptnum, it's always just going to give you the same value back, no? You're basically saying 'what is the point number of the point numbered @ptnum' *edit* Besides, I don't think you can look up point number. You could give the geo in input 1 an id attribute to mirror the point number and look that up, but still if you say 'what's the id of the point with number 3' it's just going to return 3. Edited November 7, 2018 by j00ey Quote Link to comment Share on other sites More sharing options...
bonassus Posted November 7, 2018 Author Share Posted November 7, 2018 Thanks for all the responses. Sorry for the confusing question. The answer was obvious after taking a break. I only had to: @id = @ptnum; before the second input and then s@name = concat(s@name,"_copy_"+itoa(+@id)); after the copytopoints. Quote Link to comment Share on other sites More sharing options...
bonassus Posted November 8, 2018 Author Share Posted November 8, 2018 On 11/6/2018 at 4:50 PM, Atom said: int local_ptnum = point(1,"ptnum"@ptnum); s = s@name; s@name = sprintf("%s_%03d",s,local_ptum); This will zero pad the point number by 3 digits. Atom, thanks for the sprintf tip. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.