[GRASS-user] converting lines to polygons

Bryan Keith bryan at ideotrope.org
Thu Sep 23 13:36:22 EDT 2010

>>>>> On 09/22/2010 12:45 AM, Bryan Keith wrote:
>>>>>> Hello,
>>>>>> I'm using these commands:
>>>>>> v.clean input=test_ln output=testclean_ln tool=snap,bpol
>>>>>> thresh=0.2,0
>>>>>> v.type input=testclean_ln output=testclean_bnd type=line,boundary
>>>>>> v.centroids input=testclean_bnd output=testclean_py
>>>> and I have lots of files to process so I'm looking for an automated
>>>> process.
>>> Can you figure out why other areas were not closed? Maybe you need a
>>> larger threshold value?
>>> By opening the vector with v.digit you'll see by the color coding of
>>> the
>>> nodes which are part of closed boundaries (dark green) and which are on
>>> a "broken" boundary (red).
>>> You'll also see quickly where you have centroids inside correct
>>> boundaries, and where you're missing them.
>> No, I can't figure out why the other areas were not closed.  A larger
>> threshold value does not help.  I have never used v.digit, and I
>> actually
>> can't get anything to display with v.digit  Hmmm, I'm not sure what I'm
>> doing wrong with v.digit
> What OS are you on? what version of GRASS, and what GUI?

I'll answer these questions anyway, but I figured out the v.digit problem
(see below).
Windows XP
GRASS 6.4.0

>> I would be nice to be able to see where nodes aren't connected (I'm
>> guessing that's the problem) and be able to measure how far apart they
>> are
>> from each other.  I'm surprised how increasing the threshold makes some
>> boundaries that were correct incorrect.
> Yes, Surprising. Can we see, as Markus M suggested, the output of v.info
> -t or v.clean? Also what units is your data in? i.e the output of v.info
> -g and g.region -p ?

OK, getting closer, I think.  The reason v.digit wasn't working was
because g.region was set incorrectly.  Now I can look at the various maps
with v.digit and see the different colors of the lines and nodes.  In the
meantime I created a very simple example and processed that map and was
able to get results that I expected.  So then I looked at the one that
worked and the one that didn't using v.digit to see what the differences

The files that doesn't have all the areas that I expect has lines that are
displayed orange (Boundary (1 area)) while the correct version has lines
that are display green (Boundary (2 areas)).  Could that be why I'm not
getting all the areas that I expect?  All the nodes look correct (no red
ones).  How do I fix this?  An option in v.clean?


>>>>>> Check out the line and polygons here:
>>>>>> http://www.ideotrope.org/~bryan/lines.png
>>>>>> http://www.ideotrope.org/~bryan/polygons.png
>>>>>> Bryan

More information about the grass-user mailing list