Skip to content

[processing][feature] Add "Force polygons clockwise" (native:forcecw) and "Force polygons counter-clockwise" (native:forceccw) algorithms (Request in QGIS) #10695

@qgis-bot

Description

@qgis-bot

Request for documentation

From pull request qgis/QGIS#64668
Author: @agiudiceandrea
QGIS version: 4.0

[processing][feature] Add "Force polygons clockwise" (native:forcecw) and "Force polygons counter-clockwise" (native:forceccw) algorithms

PR Description:

Description

This PR adds the "Force polygons clockwise" (native:forcecw) and the "Force polygons counter-clockwise" (native:forceccw) processing algorithms.

"Force polygons clockwise" (native:forcecw), which is based on QgsGeometry::forcePolygonClockwise(), forces polygon geometries to respect the convention where the exterior ring is oriented in a clockwise direction and the interior rings in a counter-clockwise direction.
It has the same behaviour of the already existing "Force right-hand-rule" (native:forcerhr) which is based on QgsGeometry::forceRHR() which in turn is based on QgsGeometry::forcePolygonClockwise() too.

"Force polygons counter-clockwise" (native:forceccw), which is based on QgsGeometry::forcePolygonCounterClockwise(), forces polygon geometries to respect the convention where the exterior ring is oriented in a counter-clockwise direction and the interior rings in a clockwise direction.

Following the approach used in qgis/QGIS#45718, this PR also adds a note in the "Force right-hand-rule" algorithm short help recommending to use the new "Force polygons clockwise" algorithm instead.

Some tests have been added.

Fixes qgis/QGIS#45723.

Commits tagged with [need-docs] or [FEATURE]

Metadata

Metadata

Assignees

No one assigned

    Labels

    4.0QGIS 4.0 new featuresProcessing Alg(Features of) An algorithm. Use the Help button in the application to find the page.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions