Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
Byter3

Connecting points based on max distance

Hi there!

It might be a super easy thing what I'm asking, but I can't find the solution. So a I scattered a lot of points on to a geo, and I want to generate lines between the points, but only if the distance between those n number of points lower than x. I tried write it in wex based on the help, but I couldnt get to work. It might be super easy, just I'm over complicate it. Help would be very much appreciated. Thanks!

Share this post


Link to post
Share on other sites
int nearbyPts[], pt, connectingPrim;
nearbyPts = nearpoints(0, v@P, chf("range"));

foreach(pt; nearbyPts)
{
	if(pt <= @ptnum)
    	continue;
    
    connectingPrim = addprim(0, "polyline");
    addvertex(0, connectingPrim, @ptnum);
    addvertex(0, connectingPrim, pt);
}

Did that from the top of my head, but I think that should work for you.

copy paste it into an attribute wrangle running over points.

2 people like this

Share this post


Link to post
Share on other sites

Thank you so much for your help!b It does what I really need. I'm going to dig myself into wex. Can't live without knowing wex. Thanks!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0