Skip to main content
Solved

How to determine position of one feature in relation to another?

  • January 11, 2019
  • 3 replies
  • 150 views

Forum|alt.badge.img

Hello,

I have 2 Shape files, one point, other line. I need to determine on which side of the line point feature is located. I need to take only points that are within 5m of line. For every point I need to add new attribute that will allow me later to separate right and left.

Orientation of the line is determined by start and end point of the line.

This is way out of my league so I need Your help.

Best answer by luckym

@david_r and @redgeographics I think i have a solution. Using only LeftRightSpatialCalculator gave me mix of results because it calculated side for every line in data set. But then I had an idea to use NeighborFinder to attach unique ID of lines to points that are closest to them, then in LeftRightSpatialCalculator i Group by that ID and at first glance I think I have right results. I am attaching my workspace and test data set so anyone can inspect it. leftright.fmw Test_Data.zip

View original
Did this help you find an answer to your question?

3 replies

david_r
Evangelist
  • January 11, 2019

There is the LeftRightSpatialCalculator that might warrant a look.

Otherwise the NeighborFinder is a good contender, you could use e.g. look at the difference between _closest_base_x and _closest_candidate_x to determine the east-west direction (negative or positive result), and the _closest_base_y and _closest_candidate_y for the north-south direction.

To account for orientation, you could split up any polylines into single line segments (Chopper, vertex=2) and then use the HorizontalAngleCalculator to find the azimuth of each segment.


redgeographics
Celebrity
Forum|alt.badge.img+48

I don't have time to dive into this right now (though I'd love to) but...

There's a custom transformer called the HorizontalAngleCalculator, which calculates the angle of a line. Then the NeighborFinder (putting in the lines as base features and the points as candidates) can calculate the angle from the base to the candidate. The difference between those two angles should give you an indication of left/right.


Forum|alt.badge.img
  • Author
  • Best Answer
  • January 11, 2019

@david_r and @redgeographics I think i have a solution. Using only LeftRightSpatialCalculator gave me mix of results because it calculated side for every line in data set. But then I had an idea to use NeighborFinder to attach unique ID of lines to points that are closest to them, then in LeftRightSpatialCalculator i Group by that ID and at first glance I think I have right results. I am attaching my workspace and test data set so anyone can inspect it. leftright.fmw Test_Data.zip


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings