qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.43k stars 2.98k forks source link

Add force_polygon_cw and force_polygon_ccw processing algorithms #45723

Open pathmapper opened 2 years ago

pathmapper commented 2 years ago

Feature description

Add force_polygon_cw_ and force_polygon_ccw processing algorithms.

Additional context

https://github.com/qgis/QGIS/pull/45718 adds these for expression functions.

from https://github.com/qgis/QGIS/pull/45718#issue-1039099190:

These are recommended for use instead of the existing force_rhr function, due to the variability in definition of the "right hand rule" between different software applications. Using an explicit force_polygon_cw/ccw function removes user confusion when the results vary between different applications.

(Note that this matches PostGIS' recommendations now: see https://postgis.net/docs/ST_ForceRHR.html )

Same user confusion exists for the existing native:forcerhr alg.

Also there's currently no ccw alg for use in e.g. processing models.

kannes commented 2 years ago

For now you can use the Geometry by Expression processing algorithm to use those in an expression.