[QGIS-Developer] QGIS 3 API - QgsVertexMarker and QgsRubberBand Inconsistency

Theuns Heydenrych theunsheydenrych at gmail.com
Mon Oct 30 04:26:56 PDT 2017


Just a quick question.
Is QgsGeometry::asPolyline() and  QgsGeometry::asPoint() also going to
change to return QgsPoint?

Regards
Theuns Heydenrych

On Thu, 26 Oct 2017 at 00:06 Nyall Dawson <nyall.dawson at gmail.com> wrote:

> On 26 October 2017 at 05:30, C Hamilton <adenaculture at gmail.com> wrote:
> > I just found that an API changed made a break with Lat Lon Tools which
> is
> > OK because I understand it is in flux.
> >
> > A while back a change was made to use QgsPointXY with QgsVertexMarker and
> > QgsRubberBand through QgsGeometry.fromPolyline(). In looking at the
> > documentation there is now a fromPolylineXY(), but from the API breaks
> > documentation it seems like the use of fromPolyline is preferred.
> >
>
> This is a perfectly valid use of fromPolylineXY - since the created
> geometry is only for display and presence of Z/M will have no effect.
>
> I think most of the purely-gui classes are now working with QgsPointXY
> (unless they've explicitly added overrides for QgsPoint objects). If
> you find a GUI/canvas class which *only* works with QgsPoint I'd say
> that's a bug and should be fixed in the API.
>
> Basically the rationale here is that we needed a really lightweight 2d
> point class (since QgsPoint is a QgsAbstractGeometry and comes with
> the associated overhead + complex api). Ideally we'd just use QPointF,
> but unfortunately QPointF uses qreal which is float on some platforms
> (and we need to be guaranteed a double for some use cases).
>
> Nyall
> _______________________________________________
> QGIS-Developer mailing list
> QGIS-Developer at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20171030/bb9e3506/attachment.html>


More information about the QGIS-Developer mailing list