[GRASS-user] Delete line segments smaller than threshold

Hamish hamish_b at yahoo.com
Sun Jul 7 19:40:18 PDT 2013


Jon wrote:
> I know I've done this before, but I can't for the life of me
> find the functionality again.
> 
> I am trying to manage some contours generated from LIDAR.
> Even with using just last returns I have lots of spurious contours. 
> Before, I was able to delete segments shorter than a given length
> threshold.  But I can't remember how.  v.edit allows removal *areas*
> smaller than certain sizes, and it also removes "dangles" but not
> just regular line segments?

try
v.build.polylines
v.db.addcol a new length column, double precision
v.to.db upload the line lengths to the attr column
v.extract where the line length is only greater than some threshold.

it's not great, but it works to get rid of the small loops.

re. the non-greatness about it, if you wish to keep things like the
tight contours at a mountain peak or isobars in the eye of a
hurricane, but throw away similar-sized loops out on the edges.. how
to do that?

see also v.generalize, but care must be taken around peaks not to
average the lines too much or else they pull together, artificially
cusping the feature. somewhere I've got v.generalize terms that try to
smooth the tightening rings using v.generalize without moving them
inwards much. I don't think the solution was really great though, and
was sensitive to the digitization resolution/scale.


> Semi-related: LIDAR data from Erie County, NY used to be available
> for download as bare earth, and even you could specify a contour
>  interval and download that as a shapefile.  Can't for the life of
> me find that either!

there used to be a NY State wide clearinghouse website for geodata,
with all of the DEC data and a bunch of county stuff linked from it.
If that's still around maybe a good place to look?


regards,
Hamish


More information about the grass-user mailing list