[GRASS-user] Possible bug in v.edit

Marc-Antoine Nüssli marc-antoine.nuessli at euratlas.com
Tue Sep 1 08:10:26 EDT 2009


Dear Grass users,

I get a very strange result with v.edit. Here is the story:

I have imported a vector map from a postgres database and there are 3 
overlapping areas. Then, I try to get the feature ids(not the category) of 
the overlapping areas by using (as the overlapping areas appear in layer 2 
with cat=2):
v.edit map=test_shapes_newi layer=2 tool=select cats=2 type=centroid
Ans the result is:
----
29,27
Selecting features...
2 of 29 features selected from vector map <test_shapes_newi at PERMANENT>
v.edit complete.
---
Thus, only two features are selected... instead of 3....strange

Then, I tried to print the category(in layer 1) for all features using:
v.category input=test_shapes_new option="print"
and the result is:
---
4
6
7
2
1/2
1
1/3
3
5
3/5
---
So, we clearly see that 3 features have two categories in layer 1(and thus 
are overlapping), which is consistent with what is indicated by v.in.ogr 
(and also with what I can see when I display the map)

Then, if I get the ids of features with cat=1 in layer1:
v.edit map=test_shapes_newi layer=1  tool=select cats=1 type=centroid
I correctly get 3 ids...

But if I ask for the features with cat=3 in layer1:
v.edit map=test_shapes_newi layer=1  tool=select cats=3 type=centroid
I get only 2 ids:
---
29,27
Selecting features...
2 of 29 features selected from vector map <test_shapes_newi at PERMANENT>
v.edit complete.
----
which is clearly wrong if we compare with the list of categories printed 
above...

 
I really don't understand what is going wrong. The only reason I can think 
of is a bug in v.edit....
 

Below, I have pasted the testfile I used to produce these results. Please 
try to redo and tell me if you have the same problem. Moreover, if you look 
at the text file, we can clearly see that there are three features with two 
categories...
 

By the way, I take the opportunity to ask if someone knows an easy way to 
transform overlapping areas into simple areas. Basically, I just want to 
choose one of the two(or more) categories associated to an area and assign 
it as the only category for that area. And I don't care about which category 
is chosen among the 2 possible.
My data are the areas of countries and thus the overlaps I got are just 
because of some problems in the none-topological version of the data. So, I 
just need to assign randomly these overlaps to one of the neighbor area.
I tried v.clean tool=rmdupl but it does nothing at all...
Now, I am fighting with v.edit and I get the problem presented above...
So, if someone has an easy solution to this problem, I would very glad.

Thank you in advance!
Marc-Antoine Nüssli
----------START ASCII GRASS STANDARD FILE----------------------

ORGANIZATION:
DIGIT DATE:  
DIGIT NAME:   nuessli
MAP NAME:    
MAP DATE:     Tue Sep 01 13:01:32 2009
MAP SCALE:    1
OTHER INFO:  
ZONE:         0
MAP THRESH:   0.000000
VERTI:
B  5
 158          131        
 211          301        
 108          333        
 75           254        
 158          131        
B  5
 171.67467949 102.62660256
 182.29166667 94.41346154
 194.71153846 71.77724359
 191.30608974 72.17788462
 171.67467949 102.62660256
B  4
 116.20338236 147.39430963
 114.22292076 131.55061682
 121.15453637 135.51154003
 116.20338236 147.39430963
B  2
 62           77         
 98.3258427   111.53932584
B  2
 98.3258427   111.53932584
 123          135        
B  2
 43           77         
 62           77         
B  3
 62           77         
 69           77         
 98.3258427   111.53932584
B  6
 98.3258427   111.53932584
 114          130        
 115          150        
 66           259        
 35           265        
 43           77         
B  3
 158.08252615 122.19914762
 156          116        
 168.5464684  106.24163569
B  3
 168.5464684  106.24163569
 183          95         
 195          72         
B  3
 123          135        
 71           255        
 158.08252615 122.19914762
B  2
 158.08252615 122.19914762
 168.5464684  106.24163569
B  7
 168.5464684  106.24163569
 191          72         
 151          70         
 37           72         
 37           160        
 40           74         
 62           77         
B  3
 217          307        
 162          136        
 181.12359551 190.78651685
B  3
 181.12359551 190.78651685
 199          242        
 273.24466019 221.44466019
B  4
 273.24466019 221.44466019
 441          175        
 276          289        
 217          307        
B  4
 195          72         
 414          45         
 436          172        
 273.24466019 221.44466019
B  3
 273.24466019 221.44466019
 199          244        
 181.12359551 190.78651685
B  2
 181.12359551 190.78651685
 158.08252615 122.19914762
C  1 1
 144.59283467 243.00698455
 1     4        
C  1 1
 183.51855004 87.21392108
 1     6        
C  1 1
 116.96146785 138.87668756
 1     7        
C  1 1
 65.45911571  169.69098179
 1     2        
C  1 3
 80.70905903  93.08952149
 1     1        
 1     2        
 2     2        
C  1 1
 135.07702133 128.59957381
 1     1        
C  1 3
 161.92770396 113.80227654
 1     1        
 1     3        
 2     2        
C  1 1
 297.85655015 136.60482313
 1     3        
C  1 1
 275.17021301 221.55107616
 1     5        
C  1 3
 237.76816343 231.7223301
 1     3        
 1     5        
 2     2
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20090901/0e336f69/attachment-0001.html


More information about the grass-user mailing list