I am trying to connect points in a vector layer. Each point should be connected to its nearest neighbour that is not inside the same polygon. I am using the ProcessX "nearest point to path" function, but I didn't find a proper expression. The points have an attribute with the name of the Polygon, which I wanted to use for that.
Looking at the figure: The whole idea is to separate the yellow areas (roads) at each crossing in case someone has a better idea.