Skip to content

Commit

Permalink
Use QByteArray.data() for as_shapely
Browse files Browse the repository at this point in the history
  • Loading branch information
merydian committed Sep 12, 2024
1 parent d98d540 commit f60bf29
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions python/PyQt6/core/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,7 @@ try:

def _geometry_as_shapely(self) -> _shapely.geometry.base.BaseGeometry:
wkb_qbytearray = self.asWkb() # Get the geometry in WKB format (QByteArray)
wkb_bytes = bytes(wkb_qbytearray)
shapely_geom = _shapely.from_wkb(wkb_bytes)
shapely_geom = _shapely.from_wkb(wkb_qbytearray.data())

return shapely_geom

Expand Down
3 changes: 1 addition & 2 deletions python/core/__init__.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -644,8 +644,7 @@ try:

def _geometry_as_shapely(self) -> _shapely.geometry.base.BaseGeometry:
wkb_qbytearray = self.asWkb() # Get the geometry in WKB format (QByteArray)
wkb_bytes = bytes(wkb_qbytearray)
shapely_geom = _shapely.from_wkb(wkb_bytes)
shapely_geom = _shapely.from_wkb(wkb_qbytearray.data())

return shapely_geom

Expand Down

0 comments on commit f60bf29

Please sign in to comment.