[GRASS-user] v.to.db area calculations
Moritz Lennert
mlennert at club.worldonline.be
Wed May 24 02:36:12 PDT 2017
On 24/05/17 11:06, James Duffy wrote:
> Hello,
>
> Thank you for your investigations.
>
> Is there anything else I can do about this? I trust my QGIS measurement
> because I know the size of the object I have drawn around.
But as you say below:
>> OTF is turned off in QGIS, I am working in EPSG 4326.
>>
>> The 0.127m2 comes from using the Measure tool (OTF off) in QGIS.
>> And it
>> is set to display m2.
As I showed with my test, the value of 0.127m2 is probably wrong. In the
case of the 10000m2 rectangle, I get an error of over 2000m2 with OTF
off on an EPSG 4326 ! Only with OTF on, I get a result closer to the
true size.
Would you be willing to share your test polygon ?
Moritz
> However I
> would really like to use GRASS to automate my workflow...
>
> Thanks
>
> James
>
> On 19 May 2017 at 13:41, Moritz Lennert <mlennert at club.worldonline.be
> <mailto:mlennert at club.worldonline.be>> wrote:
>
> On 19/05/17 11:25, James Duffy wrote:
>
> Just to clear a few things up.
>
> The shapefile contains only a single polygon (I created it as a
> simple
> test to work out this discrepancy).
>
> OTF is turned off in QGIS, I am working in EPSG 4326.
>
> The 0.127m2 comes from using the Measure tool (OTF off) in QGIS.
> And it
> is set to display m2.
>
> Using the $area calculator in the field calculator in QGIS does
> indeed
> show something that is more likely degrees squared.
>
>
> Below some results from quick tests.
>
> Summary: personally I would trust GRASS GIS a bit more, but I'm
> biaised...
>
> ***************************
> Test 1:
>
> GRASS trunk in NC demo location (EPSG 3358)
>
> g.region n=200100 s=200000 w=500000 e=500100 -ap
> v.in.region out=nc_testpolygon
> v.to.db -p nc_testpolygon op=area --q
> 1|10000
>
> GRASS trunk in EPSG 4326 location
> v.proj location=nc_spm_08 mapset=user1 input=nc_testpolygon
> v.to.db -p nc_testpolygon op=area --q
> 1|10002.503642603
> v.out.ogr nc_testpolygon out=nc_testpolygon.shp (i.e. shapefile is
> in degress, EPSG 4326)
>
> QGIS (using the exported shapefile)
>
> No OTF
> measuring tool: 12.324,737 m²
> $area in calculator: 12320.2346026
>
> OTF to EPSG 4326, with datum WGS84
> measuring tool: 10.072,355 m²
> $area in calculator: 10046.3679510
>
>
> ********************************
> Test 2:
>
> GRASS trunk, in ESPG 4326 location
>
> g.region n=74 s=73 w=0 e=1 res=1 -p
> v.in.region region_1degree_73_74N
> v.to.db -p region_1degree_73_74N op=area --q
> 1|3539348689.40454
>
> v.out.ogr region_1degree_73_74N out=region_1degree_73_74N.shp
>
>
> GRASS trunk in EPSG 3575 location
> v.proj location=LL_WGS84 mapset=mlennert input=region_1degree_73_74N
> v.to.db -p region_1degree_73_74N op=area --q
> 1|3539337483.97153
>
>
> QGIS (using the exported shapefile)
> no OTF projection
>
> measuring tool 1,002 m² (sic)
> export geometry column: 1
> $area in calculator 12392029030 <tel:12392029030>.5000000
>
> with OTF projection, datum for measurements WGS84
>
> measuring tool 3.503.322.774,337 m²
> export geometry column: 1
> $area in calculator: 3499702798.3400998
>
> reproject to EPSG 3575
> with OTF, datum WGS84
>
> export geometry column 3539169026.18628
> export geoemtry column (column named otf) 3499702798.00000
> $area in calculator: 3499702798.6579294
>
>
>
>
>
> --
> *James Duffy*
> PhD Researcher
> Environment and Sustainability Institute
> Penryn Campus
> University of Exeter
> Penryn
> Cornwall
> TR10 9FE
More information about the grass-user
mailing list