Sunday, 14 August 2016

python - Programatically add polylines from existing points in QGIS



I am using QGIS 2.18 and I need help finding a python script or tool which will allow me to programmatically draw a line from existing GPS (sometimes as many as 500 or more) points that is 250 feet long at a bearing listed in an azimuth attribute field for each point.



Answer



If you don't want to use expressions you may use vector field renderer for your purposes. I created a sample data set of five points with a bearing attribute...


enter image description here


...and with field calculator added an attribute length wich defines as 2500m for each feature (you may use different length values for each or use GPS speed for the length):


enter image description here


enter image description here


Then in Layer properties | Point Style I added a symbol layer of type 'vector field renderer' in wich you can define attributes for length and angle:


enter image description here


resulting in



enter image description here


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...