I have a gps file that I have converted to csv, I would like to convert a longitude/latitude to linestring if the next row have a diferent longitude/latitude (if the car mooved) and if not convert it to points.
I know how to convert a longitude/latitude but how can I do this test?
If possible with a script for qgis
What I would like to do automatically, is add to qgis two layer (points and lines with the same column as the .xlsx) or create two csv (again, points and the other file, lines). Like this two pictures:
and
To resume… I'm trying to get the result of those images in csv using the .xlsx via pyqgis to have one layer points (car stoped) and one layer polylines (car mooved).
Best Answer
When you read the CSV file into a Qgis layer, you can iterate over the features and apply some processing like this:
This simple CSV file (columns STATUS, GEOM for explanation only):
gives this result (2 routes, 5 stops):