[GRASS-user] general v.digit help? Enduring thanks

Moritz Lennert mlennert at club.worldonline.be
Thu Apr 9 05:08:43 EDT 2009


On 09/04/09 03:29, hardinej wrote:
> Hello,
> Thanks to anyone who can help. I usually work with raster data, but I've been venturing into the world of vector data because I can make good masks. What I've been doing is using r.contour to extract a shoreline on a beach, and then I've been digitizing an almost rectangular area using v.digit where one side of the rectangle is the extracted shoreline. Then I convert that area to a mask and perform raster operations from there. r.digit is a poor sub for v.digit with a derived shoreline in my case.
> So, some of the literature seems a little sparse, so I've been using a lot of trial and error unfortunately.
> Here is my work flow,
> I open the contour line in v.digit and connect the ends to make a boundary. I add a centroid to make it an official area.

An area is boundary+centroid, not line+centroid (that's why you have to 
use v.type later on).


> I make sure all of the nodes are green. I don't really know why, it just works that way. So that would be my first question, what is the difference between green and red nodes/vertices? 

See the Symbology tab in the Settings window of v.digit for an 
explanation of the colors (and a possibility of changing them).
In this case: red=node connected to one line only, green=node connected 
to two lines.

> I do this by using the split lines tool and essentially cutting out red nodes and reconnecting the lines until they turn green.

You might be able to just move the red nodes, first separating them, and 
then putting them closer together so that they snap.

> v.to.rast input=vec2 output=vec3 use=val type=point,line,area layer=1 value=1 rows=4096. And sometimes it works and sometimes it doesn't, but I don't know why. 

Without more information from you (e.g. what does "it doesn't work" 
mean, i.e. error messages ? results ? etc) we cannot help you either.


>Also, when converting between vector types using v.type, I notice the output will say something like:
> Number of nodes     :   12
> Number of primitives:   16
> Number of points    :   0
> Number of lines     :   0
> Number of boundaries:   15
> Number of centroids :   1
> Number of areas     :   0
> Number of isles     :   0
> Number of incorrect boundaries   :   15
> Number of centroids outside area :   1

I think this means that your boundaries are not closed correctly.

Moritz


More information about the grass-user mailing list