Question

2D Vector Calculator


Hello everyone,

 

 

i got an issue, i have 2 database full of points. in one are centre points and in the other are several points around them. now i want to connect the points around, with with single centre points. so i used the neighbor tool to get the distance and angle from the closest candidate to base. so actually i got angle and distance and instead of connecting them, i wanted to use the 2dvectorcalculator to just generate the vector with the distance and angle.

 

but for some reason it doesnt work. i will post a picture of my settings.

 

i would be glad if someone can tell me my mistake.

 

 


10 replies

Userlevel 2
Badge +17
Hi,

 

 

The 2DVectorCalculator calculates x/y components of a vector which direction is defined by two existing vertices of the input geometry.

 

The transformer will not replace a point with a line segment, and it will fail to calculate if the input geometry is a point (number of vertices is one).

 

I think that's the reason for the failure.

 

 

Maybe you are going to create line segments, each of which connects a Base point and the closest Candidate point. Isn't it?

 

If so, the 2DVectorCalculator is not suitable. Consider using the VertexCreator instead.

 

Mode: Add Point

 

X Value: _closest_candidate_x

 

Y Value: _closest_candidate_y

 

 

Takashi
Userlevel 2
Badge +17
If you need to calculate x, y components of the vector from a Base to the closest Candidate, it may be simple to use the AttributeCreator.

 

 

Enter the expressions with the Arithmetic Editor.

 

 

Anyway, I think the 2DVectorCalculator is not suitable to this case.
Badge +3
If u executed the neighbourfinder, don't you already have all the parameters for the vector?

 

 

You don't need to execute anything else.

 

If you need to create the vector (in place and not at the origin) all you need to do is use 2 vertexcreators. Candidate as a "replace with point" and bases as "add point".
thanx a lot!

 

it worked very well with the vertexcreator! awesome, still need more to understand the logic and differences between these tools.

 

 

right now im trying to find lines which are touching the same polygon, and then to aggregate them to one line in the middle.

 

 

working on it now, but if somebody got a hint, would be most welcome :)

 

 

Badge +3
Spatialrelator can be used for that.

 

 

Polygon to Requestor port and lines to supplier.

 

Test clause set to TOUCH (you might need some tolerance for that. like slight buffer around polygon or extent line somewhat and test for cross.).

 

candidates list will hold ID of lines that TOUCHES the polygon.

 

 

Explode the list and FeatureMerge to the lines based on line_ID.

 

If the lines are paralel like in your picture, you can use the touched region of the polygon to create a area out of the lines, more then two lines will need a Dissolver. Then u can create a centerline with the centreline replacer.

 

 

 
Ok with the Areabuilder and centerlinereplacer it is very easy to generate the centre lines. the only problem now, is to find these two lines that are touching two times inside these squares.
thx gio for the hint,

 

 

i tried that before, but the problem is, i only need the centre line of lines that start and end in the same box. with this relator i can only check relation with one polygone or?

 

 

i went now to get all the end and start coordinates of the lines and want to compare, if two lines have the same start and end points (x, y) then he shall build area.
Hello again everyone.

 

 

so i continued a bit and as i said i tried to get the center line of two lines starting and ending in the same box (two different).

 

 

so i extracted the end and starting coordinates of all lines, merged and compared them, to find two lines with the same starting and end box. then i clipped the needed lines from the box and made an a polygone with the areabuilder. in my picture the area is the green part, which is exactly what i want.

 

 

so far so good, not i used the centerline replacer. the problem is the result is not exactly what i need. so the picture to show my problem. the lines should touch boxes. another thing is i also cant extend the center lines.

 

 

anyone got an idea?

 

 

damn gio sry, i always post smth and few seconds later it tells me you posted smth.

 

 

thank you for your advises. this now seems to be my last problem.

 

 

the center lines also should hit the box in the center and not as its marked, i dont understand why he only does it sometimes.
Userlevel 2
Badge +17
How about changing the order of the processes?

 

1. create polygon from the associated lines.

 

2. create center line of the polygon.

 

3. clip the center line by the boxes.

Reply