Skip to content
Permalink
Browse files
readd qgsgeometry method
  • Loading branch information
lbartoletti authored and nyalldawson committed Jun 9, 2021
1 parent da7c614 commit ba409e08323380f98f6bd11dd55097b8cc42092f
Showing with 43 additions and 0 deletions.
  1. +22 −0 python/core/auto_generated/geometry/qgsgeometryutils.sip.in
  2. +21 −0 src/core/geometry/qgsgeometryutils.h
@@ -832,6 +832,28 @@ looping twice over the set of points.
points whose z or m value is closest to the original x/y point, but only the first one found.


.. versionadded:: 3.20
%End

static bool transferFirstZOrMValueToPoint( const QgsGeometry &geom, QgsPoint &point );
%Docstring
A Z or M dimension is added to ``point`` if one of the points in the list
``points`` contains Z or M value.

This method is equivalent to successively calling Z and M but avoiding
looping twice over the set of points.

:param geom: geometry in which a M point is searched.
:param point: The point to update with Z or M dimension and value.

:return: ``True`` if the point is updated, ``False`` otherwise

.. warning::

This method does not copy the z or m value of the coordinate from the
points whose z or m value is closest to the original x/y point, but only the first one found.


.. versionadded:: 3.20
%End

@@ -889,6 +889,27 @@ class CORE_EXPORT QgsGeometryUtils
return QgsGeometryUtils::transferFirstZOrMValueToPoint( points.constBegin(), points.constEnd(), point );
}

/**
* A Z or M dimension is added to \a point if one of the points in the list
* \a points contains Z or M value.
*
* This method is equivalent to successively calling Z and M but avoiding
* looping twice over the set of points.
*
* \param geom geometry in which a M point is searched.
* \param point The point to update with Z or M dimension and value.
* \returns TRUE if the point is updated, FALSE otherwise
*
* \warning This method does not copy the z or m value of the coordinate from the
* points whose z or m value is closest to the original x/y point, but only the first one found.
*
* \since QGIS 3.20
*/
static bool transferFirstZOrMValueToPoint( const QgsGeometry &geom, QgsPoint &point )
{
return QgsGeometryUtils::transferFirstZOrMValueToPoint( geom.vertices_begin(), geom.vertices_end(), point );
}

/**
* Returns the point (\a pointX, \a pointY) forming the bisector from segment (\a aX \a aY) (\a bX \a bY)
* and segment (\a bX, \a bY) (\a dX, \a dY).

0 comments on commit ba409e0

Please sign in to comment.