[GRASSLIST:6394] Re: Computing polygon area after/during v.overlay

Radim Blazek blazek at itc.it
Mon Apr 11 03:43:14 EDT 2005


Hamish wrote:
> I would like to know the "coastline" lengths of some vector areas.
> Yes, it's a fractal problem, so we assume constant smoothness and only
> use results as ratios vs other areas within same dataset.
> I'm trying to figure out a method to do this:
> v.to.db -p option=length type=boundary
> only works for lines (that is cat number -1 does report a length; if
> type=boundary is not used then all real cats are listed with zero
> length). I assume -1 length is sum of all boundaries? If so, I could
> exploit the -1 length via v.extract in a loop for each cat, but that
> seems like a bad solution.

v.to.db works also for boundaries, but they must have a category
(v.category type=boundary). How do you want to report length for 
elements without category?

> so I use v.type to turn boundaries into lines, but as boundaries do not
> have category numbers so result isn't worth much.
> How do I assign the category of the area next to the boundary as the
> boundary's cat value? (all areas are islands which do not touch, so no
> left/right side issues) v.distance?

v.to.db option=sides, where is a problem?


> v.category option=add
> just assigns cats sequentially without regard to original area's cat.
> also, what does cat=0 answer mean in v.to.db output when option=area?
> Area of holes within a polygon? The true categoried polygon sums do not
> include that, correct?
> also, why does v.to.db insist on the col= option? You just need to feed
> it 'col=foo' or you get "ERROR: This option requires one column"
> thanks,
> Hamish

More information about the grass-user mailing list