Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Z and M values accessible via QgsGeometry.as_numpy() #59367

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

merydian
Copy link
Contributor

@merydian merydian commented Nov 7, 2024

Description

Currently QgsGeometry.as_numpy() only returns coordinates as xy. This change makes z and m values accessible too, so that coordinates of geometries with z and/or m values will be returned as xyz, xym or xyzm, depending on the case.

Related to #58589.

@github-actions github-actions bot added this to the 3.42.0 milestone Nov 7, 2024
Copy link

github-actions bot commented Nov 7, 2024

🪟 Windows builds

Download Windows builds of this PR for testing.
Debug symbols for this build are available here.
(Built from commit 5f20931)

🪟 Windows Qt6 builds

Download Windows Qt6 builds of this PR for testing.
(Built from commit 5f20931)

python/PyQt6/core/__init__.py.in Outdated Show resolved Hide resolved
[_numpy.array([[pt.x(), pt.y()] for pt in ring]) for ring in polygon]
for polygon in self.asMultiPolygon()
]
geometry_type = self.type()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that variable can be moved before line 617, and used in the else block of lines 636 to 645

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants