[Qgis-user] relation between the value of $area and the CRS (lat/long coordinates)
Alex Mandel
tech_dev at wildintellect.com
Wed Mar 26 13:50:56 PDT 2014
General rule of thumb. Whenever doing analysis reproject data into
appropriate projection.
Why? Well you can never count on tools re-projecting or recalculating
units on the fly. Many GIS tools are actually completely projection and
unit unaware, they simply operate on the coordinates/units provided.
There's all sorts of reasons why, it's more complicated, the reading of
proj metadata could be wrong, there might be no clean datum transform
without user input etc....
This is why, notoriously, GRASS and ArcINFO (old school command line),
define projection on a workspace (whole folder of data). It was the only
way to ensure calculations would be correct.
The measure tools in QGIS have attempted to make life easy by allowing
calculations to vary depending on project projection and selected
project display units. This should be exploratory only for the reasons
stated above. All sorts of combos could give strange numbers.
It's not exactly a bug, though there could be one, it's more likely an
unexpected combo of settings.
Thanks,
Alex
On 03/26/2014 10:35 AM, Carlos Cerdán wrote:
> Maybe it's a bug, but I've had a similar issue. Solution: I changed CRS to
> UTM (my case), closed QGIS, open again and calculate areas (maybe I did a
> reboot also, I don't remember), but after that, areas were calculated
> correctly.
>
> That time I was using Ubuntu 12.04 - QGIS 2.0.1.
>
> Good luck
>
> Carlos
>
>
>
> 2014-03-26 5:52 GMT-05:00 Manuel Campagnolo <mlc at isa.ulisboa.pt>:
>
>> Hi,
>>
>> I have a question about calculating areas for polygon layers when
>> coordinates are geographic (e.g. CRS=WGS84). In the example below I used a
>> map of the US (a MultiPolygon of the 50 States)
>>
>> 1): The layer and project CRS were WGS84 (EPSG:4326) -> The expression
>> $area in field calculator returned a small value (1116.7), which I believe
>> is obtained from lat/long coordinates (as if the map projection was Plate
>> Carré) ;
>> 2): I did change the Project CRS to a projected CRS
>> (USA_Contiguous_Albers_Equal_Area_Conic) and I used $area again to
>> compute the area -> the result was identical;
>> 3) I reset the Project CRS to WGS84 and I created a 3rd field using again
>> $area -> this time around, the result was 9'475'180'617'431.81 (m2) -- !!
>> (it is the same Layer and Project CRS than 1).
>>
>> If I reproject my Layer to USA_Contiguous_Albers_Equal_Area_Conic and
>> then compute $area the result is 9'264'554'959'451.9 as expected.
>>
>> I would like to understand was is the rationale for $area (and other
>> Geometry methods) in relation to the Layer and Project CRS when the
>> coordinates are lat/long.
>>
>> Thanks,
>> Manuel
>>
>>
More information about the Qgis-user
mailing list