-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Transfer first z or m value to point #43060
Transfer first z or m value to point #43060
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
If you wanted to make it super-flexible you could make the new method accept an iterator begin/end argument instead of QgsPointSequence, so that we could potentially call it on other point structures (such as the QgsGeometry vertex iterator) without the added expense of translating those to QgsPointSequence.
Probably not a big factor here, but something to keep in mind for future api additions which are designed to work with larger number of input points.
This reverts commit 739e6d5.
Gentle ping @nyalldawson 😊 |
Using a generic iterator was indeed a good idea! Code looks good to me. |
Hi @lbartoletti, While not strictly being a new feature, this PR is not really a bugfix either. Can we target this for 3.22? And sorry for not having merged sooner... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fantastic to me. I think this is safe to merge for 3.20
Nice 🎉! |
Thanks @nyalldawson @pblottiere 🙏 |
Follow up qgis#42812, qgis#42986 and qgis#43060 Co-authored-by: Antoine Facchini <antoine.facchini@oslandia.com>
Description
This PR is the continuation of the #42812 (comment). It adds a method for adding the Z and the M from a
QgsPointSequence
. It is equivalent to using thetransferFirstZValueToPoint
andtransferFirstMValueToPoint
methods but avoid looping twice.It is used in the QgsCircle, QgsEllipse, QgsTriangle classes. Three other dedicated PR will complete and add tests on these classes using this method.
Sponsored by: Métropole Européenne de Lille @Jean-Roc