-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Impossible to calculate the area of a polygon using the formula $area #57362
Comments
OSGeo4W win 11 proI did a test with QGIS 3.34.6 AND 3.36.2, it works! 2024-05-08_08h27_10.mp4 |
Preview works as in your screencast, but the actual calculation of the field values returns nulls. |
it works for me 2024-05-08_11h09_14.mp4 |
Now I'm confused, it works for me too! |
My gut feeling -- the crs is set incorrectly for the dataset, or it's using a crs which isn't valid for the actual area containing features. |
The problem initially occurred in versions installed through OSGeo4W. A complete reinstallation of all components didn't help. I also tried installing the latest version from the standalone .msi file, but the problem persisted. I conducted tests with different layers, in different coordinate systems, and with various projects. Importantly, the area is calculated correctly using area($geometry). |
This crossed my mind, but the preview displayed a value before clicking ok... |
Ok, let's close until a reproducible workflow is available |
@alexCCI can you share a project/data where you can replicate this? |
In the end, you were right. The layer I was trying to work with had a personalized coordinate system without an EPSG code. I apologize for the inconvenience. |
What is the bug or the crash?
It's impossible to calculate the area of a polygon using the formula $area, it returns a 'NaN' value. However, it remains functional when using geometric functions like area($geometry). The same applies to the perimeter.
Steps to reproduce the issue
Versions
Tested in QGIS 3.36.2 and 3.34.6
Supported QGIS version
New profile
Additional context
No response
The text was updated successfully, but these errors were encountered: