[GRASS-dev] GRASS 7: v.to.rast -d produces empty raster when used on areas

Blumentrath, Stefan Stefan.Blumentrath at nina.no
Tue Apr 1 04:28:41 PDT 2014


Added a ticket: http://trac.osgeo.org/grass/ticket/2239

This behavior is of course not problematic, but it might confuse users.

Cheers
Stefan

-----Original Message-----
From: Hamish [mailto:hamish_b at yahoo.com] 
Sent: 27. mars 2014 22:08
To: Blumentrath, Stefan; GRASS developers list (grass-dev at lists.osgeo.org)
Subject: Re: [GRASS-dev] GRASS 7: v.to.rast -d produces empty raster when used on areas

Stefan wrote:
> Converting areas from vector to raster with the -d flag (dense lines) 
> in GRASS 7 results in an empty raster map.
> Both on Windows and Linux.
> Is that because boundaries are not lines or would you consider it as a 
> bug?

I think you are right, it is probably because boundaries are not lines. Or more specifically, in an area the centroid holds the category and attribute data, and the boundary is (typically) without category. (If a boundary is between two parcels of land, which farmer does the boundary belong to?)

So if you wish to work on boundaries you have to v.extract them, then add categories with v.category. If you do that typically you'd want to run v.type as well to turn them into lines.


It's probably worth a ticket in the trac system since in future others will try the same with type=area, just note that the thick raster line should probably be category 0 or so, not the adjoining area's cat number for the "who does it belong to?" reason above.


Hamish



More information about the grass-dev mailing list