4

I have a shapefile of an airport that outlines the runway area. I want to take this shapefile with the runway area and create a single line that extends out 5-10 miles out each direction. I have tried extracting the nodes and I have tried to convert to lines.

The photo you will see the shapefile in yellow and the desired effect is in red

enter image description here

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
nabpp
  • 63
  • 6

1 Answers1

8

Use this expression with Geometry generator or Geometry by expression (see here for details about these two options). The value 10000 is the length of the line to both sides form the centroid of the polygon: change this value if needed:

extend (
    make_line (
        centroid ($geometry),
        project (
            centroid($geometry),
            10000,
            radians(main_angle( $geometry))
        )
    ), 
    10000, 
    0
)

The solution using Geometry generator enter image description here

Babel
  • 71,072
  • 14
  • 78
  • 208