Opened 13 years ago

Last modified 13 years ago

#3296 new enhancement

Areas and length from field calculator are different to derived or measured results, when on the fly projection is on

Reported by: gespiel Owned by: jef
Priority: major: does not work as expected Milestone: Version 1.7.0
Component: Vectors Version: Trunk
Keywords: Cc:
Must Fix for Release: No Platform: Windows
Platform Version: XP sp3 Awaiting user input: no

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

Attachments (1)

different-aerea-between-fieldcalulator-and-derived-when-on-the-fly-is-on.jpg (138.0 KB ) - added by gespiel 13 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by zicke, 13 years ago

This is also a bit a mystery to me but I guess with OTF enabled it regards the ellipsoid.

Stefan

comment:2 by mhugent, 13 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.

comment:3 by zicke, 13 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

comment:4 by mhugent, 13 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.

comment:5 by pcav, 13 years ago

Summary: Areas and length from field calculator are different to derived or measuared results, when on the fly projection is onAreas and length from field calculator are different to derived or measured results, when on the fly projection is on
Note: See TracTickets for help on using tickets.