Bug report #301
derived area is calculated wrong
|Affected QGIS version:||Regression?:||No|
|Operating System:||All||Easy fix?:||No|
|Pull Request or Patch supplied:||Resolution:||fixed|
|Crashes QGIS or corrupts data:||Copied to github as #:||10360|
Please refer to the thread where I'm reporting this in detail:
#1 Updated by Gavin Macaulay - almost 14 years ago
The link in the above ticket should be:
#2 Updated by Martin Dobias almost 14 years ago
Calculated area of a feature depends on the ellipsoid set in QGIS options. However also after setting ellipsoid 1866 the calculated area isn't correct. Needs further investigation.
Please could you give some other examples with incorrectly calculated area? Preferably simple features - e.g. rectangle. Does it calculate area correctly for layer with unprojected coordinates?
The code for calculating the area has been borrowed from GRASS, thus teoretically they should give the same results.
Do you know any utility that could help to check whether the area is correct? E.g. how to do it in grass?
#3 Updated by Redmine Admin almost 14 years ago
Replying to [comment:2 wonder]:
The code for calculating the area has been borrowed from GRASS, thus teoretically they should
give the same results.
Do you know any utility that could help to check whether the area is correct? E.g. how to do it
Grab a GRASS location (the database that GRASS works on): [http://grass.itc.it/sampledata/spearfish_grass60data-0.3.tar.gz]
1. install GRASS; you don't need the latest and gratest - anything above 6.0 will do
2. run GRASS
3. for DATABASE, enter the path to the directory where you unpacked the spearfish location; put "spearfish60" for LOCATION and "PERMANENT" for MAPSET#set the region of interest
4. g.region vect=your_vector_map
- spawn a display
5. d.mon x0
- display vector
6. d.vect your_vector_map
- query it
7. d.what.vect -x ; l-click the polygon
The area of the of polygon is printed to the terminal.
You can create any new vector polygon with v.digit or QGIS GRASS edit.
1. v.digit -n map_name
2. (GUI pops up) draw a boundary and a single centroid inside
3. exit v.digit; the vector is written - display it, query
QGIS GRASS edit:
1. GRASS plugin > Open mapset
2. GRASS plugin > Create new GRASS vector
3. draw a boundary and centroid inside
Make sure the boundary starting and ending nodes are snapped. Remember that GRASS polygon ("area" in GRASS lingo) is made of a boundary and centroid.
#6 Updated by maris-gis-gmail-com - over 13 years ago
Same applys to lenght measurements in 0.8.0 on Linux.
I loaded Spearfish roads as shapefile (from GRASS export). Projection was set automaticly to one exported from GRASS (looked OK). Measured single road length with "Measure length" tool. Looked OK (~860m), but "Identify" tool shoved only 0.040 km.
#10 Updated by Magnus Homann over 13 years ago
- Status changed from Open to In Progress
OK, I looked a bit at GRASS. You can calculate the area either as planimetric or ellipsoidal. In qgis 0.9, planimetric is selected when projectin is off, else it is ellipsoidal. The ellips is taken from the global Options-> Projections dialog.
If the reported value from GRASS was in fact the planimetric area, it reports the same as qgis does.
I will investigate this further if someone can report the planimetric and ellipsodial areas of the full_circle.shp (given the relevant NAD27 projection). Until then I put it as fixed in 0.9, but I'm glad to reopen it.
(*) Why not from canvas projection ?