[GIS] Determining direction of polygons using QGIS

directionlinepolygonqgis

enter image description here Is it possible to get the direction of the longest side of a rectangle, in Qgis?

Is it possible to get the direction of the longest side of a rectangle in QGIS?

I know how to get the direction of a line layer. But I need to know the direction of a polygon. One could start at the center of a polygon and find the shortest way to the border by using a line and take the direction of this line, but I don't know how to draw this line automatically for 30000 polygons.

Best Answer

If you run the "Oriented Minimum Bounding Box" algorithm over your layer, you'll get a new angle field in your layer which indicates the angle of this minimum bounding box. I suspect that's what you require.

Related Question