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

with OTFR on $area is always computed in square meters even if the CRS is in feet (and QGIS project/general configs too) #19314

Closed
qgib opened this issue Jul 28, 2014 · 8 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Vectors Related to general vector layer handling (not specific data formats)

Comments

@qgib
Copy link
Contributor

qgib commented Jul 28, 2014

Author Name: Randal Hale (@rjhale1971)
Original Redmine Issue: 10966
Affected QGIS version: master
Redmine category:vectors


This is the only way I know how to explain it. If you have a shapefile/Spatialite layer and you turn on "enable on the fly CRS transformation" you do not get a correct area calculation. Typically it is off by a factor of 10 but in this example it's off a bit more. Example: I have a spatialite layer of polygons. If I calculate acreage of a polygon in it's native CRS I get an acreage calculation of 208.72. If I turn on "Project on the fly" the acreage calculation is then 19.47. It's still wrong if I make sure the Map Canvas is in the native projection of the data layer and Project on the fly is enabled. It's wrong if I move the CRS to match a different data layer (CRS of the imagery). It's right if I turn off Project on the fly and change my map canvas to match the CRS of the data layer.

I am calculating acres by opening the field calculator and executing $area / 43560 (area in is square feet)
All the vector layers are in EPSG:2274
The image layer is in EPSG:26916
I had set in this project the Map Canvas to be EPSG:2274 and Turned on Project on the fly to bring my image layer under my data layers.

I've loaded the files in Google Drive: https://drive.google.com/file/d/0B8WLtz606XDdU1FwOTR1eENKQjA/edit?usp=sharing


Related issue(s): #20259 (relates)
Redmine related issue(s): 12057


@qgib
Copy link
Contributor Author

qgib commented Aug 2, 2014

Author Name: Giovanni Manghi (@gioman)


The edited title says it all. Computations with OTFR on are right... but in meters when feet would be expected (even when the proper configurations are in feet in general options/project properties). I have no idea if this is a regression since a previous QGIS version. If yes this should be tagged as blocker.

It should be checked also if the same happens for lengths, perimeters and x/y values.


  • subject was changed from Area Calculations in QGIS with Project on the fly enabled. to with OTFR on $area is always computed in square meters even if the CRS is in feet (and QGIS project/general configs too)
  • category_id was changed from Attribute table to Vectors
  • status_id was changed from Open to Feedback
  • operating_system was changed from Ubuntu 14.04 UbuntuGIS repo to
  • os_version was changed from 2.4 to

@qgib
Copy link
Contributor Author

qgib commented Aug 5, 2014

Author Name: Antonio Locandro (Antonio Locandro)


This is a very good example for a test case for future versions, if test fails needs to be dealt before release

@qgib
Copy link
Contributor Author

qgib commented Dec 29, 2014

Author Name: Giovanni Manghi (@gioman)


it turns to be a regression as it worked as expected at least until 2.0.1


  • priority_id was changed from Normal to Severe/Regression
  • version was changed from 2.4.0 to master
  • status_id was changed from Feedback to Open

@qgib
Copy link
Contributor Author

qgib commented Mar 26, 2015

Author Name: Randal Hale (@rjhale1971)


Checked in 2.8.1 and it's still providing incorrect area back when OTF Projecting

@qgib
Copy link
Contributor Author

qgib commented Apr 19, 2015

Author Name: Andre Joost (Andre Joost)


Just another test case:

http://gis.stackexchange.com/questions/143080/qgis-area-calculation-differs-when-on-the-fly-crs-transformation-enabled

It looks to me that OTF produces wrong results (even with the same CRS).

@qgib
Copy link
Contributor Author

qgib commented Apr 19, 2015

Author Name: Giovanni Manghi (@gioman)


Andre Joost wrote:

Just another test case:

http://gis.stackexchange.com/questions/143080/qgis-area-calculation-differs-when-on-the-fly-crs-transformation-enabled

It looks to me that OTF produces wrong results (even with the same CRS).

see #20259

@qgib
Copy link
Contributor Author

qgib commented Apr 19, 2015

Author Name: Randal Hale (@rjhale1971)


I worked with a client the other day and we were calculating area in EPSG:26916 and it produced the correct area with OTF enabled. I haven't had a chance to go back and check against another dataset. Of course if it is defaulting to square meters that makes since since 26916 is UTM Zone 16.

@qgib
Copy link
Contributor Author

qgib commented May 10, 2015

Author Name: Giovanni Manghi (@gioman)


merged with #20259


  • resolution was changed from to duplicate
  • status_id was changed from Open to Closed

@qgib qgib added Bug Either a bug report, or a bug fix. Let's hope for the latter! Vectors Related to general vector layer handling (not specific data formats) labels May 25, 2019
@qgib qgib closed this as completed May 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Vectors Related to general vector layer handling (not specific data formats)
Projects
None yet
Development

No branches or pull requests

1 participant