Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
37 additions
and
0 deletions.
-
+18
−0
python/core/auto_generated/qgsfeature.sip.in
-
+19
−0
src/core/qgsfeature.h
|
@@ -333,6 +333,24 @@ Set the feature's geometry. The feature will be valid after. |
|
|
Set the feature's ``geometry``. Ownership of the geometry is transferred to the feature. |
|
|
The feature will be made valid after calling this method. |
|
|
|
|
|
This method is a shortcut for calling: |
|
|
.. code-block:: python |
|
|
|
|
|
feature.setGeometry( QgsGeometry( geometry ) ) |
|
|
|
|
|
* Example: |
|
|
.. code-block:: python |
|
|
|
|
|
# Sets a feature's geometry to a point geometry |
|
|
feature.setGeometry( QgsPoint( 210, 41 ) ) |
|
|
print(feature.geometry()) |
|
|
# output: <QgsGeometry: Point (210 41)> |
|
|
|
|
|
# Sets a feature's geometry to a line string |
|
|
feature.setGeometry( QgsLineString( [ QgsPoint( 210, 41 ), QgsPoint( 301, 55 ) ] ) ) |
|
|
print(feature.geometry()) |
|
|
# output: <QgsGeometry: LineString (210 41, 301 55)> |
|
|
|
|
|
.. seealso:: :py:func:`geometry` |
|
|
|
|
|
.. seealso:: :py:func:`clearGeometry` |
|
|
|
@@ -349,6 +349,25 @@ class CORE_EXPORT QgsFeature |
|
|
/** |
|
|
* Set the feature's \a geometry. Ownership of the geometry is transferred to the feature. |
|
|
* The feature will be made valid after calling this method. |
|
|
* |
|
|
* This method is a shortcut for calling: |
|
|
* \code{.py} |
|
|
* feature.setGeometry( QgsGeometry( geometry ) ) |
|
|
* \endcode |
|
|
* |
|
|
* * Example: |
|
|
* \code{.py} |
|
|
* # Sets a feature's geometry to a point geometry |
|
|
* feature.setGeometry( QgsPoint( 210, 41 ) ) |
|
|
* print(feature.geometry()) |
|
|
* # output: <QgsGeometry: Point (210 41)> |
|
|
* |
|
|
* # Sets a feature's geometry to a line string |
|
|
* feature.setGeometry( QgsLineString( [ QgsPoint( 210, 41 ), QgsPoint( 301, 55 ) ] ) ) |
|
|
* print(feature.geometry()) |
|
|
* # output: <QgsGeometry: LineString (210 41, 301 55)> |
|
|
* \endcode |
|
|
* |
|
|
* \see geometry() |
|
|
* \see clearGeometry() |
|
|
* \since QGIS 3.6 |
|
|
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session.
You signed out in another tab or window. Reload to refresh your session.