File tree 2 files changed +10
-6
lines changed 2 files changed +10
-6
lines changed Original file line number Diff line number Diff line change 742
742
743
743
QgsGeometry.as_shapely = _geometry_as_shapely
744
744
745
- def _geometry_from_shapely(shapely_geom) -> QgsGeometry:
745
+ @staticmethod
746
+ def _geometry_from_shapely(shapely_geom: _sg.base.BaseGeometry) -> QgsGeometry:
746
747
geom = QgsGeometry()
747
748
geom.fromWkb(shapely_geom.wkb)
748
749
@@ -756,7 +757,8 @@ except ModuleNotFoundError:
756
757
757
758
QgsGeometry.as_shapely = _geometry_as_shapely
758
759
759
- def _geometry_from_shapely(self):
760
+ @staticmethod
761
+ def _geometry_from_shapely(shapely_geom):
760
762
raise QgsNotSupportedException('QgsGeometry.from_shapely is not available, shapely is not installed on the system')
761
763
762
764
QgsGeometry.from_shapely = _geometry_from_shapely
@@ -805,5 +807,5 @@ Creates a new geometry from a shapely object.
805
807
806
808
:raises QgsNotSupportedException: if shapely is not available on the system
807
809
808
- .. versionadded:: 3.42
810
+ .. versionadded:: 3.44
809
811
"""
Original file line number Diff line number Diff line change 753
753
754
754
QgsGeometry.as_shapely = _geometry_as_shapely
755
755
756
- def _geometry_from_shapely(shapely_geom) -> QgsGeometry:
756
+ @staticmethod
757
+ def _geometry_from_shapely(shapely_geom: _sg.base.BaseGeometry) -> QgsGeometry:
757
758
geom = QgsGeometry()
758
759
geom.fromWkb(shapely_geom.wkb)
759
760
@@ -767,7 +768,8 @@ except ModuleNotFoundError:
767
768
768
769
QgsGeometry.as_shapely = _geometry_as_shapely
769
770
770
- def _geometry_from_shapely(self):
771
+ @static_method
772
+ def _geometry_from_shapely(shapely_geom):
771
773
raise QgsNotSupportedException('QgsGeometry.from_shapely is not available, shapely is not installed on the system')
772
774
773
775
QgsGeometry.from_shapely = _geometry_from_shapely
@@ -815,5 +817,5 @@ Creates a new geometry from a shapely object.
815
817
816
818
:raises QgsNotSupportedException: if shapely is not available on the system
817
819
818
- .. versionadded:: 3.42
820
+ .. versionadded:: 3.44
819
821
"""
You can’t perform that action at this time.
0 commit comments