Skip to content

Commit

Permalink
Align PyQt5 and PyQt6 files
Browse files Browse the repository at this point in the history
  • Loading branch information
merydian committed Nov 8, 2024
1 parent 3377209 commit 5f20931
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions python/PyQt6/core/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@ try:
wkb_type = self.wkbType()
hasM = QgsWkbTypes.hasM(wkb_type)
hasZ = QgsWkbTypes.hasZ(wkb_type)
geometry_type = self.type()

def get_xyzm_coordinates(pt):
if hasZ and hasM:
Expand All @@ -615,7 +616,6 @@ try:
return idx

if self.isMultipart():
geometry_type = self.type()
elements = [get_xyzm_coordinates(i) for i in self.vertices()]

if geometry_type == QgsWkbTypes.PointGeometry:
Expand All @@ -633,12 +633,12 @@ try:
fill_structure_with_elements(skeleton, elements)
return skeleton
else:
if self.type() == QgsWkbTypes.PointGeometry:
if geometry_type == QgsWkbTypes.PointGeometry:
return _numpy.array([get_xyzm_coordinates(i) for i in self.vertices()][0])
elif self.type() == QgsWkbTypes.LineGeometry:
elif geometry_type == QgsWkbTypes.LineGeometry:
line = self.vertices()
return _numpy.array([get_xyzm_coordinates(pt) for pt in line])
elif self.type() == QgsWkbTypes.PolygonGeometry:
elif geometry_type == QgsWkbTypes.PolygonGeometry:
skeleton = self.asPolygon()
elements = [get_xyzm_coordinates(i) for i in self.vertices()]
fill_structure_with_elements(skeleton, elements)
Expand Down
6 changes: 3 additions & 3 deletions python/core/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,9 @@ try:
QgsRasterLayer.as_numpy = _raster_layer_as_numpy

def _qgsgeometry_as_numpy(self) -> _typing.Union[_numpy.ndarray, _typing.List[_numpy.ndarray]]:
wkb = self.wkbType()
hasM = QgsWkbTypes.hasM(wkb)
hasZ = QgsWkbTypes.hasZ(wkb)
wkb_type = self.wkbType()
hasM = QgsWkbTypes.hasM(wkb_type)
hasZ = QgsWkbTypes.hasZ(wkb_type)
geometry_type = self.type()

def get_xyzm_coordinates(pt):
Expand Down

0 comments on commit 5f20931

Please sign in to comment.