I have a vector layer of points and I need to perform an analysis that allows me to differentiate the direction of travel and the trip number.
I thought of two ways to develop the solution but I’m having difficulty implementing them:
analysis 1: I created a column “inter_buff”, “true” values are for points that are within a 30 meter radius of terminals P1 and P2 and “false” for points that are not contained within the 30 meter radius.
The analysis must be sequential at each point according to the ordering of the “order” column, if the value of the “inter_buff” column is “false”, the value in the “nov_direction” column must be equal to 0 until the sequential value of the “inter_buff” column is “true”, the value of the “nov_direction” column will be equal to 1 until the next corresponding value of the “inter_buff” column is “true” again.
analysis 2: The analysis of the points must be sequential according to the ordering of the “order” column based on the radius of the geographic location of P1 and P2, if the Latitude and Longitude value of the point is within a radius of 30 meters of Point A, the value in the “nov_direction” column will be 0 until it reaches the radius of 30 meters of Point B, where the value of the “nov_direction” column will be 1 until it reaches Point A again.
enter image description here
Is there a way to run it using the Qgis field calculator or Python?
LF2112 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.