3

I am new to QGIS and barely getting the hang of it so this question is quite simple. I have a route in a GPX file a generated from a PPK I took along the shore during a high tide. I would like to generate transects perpendicular to this track with a spacing of, lets say every 5 m and a length of 20 m each. Any suggestions as to what pluggin or tool I may use to delimit this area?

3

QGIS 3.0

(1) Run Densify by interval and set interval to 5.0 meters.

enter image description here


[EDIT] following comment by @ndawson;

(2) There is a new geoalgorithm Transect (QGIS 3.0 Vector geometry).

Just activate this tool and set length to 20 and Angle to 90, then select left, right, or both.

enter image description here


Below... useless part... please ignore...

(2) Run Extract vertices on the Densified layer.

enter image description here

(3) Open the attribute table of Vertices layer to see if there is angle field. (You can skip this).

enter image description here

(4) Start Geometry by expression and (aa) Select Vertices as input layer, (bb) Select Line as output geometry and (cc) Click on large epsilon mark.

enter image description here

(5) Enter this expression:

make_line($geometry, translate(translate($geometry, 20, 20), 
                                         20*cos(radians("angle"+90)), 
                                         20*sin(radians("angle"+90))))

enter image description here

Final output is like the above... sorry, line length are not kept at 20m. Hopefully this gets you started.

  • 1
    In 3 there's actually a transect lines algorithm built in - this saves all the manual expression based steps – ndawson Apr 25 '18 at 2:33
  • Oops! I did it again... Thanks so much @ndawson Will update my post. – Kazuhito Apr 25 '18 at 3:20
  • Wow, super useful! I will give it a try. Thanks for the step by step explanation! – dmct.92 Apr 25 '18 at 18:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.