Skip to main content

Hi All, i've a dataset of points along a road network. What i'd like to do is either :

 

  1. Get the specific travel direction for each point using the angle from the previous point(NW, S, etc)
  2. or Get an overall direction for all points by merging the points of the same road(road_name) and getting the direction of the subsequent line

Each points id is incremented so i can tell the order, i'm just not sure how to go about it.pointdirection 

For Option 2 i have tried a LineBuilder -> HorizontalAngleCalculator with some success but i'm seeing inconsistencies with lines that should be the same. Still the same when I tried using a sorter first to make sure the start and end points were arriving in order sorting by ID.

line_orientation

I think you're on the right track for option 2, but some segments may be flipped by the LineBuilder, hence the 180-degree difference. Perhaps you can use the NetworkFlowOrientor to set this right before calculating the angle.


Like @Hans van der Maarel​ says, the lineBuilder is probably the better option.

However if you want to keep the point dataset as points, the way I would approach it is to use a NeighborFinder in Candidates Only, grouped by road_name, with a Number of Neighbors to Find set to 2, and Generate a List.

You can then check the point id to see which is the next point (as opposed to the proceeding point) and use the corresponding _angle attribute. Note that this will be the cartesian angle (CCW from x-axis), not the azimuthal angle.

 To convert you can use the expression @fmod(450-@Value(_angle),360)

 


@kieranmg​  If your records are in order, try the AttributeCreator Adjacent Feature Attributes. This will allow you to get the coordinates of the next point, then use the FME HUB transformer HorizontalAngleCalculator 


All great replies thank you gentlemen


Reply