Wednesday, 22 August 2018

Workflow for creating line features between two coordinate pairs in QGIS


I have a table of stream reaches with XY coordinates for their respective tops and bottoms.


I'd like to convert the table to a feature, using the XY coordinates as the endpoints of the line.



Any suggestions as to the best workflow for doing this would be fantastic. I've Googled, but either my vocabulary is off or this isn't a task that's given others much trouble.



Answer



The Points2One Plugin might be helpful here. Your data will have to be in the following format:


id,      order, x,       y
stream1, 1, x_start, y_start
stream1, 2, x_end, y_end
stream2, 1, x_start, y_start
stream2, 2, x_end, y_end

After loading a file like this, you should get four points displayed. In Points2One Plugin, you can chose that points should be connected to lines grouped by the "id" value and sorted by the "order" value.



No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...