Solved

find begin or end of line

  • 17 July 2020
  • 2 replies
  • 111 views

I have a line starting at (A) and ending at (B), consider it's a 50m distance

I may be at either (A) or (B). Using a nieghbourfinder , I know this line is there. How do I know at which end I am.

Please advise. Expect your feedback

 

 

Gosh, my professor always used to say to me, it all depends on which end of the stick you are in :). Now I am still trying to figure it out.

 

 

icon

Best answer by virtualcitymatt 17 July 2020, 08:47

View original

2 replies

Userlevel 5
Badge +28

You should be able to extract either the first or last coordinate of the line with a CoordinateExtractor. Use index '0' for the first index and '-1' for the last index.

 

If you know you will always be at either end of the line then you could use the NeighbourFinder on the end points rather than the line.

 

 

Badge +1

You should be able to extract either the first or last coordinate of the line with a CoordinateExtractor. Use index '0' for the first index and '-1' for the last index.

 

If you know you will always be at either end of the line then you could use the NeighbourFinder on the end points rather than the line.

 

 

To follow along on this, because the coordinateExtractor is definitely the way to go: Do you know that the coordinate you have ("Where you are") is exactly the same as the endpoint? If so, you could probably avoid using the neighborfinder and get better speed with other, more direct, comparisons. Also, if you're guaranteed to be in either end, you can test for just one and if not -> assume the other. That should also help with the speed.

Reply