[GRASS5] [bug #2944] (grass) v.extract seg.faults

Radim Blazek blazek at itc.it
Thu Jan 27 03:07:34 EST 2005


Request Tracker wrote:
> this bug's URL: http://intevation.de/rt/webrt?serial_num=2944
> -------------------------------------------------------------------------
> 
> Subject: v.extract seg.faults
> 
> Platform: GNU/Linux/i386 debian
> grass obtained from: Trento Italy site
> grass binary for platform: Compiled from Sources
> GRASS Version: 6.0.beta1
> 
> v.extract doesn't allow to extract two layers and to make a selection (where="str1='No Name'") at the same time. If one doesn't set the layer argument or sets the as layer=1,2 , only one layer is extracted. 

This is a wish not a bug.
You can either run v.extr
You have to create third layer (or add new attribute to one layer)
and upload the attributes from layer 1 and 2 to layer 3
(v.to.db option=query qcol=), then use v.extract on layer 3.

Just for curiosity, can you tell us what your 2 layers represent and why 
you need to query both?


> If the layer is set to -1 or 2  v.extract seg faults!

Fixed, but the only difference is that you get fatal error not seg 
fault. 'where' with 'layer=-1' does not make sense.

Radim

> 
> Robert Nuske
> 
> 
> EXAMPLE:
> ========
> 
> # add a second layer to archsites
> 
>>v.category in=archsites out=archsites_2L layer=2 op=add
> 
> 
> #checking for the second layer
> 
>>v.category archsites_2L layer=1,2 op=print
> 
> 1|1
> 2|2
> 3|3
> [...]
> 25|25
> 
> # yes, it's there, as it should be.
> 
> 
> 
>>db.describe -c archsites_2L
> 
> ncols:2
> Column 1: cat
> Column 2: str1
> 
> 
> #first try to get a selection
> 
>>v.extract in=archsites_2L out=NoName_1 type=point where="str1='No Name'"
> 
> 
> Load cats from the database (table = archsites_2L, 
> db = /home/rnuske/luftbild/robert/grassdata/spearfish57/robert/dbf/).
> 12 cats loaded from the database
>  [snip]
> Writing attributes ...
> Layer 1
> Done.
> 
> 
> 
>>v.category NoName_1 layer=1,2 op=print
> 
> 2|
> 5|
> 8|
> 9|
> 11|
> 13|
> 14|
> 15|
> 19|
> 20|
> 23|
> 25|
> 
> # => the correct points but only one of the two layers were extracted !
> 
> 
> 
> # asking grass to, please, extract both layers: 
> 
>>v.extract in=archsites_2L out=NoName_2 type=point layer=1,2 where="str1='No Name'"
> 
> 
>  [snip]
> Writing attributes ...
> Layer 1
> Done.
> 
> # => same as above: the correct points but only one of the two layers were extracted !
> 
> 
> # trying something else, 
> # force grass to write all layers or explicitly the 2nd layer
> 
>>v.extract in=archsites_2L out=NoName_3 type=point layer=-1where="str1='No Name'"
> 
> Segmentation fault
> 
> 
>>v.extract in=archsites_2L out=NoName_4 type=point layer=2 where="str1='No Name'"
> 
> Segmentation fault
> 
> # => both results in segmentation faults !!
> 
> 
> 
> # curiously enough, extracting all layers w/o select statement, works just fine. 
> 
> 
>>v.extract in=archsites_2L out=NoName_5 type=point layer=-1
> 
>  [snip]
> Writing attributes ...
> Layer 1
> Done.
> Layer 2
> No table.
> 
> 
>>v.category NoName_5 layer=1,2 op=print
> 
> 1|1
> 2|2
> 3|3
>  ...
> 25|25
> 
> -------------------------------------------- Managed by Request Tracker
> 
> _______________________________________________
> grass5 mailing list
> grass5 at grass.itc.it
> http://grass.itc.it/mailman/listinfo/grass5




More information about the grass-dev mailing list