Project

General

Profile

Bug #3482

Area calculation of polygons - trial

Added by Giulio Di Anastasio over 7 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
09/01/2017
Due date:
% Done:

100%

Close

Description

Dear Philippe,
sorry I first wrote this in the GIS section of Redmine, now I closed it there and opened here in gisaf... sorry for the confusion...
I attach herewith a shapefile with three geometries:
1. square, 10 x 10 meters
2. rectangle, 30 x 10 meters
3. circle, 10 meters radius

I created these features in CAD through rectangle and circle tool. Interestingly, it is imported not as polygons but as polylines. I tried to calculate the area via GIS, I could not...

One more thing: in the field calculator, there are two ways to calculate areas:

1. $area = Returns the area of the current feature. The area calculated by this function respects both the current project's ellipsoid setting and area unit settings. Eg, if an ellipsoid has been set for the project then the calculated area will be ellipsoidal, and if no ellipsoid is set then the calculated area will be planimetric.
Syntax
$area

Examples
$area → 42

2. area = Returns the area of a geometry polygon object. Calculations are always planimetric in the Spatial Reference System (SRS) of this geometry, and the units of the returned area will match the units for the SRS. This differs from the calculations performed by the $area function, which will perform ellipsoidal calculations based on the project's ellipsoid and area unit settings.
Syntax
area(geometry)
Arguments

geometry
polygon geometry object

Examples
area(geom_from_wkt('POLYGON)')) → 8.0

Giulio

geometry try Giulio.zip (2.29 KB) Giulio Di Anastasio, 09/01/2017 14:52

Associated revisions

Revision 9c91b667 (diff)
Added by Philippe May over 7 years ago

Fixes #3473, fixes #3482: use gdal (osgeo) instead of shapefile for importing, solving discrepancy of areas and interiors of polygons not processed correctly

History

#1 Updated by Anonymous over 7 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

#2 Updated by Philippe May over 6 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF