[GRASSLIST:5762] Re: v.extract incorrect output

Radim Blazek blazek at itc.it
Mon Mar 10 03:41:59 EST 2003


On Monday 10 March 2003 03:48 am, Philipp Molzer wrote:
> Hi,
> I'm running grass5.0 on RH8 linux.
> I'm extracting one county border from a vector of all counties for the
> state of New Jersey, USA.
> I do this:
> v.extract -n type=area list=ESS input=stco_CO output=essex.border new=1
> but wind up with the polygon for MOR (see below cats).
>
> here's part of the dig_cats file.
> # 23 categories
> Vector map: stco_CO
>
> 0.00 0.00 0.00 0.00
> 1:SUS
> 2:PAS
> 3:BER
> 4:WAR
> 5:MOR
> 6:ESS
> 7:HUD
> ...

There is a bug in v.extract for '-n' option. It uses index instead of 
category!!! For example for dig_cats
1:A
10:B
and list=A,B you get cat list 0,1. So your output is 'correct'
( 5(MOR) instead of 6(ESS) ) :)
I disabled '-n' option 3 months ago (after 5.0.0 release).
 
This is the most interesting bug I have ever found in GRASS,
output is obviously wrong and the module is there for years
(1.0 10/01/89 mentioned in code). 
Conclusion: It is not so important how the program works
as we can see on other popular SW.
Try to make the project with MOR instead of ESS and I think 
that there is a good chance that nobody other will notice that.

> When I do:
> v.extract  type=area list=6 input=stco_CO output=essex.border new=1
> I get both ESS and SUS polygons combined in one vector. (As if I did
> list=1,6)

This seems to be another bug. Did you check if cats are realy correct 
in the input (d.what.vect)? Then we can narrow it to either v.extract or 
v.in.shape.

> The vector map stco_CO was created with:
> v.in.shape -o in=stco.shp out=stco_CO label=CO scale=24000
> v.support map=stco_CO option=build
>
> Is it me, or does v.extract have problems?


Radim




More information about the grass-user mailing list