Jump to content

access @ptnum from second wrangle input?


Recommended Posts

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


 

Link to comment
Share on other sites

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 by Atom
Link to comment
Share on other sites

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 by j00ey
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...