Hi all

On Mon, Apr 1, 2019 at 1:16 PM Raymond Nijssen <[email protected]> wrote:
>
> Last HF martin and I discussed the current geometry model and some of
> the flaws and weird things. Especially the set() and get() are not very
> logical function names to me.

Just to add more thoughts to this... There is obviously a lot of
confusion regarding geometry API in QGIS since the big refactoring.
Things like QgsGeometry vs QgsAbstractGeometry ... or QgsPoint vs
QgsPointXY. I would say some bits are fixable without too much effort
(e.g. add some missing convenience constructors), but most bits will
need to wait until QGIS 4.0 (e.g. getting rid of methods
accepting/returning QgsPointXY within geometry API).

One idea that I wanted to explore is whether we could avoid having
QgsGeometry in the Python API at all, so it would be a mapped type
like QVariant is in PyQt5. So for example, feat.geometry() would
return directly QgsPoint or QgsLineString. This would avoid the need
to extract the internal geometry object from QgsGeometry and vice
versa (wrap internal geometry object into QgsGeometry). I have not
tried it in practice yet though and it will definitely be an API
break, but if it works, it should simplify things a lot :-)

Cheers
Martin
_______________________________________________
QGIS-Developer mailing list
[email protected]
List info: https://lists.osgeo.org/mailman/listinfo/qgis-developer
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to