trimming excess nodes

Susan Huse sue at ced.berkeley.edu
Wed Apr 27 13:54:22 EDT 1994


> 
> > 
> > Hi, I am trying to trim out excess nodes.  
> > 
> > Unfortunately v.trim also seems to trim out all islands, I have 
> > well over a hundred islands.  I also have thousands
> > of excess nodes and editting the file is a pain with that many
> > line segments.  
> > 
> > Any ideas?
> > 
> > 
> > Sue Huse
> > CEDR - REGIS
> > University of California, Berkeley
> > 
> 
> Hi, Susan
> How are things out there? I've been giving your problem some thought, and I
> have a suggestion for a rather inelegant solution. You could generate an ASCII
> vector file from the binary vector file, then write an awk script to extract
> only the single node islands from it. (You would look at the sub-header for
> each block of coordinates - "A 15" - and then compare the following record to
> the fifteenth following record. If they are the same, then the block of 
> coordinates should be written to a new file. I didn't claim that it would be
> easy!) Run v.trim on your original vector layer, then patch the single-node
> islands back in.
> 
> That's the best that I can think of!
> -- 
> Malcolm D. Williamson - Research Assistant       E-mail: malcolm at cast.uark.edu
> Center for Advanced Spatial Technologies      Telephone: (501) 575-6159
> Ozark Rm. 12                                        Fax: (501) 575-3846 
> University of Arkansas              
> Fayetteville, AR 72701
> 

Hey Malcolm, things are going quite well out here.  I'm doing some part
time work for a non-profit firm and liking it.  That's not necessarily 
speeding up my dissertation, but what the hell...
Actually your idea wouldn't be too hard to implement, EXCEPT, I think
it is removing all islands even those with more than one node.  It
starts removing excess nodes then when it removes the last one it takes
the island with it.  I can't output to ascii in mid-v.trim.    Lucky for
me though, I think Rick is correct that the version I used is out of 
date.  I'll bring down the one from campus and try that.  The firm I'm
working for is most likely behind.

Thanks for the help.  And how goes Fayetteville?

-sue




More information about the grass-user mailing list