[GRASS-dev] [GRASS-user] v.to.db area calculations

Moritz Lennert mlennert at club.worldonline.be
Wed May 24 06:02:54 PDT 2017


On 24/05/17 11:39, James Duffy wrote:
> Please find the polygon in the zip attached.
[sent offlist]

Ok, I can confirm that there is a problem with this particular polygon. 
I guess that it might an issue with the very small size of this polygon.

When I import it in an EPSG 4326 location, I get the same result as you:

 > v.report training op=area u=me
cat|id|area
1|1|38.2256243922775

But when I reproject it to a UTM 43N (EPSG 32743) location, I get a 
different area, which is close to what you find in QGIS:

v.proj location=LL_WGS84 mapset=mlennert input=training 
output=training_reproj_grass
v.report training_reproj_grass op=area u=me
cat|id|area
1|1|0.126369981910102

Interestingly, when I create a buffer around the area:

v.buffer training dist=0.0001 out=training_buff_0_0001

The area measurement in GRASS is again very close to the one in QGIS:

v.report training_buff_0_0001 op=area u=me
cat|area
1|419.188654810375

$area in field calculator in QGIS:
425.1112801

And in the ESPG 4326 location, it is impossible to zoom to the original 
polygon as it seems to go below the zoom capacity of the GUI:

"Failed to run command 'd.vect map=training at mlennert 
type=point,line,boundary,area,face width=1'. Details:
 

GRASS_INFO_ERROR(22724,1): Invalid n-s resolution field: 0.000000 "


Although these two might be unrelated, I do feel that there might be an 
issue with floating point precision somewhere...

Could you post this as a bug report, including your polygon ? Or would 
you prefer me posting the report, but could I then use your polygon ?

Moritz


More information about the grass-dev mailing list