<div dir="ltr"><div><div><div><div>Just to clear a few things up. <br><br></div>The shapefile contains only a single polygon (I created it as a simple test to work out this discrepancy). <br><br></div>OTF is turned off in QGIS, I am working in EPSG 4326. <br><br></div>The 0.127m2 comes from using the Measure tool (OTF off) in QGIS. And it is set to display m2. <br><br></div>Using the $area calculator in the field calculator in QGIS does indeed show something that is more likely degrees squared. <br></div><div class="gmail_extra"><br><div class="gmail_quote">On 19 May 2017 at 10:20, Moritz Lennert <span dir="ltr"><<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5"><br>
<br>
Le 19 mai 2017 11:12:30 GMT+02:00, Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a><wbr>> a écrit :<br>
>On Thu, May 18, 2017 at 4:22 PM, James Duffy<br>
><<a href="mailto:james.philip.duffy@gmail.com">james.philip.duffy@gmail.com</a><wbr>><br>
>wrote:<br>
>><br>
>> Hello,<br>
>><br>
>> I'm trying to calculate the area of a polygon using v.to.db as<br>
>follows<br>
>(through R):<br>
>><br>
>> execGRASS("v.to.db", flags = c("p","quiet"), parameters = list(map =<br>
>"test", units = "meters", option = "area", separator = "comma"),intern<br>
>=<br>
>TRUE)<br>
>><br>
>> I assume that the output of this command will be a meters squared<br>
>calculation of the area inside the polygon 'test'.<br>
>><br>
>> However, in QGIS, I manually calculated the area the they do not<br>
>match.<br>
>QGIS (which I believe to be true) shows 0.128m2, and the output from<br>
>v.to.db shows 22.42226m2.<br>
><br>
>This is a large difference. Is it possible that several polygons share<br>
>the<br>
>same category? In this case the entry in the attribute table is the sum<br>
>of<br>
>all polygons with that category.<br>
><br>
>><br>
>> I am working in WGS84.<br>
><br>
>GRASS uses geodesic distance and area calculation for latlon, I believe<br>
>QGIS as well.<br>
<br>
</div></div>QGIS only uses geodesic when OTF projection is activated and a datum is selected in the project properties (done by default with otf active I think). Otherwise it uses map units.<br>
<span class="HOEnZb"><font color="#888888"><br>
Moritz<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
><br>
>Markus M<br>
><br>
>><br>
>> Can anyone shed some light on how v.to.db calculates area and why it<br>
>might be going wrong please?<br>
>><br>
>> Thank you<br>
>><br>
>> James<br>
>><br>
>><br>
>><br>
>> --<br>
>> James Duffy<br>
>> PhD Researcher<br>
>> Environment and Sustainability Institute<br>
>> Penryn Campus<br>
>> University of Exeter<br>
>> Penryn<br>
>> Cornwall<br>
>> TR10 9FE<br>
>><br>
>> ______________________________<wbr>_________________<br>
>> grass-user mailing list<br>
>> <a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/grass-user</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><span style="color:rgb(39,78,19)"><span style="font-family:tahoma,sans-serif"><font size="4"><b>James Duffy</b></font><br>PhD Researcher<br>Environment and Sustainability Institute<br>Penryn Campus<br>University of Exeter<br>Penryn<br>Cornwall<br>TR10 9FE</span></span><br></div></div></div></div></div></div>
</div>