Feature #3296
Areas and length from field calculator are different to derived or measured results, when on the fly projection is on
| Status: | New | Start Date: | ||
|---|---|---|---|---|
| Priority: | Low | Due date: | ||
| Assigned to: | % Done: | 0% |
||
| Category: | Vectors | |||
| Target version: | Version X - Unplanned | |||
| Platform: | Resolution: | |||
| Platform version: | Patch supplied: | No | ||
| Status info: |
Description
Hi,
in a project with EPSG 31466 (Gauss Krüger Zone 2), i get different results of area and length from fieldcalculator and derived (or measured).
Project EPSG and shapefile EPSG are set to 31466.
When on the fly is off, the results are indentic.
A screenshot is attached
Do I soething wrong?
Gerhard
History
Updated by zicke - over 2 years ago
This is also a bit a mystery to me but I guess with OTF enabled it regards the ellipsoid.
Stefan
Updated by Marco Hugentobler over 2 years ago
Hi all
The reason is that the field calculator does not take the target projection for measurement (and uses the default WGS84 ellipsoid), see qgssearchstring.cpp:145. It should probably read the ellipsoid from the options and set the target projection for measuring.
Updated by zicke - over 2 years ago
I still think it's a bit confusing that you get different results when OTF enabled or not. I have two coordinates: 600000/200000 and 600100/200000. When OTF is disabled I measure 100 meters, when OTF is enabled I get 100.1565 meters. I definitely prefer 100 meters :-) Is the OTF-enabled distance the distance on the ellipsoid?
At least you should have the possibility to choose what kind of result you want (even when OTF is enabled).
Stefan
Updated by Marco Hugentobler over 2 years ago
Hm, the field calculator distance measurement sets oft always to off for the calculations. Therefore, it should always return 100.
I tried it with your coordinates, and the field calculator always returned 100 for me, no matter if oft-projection is on or off. So I think your preferred behaviour is already there.
I agree that it would be good to have an option if otf and Ellipsoid should be considered or not.
Updated by Giovanni Manghi over 1 year ago
- Target version changed from Version 1.7.0 to Version 1.7.4
Updated by zirneklitis - over 1 year ago
- File Latvia.7z added
The difference between results is even more confusing when the same projection is used both for project as well as attached layer. (No actual reprojections should be done?) In the attahed example LKS92 / Latvia TM (EPSG:3059) is used. The calculated are ($area) gives the same result whether the 'on the fly' CRS transformation is enabled or not. Not the case with derived value inside 'Identify results' tool. The correct value is calculate when the 'on the fly' CRS transformation is disabled.
Updated by Giovanni Manghi over 1 year ago
- Assigned to deleted (
Jürgen Fischer) - Platform deleted (
Windows) - Platform version deleted (
XP sp3) - Status info deleted (
0) - Patch supplied set to No
I see this difference also with data in other projected CRSs.
Updated by Giovanni Manghi about 1 year ago
- Target version changed from Version 1.7.4 to Version 2.0.0
Updated by Magnus Homann 9 months ago
- Assigned to set to Magnus Homann
Updated by Magnus Homann 9 months ago
zicke - wrote:
I still think it's a bit confusing that you get different results when OTF enabled or not. I have two coordinates: 600000/200000 and 600100/200000. When OTF is disabled I measure 100 meters, when OTF is enabled I get 100.1565 meters. I definitely prefer 100 meters :-) Is the OTF-enabled distance the distance on the ellipsoid?
When OTF is enabled, the distance is probably on an ellipsoid, yes. I'm fixing this so that there will be a global selection off using ellipsoid or planimetric calculations, and this should then go into field calculation (and derived result). Stay tuned.
Updated by Pirmin Kalberer 8 months ago
- Target version changed from Version 2.0.0 to Version X - Unplanned