Bug report #301

derived area is calculated wrong

Added by Redmine Admin about 18 years ago. Updated about 15 years ago.

Status:Closed
Priority:Low
Assignee:Magnus Homann
Category:Vectors
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

Description

Please refer to the thread where I'm reporting this in detail:

[http://lists.qgis.org/pipermail/qgis-developer/2006-August/000599.htm]l

Maciek

History

#2 Updated by Martin Dobias almost 18 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 18 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
in grass?

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
  1. spawn a display
    5. d.mon x0
  2. display vector
    6. d.vect your_vector_map
  3. 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.

v.digit:

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.

Cheers,
Maciek

#4 Updated by Martin Dobias almost 18 years ago

Thanks for the instructions, I'll try to do some investigation on this.

#5 Updated by Gary Sherman almost 18 years ago

Moved to 0.8.1

#6 Updated by maris-gis-gmail-com - almost 18 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.

#7 Updated by Magnus Homann over 17 years ago

Measurements have changed a bit in trunk. I don't think it makes any difference, bu it's worth a check. I'm not GRASS-savy myself.

#8 Updated by Magnus Homann over 17 years ago

Length measurment errror should be fixed in trunk now ().

#9 Updated by Magnus Homann over 17 years ago

Downloaded the full_circle.shp and tested it in trunk . With projections off, the areas were close enough (> 10 digits). With projections on, the error was as reported (less than 0.1%)

#10 Updated by Magnus Homann over 17 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 ?

#11 Updated by Magnus Homann over 17 years ago

  • Status changed from In Progress to Closed
  • Resolution set to fixed

#12 Updated by Magnus Homann over 17 years ago

With df2b8b28 (SVN r6535), planimetric measurements are available as an option (for 0.9)

#13 Updated by Anonymous about 15 years ago

Milestone Version 0.9 deleted

Also available in: Atom PDF