Opened 18 years ago

Closed 17 years ago

Last modified 15 years ago

#301 closed bug (fixed)

derived area is calculated wrong

Reported by: tutey@… Owned by: homann
Priority: major: does not work as expected Milestone:
Component: Vectors Version: Trunk
Keywords: Cc:
Must Fix for Release: Yes Platform: All
Platform Version: Ubuntu Dapper Awaiting user input: no

Description

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

http://lists.qgis.org/pipermail/qgis-developer/2006-August/000599.html

Maciek

Change History (15)

comment:2 by wonder, 17 years ago

Must Fix for Release: No

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?

in reply to:  2 comment:3 by tutey@…, 17 years ago

Replying to 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

  1. run GRASS
  1. 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

  1. g.region vect=your_vector_map

# spawn a display

  1. d.mon x0

# display vector

  1. d.vect your_vector_map

# query it

  1. 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

comment:4 by wonder, 17 years ago

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

comment:5 by anonymous, 17 years ago

Summary: derived area is calculated worngderived area is calculated wrong

comment:6 by gsherman, 17 years ago

Milestone: Version 0.8 ReleaseVersion 0.8.1 Release

Moved to 0.8.1

comment:7 by maris.gis@…, 17 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.

comment:8 by anonymous, 17 years ago

Must Fix for Release: NoYes
Platform: LinuxAll

comment:9 by homann, 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.

comment:10 by homann, 17 years ago

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

comment:11 by homann, 17 years ago

Milestone: Version 0.8.1 ReleaseVersion 0.9 Release

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

comment:12 by homann, 17 years ago

Owner: changed from gsherman to homann
Status: newassigned

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 ?

comment:13 by homann, 17 years ago

Resolution: fixed
Status: assignedclosed

comment:14 by homann, 17 years ago

With r6534, planimetric measurements are available as an option (for 0.9)

comment:15 by (none), 15 years ago

Milestone: Version 0.9

Milestone Version 0.9 deleted

Note: See TracTickets for help on using tickets.