The NeighborFinder can be set to use a list to find multiple objects.
It will also list the angle where it found the object.
Then you can select from the list (after sorting by distance) the first that matches the required angle).
Hope this helps.
Unfortunately I do not think that would solve my problem. None of the target lines are straight. And I believe that the NeighborFinder would return the nearest point to the base for each line? So it would be quite unlikely that any of these would be exactly the same as the bearing from the point object.
I'm afraid that many users including me do not understand correctly what "bearing/heading" means. Could you please describe the requirement in plain words? It would be ideal if you could post screenshots illustrating desired spatial relations between the point and target line.
I would take your point and create an arbitrary long line along the bearing. Send the new line and the reference lines to a LineOnLineOverlayer. Then a SpatialFilter to get the line segment that intersects the original point.
That line segment will now have the attributes of the line that intersected it, which is the first line along your heading.
Caveat: the analysis would have to be run on a per point basis, as otherwise the first intersecting line might be from another point instead of a reference line.
I'm afraid that many users including me do not understand correctly what "bearing/heading" means. Could you please describe the requirement in plain words? It would be ideal if you could post screenshots illustrating desired spatial relations between the point and target line.
These are nautical terms i suppose, and I understand your confusion since I used them a bit carelessly. What I am after is the heading of my point object, the direction my nose would point if I was standing in that spot and rotated the same direction as the point object. What I would like to know is what I will "hit" if I start "walking" straight forward, following my nose, in the same direction as the rotation attribute.
So I have a point object with a rotation value. I then draw a imaginary line from that point at the same angle as the rotation. I would like to know which object out there my imaginary "heading line" touches first.
(A bearing is the angle from ones heading to a object eg a lighthouse or another boat. In this case they are kind of the same, but that is usually not the case, so sorry about any confusion)
Hi @aron, thanks for your additional description. I got it.
My idea is:
- Counter x 2: Add unique ID (e.g. "_point_id") to the source points; add unique ID (e.g. "_line_id") to the target lines.
- CoordinateExtractor (Mode: Specify Coordinate, Coordinate Index: 0): Extract coordinates (_x, _y) of the source points.
- VertexCreator (Mode: Add Point, X Value: _x + <maximum distance>, Y Value: _y): Transform each point to a horizontal line. Here, the <maximum distance> is the distance within which you are going to find a neighboring line.
- Rotator (Rotation Angle: <rotation angle>, X Origin: _x, Y Origin: _y): Rotate the line around the coordinates of the source point in order to head the line to the "heading" direction.
- Intersector (Accumulation Mode: Merge Attributes): Send both the target lines and the rotated lines to the Intersector together.
- Tester: Select the Node (point) features which have both "_point_id" and "_line_id". The resulting features would be the intersections between the target lines and the rotated lines.
- NeighborFinder (Group By: _point_id, Number of Neighbors to Find:1, Maximum Distance: <maximum distance>): Send the source points (having "_point_id") to the Base port and send the intersections (having both "_point_id" and "_line_id") to the Candidate port. The features output via the Matched port would have "_line_id" of the closest line crossing the imaginary line drawn in the "heading" direction from the base point.
Hi @aron, thanks for your additional description. I got it.
My idea is:
- Counter x 2: Add unique ID (e.g. "_point_id") to the source points; add unique ID (e.g. "_line_id") to the target lines.
- CoordinateExtractor (Mode: Specify Coordinate, Coordinate Index: 0): Extract coordinates (_x, _y) of the source points.
- VertexCreator (Mode: Add Point, X Value: _x + <maximum distance>, Y Value: _y): Transform each point to a horizontal line. Here, the <maximum distance> is the distance within which you are going to find a neighboring line.
- Rotator (Rotation Angle: <rotation angle>, X Origin: _x, Y Origin: _y): Rotate the line around the coordinates of the source point in order to head the line to the "heading" direction.
- Intersector (Accumulation Mode: Merge Attributes): Send both the target lines and the rotated lines to the Intersector together.
- Tester: Select the Node (point) features which have both "_point_id" and "_line_id". The resulting features would be the intersections between the target lines and the rotated lines.
- NeighborFinder (Group By: _point_id, Number of Neighbors to Find:1, Maximum Distance: <maximum distance>): Send the source points (having "_point_id") to the Base port and send the intersections (having both "_point_id" and "_line_id") to the Candidate port. The features output via the Matched port would have "_line_id" of the closest line crossing the imaginary line drawn in the "heading" direction from the base point.
This screenshot illustrates my intention.