Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed closestSegmentWithContext() params in Python #5755

Closed
wants to merge 2 commits into from

Conversation

blazek
Copy link
Member

@blazek blazek commented Nov 28, 2017

Missing QgsGeometry.closestSegmentWithContext() in Python bindings.

@nyalldawson nyalldawson reopened this Nov 28, 2017
@nyalldawson
Copy link
Collaborator

@blazek I've noticed something very inconsistent here - QgsGeometry::closestSegmentWithContext < 0 for points to the right and > 0 for points to the left, yet QgsGeometryUtils::leftOfLine uses < 0 for left and > 0 for right.

Additionally, QgsAbstractGeometry::closestSegment uses a bool for leftOf - which means that the case when leftOf is 0 from QgsGeometryUtils::leftOfLine is treated as "point to the right", instead of the correct "unknown" intrepretation (e.g. point exactly on a line). I think we need to fix all these methods to use an int for leftOf, with a consistent < / > 0 behaviour.

@nyalldawson
Copy link
Collaborator

Superseded by #5758

@blazek
Copy link
Member Author

blazek commented Nov 29, 2017

I have just fixed the documentation of QgsGeometry::closestSegmentWithContext to what it really returns. Originally it was also < 0 for left and > 0 for right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants