[GRASSLIST:4181] Adding CATs back to output from v.buffer/v.distance in 5.7 on Linux - Redhat

Craig Aumann caumann at ualberta.ca
Fri Aug 13 19:32:45 EDT 2004


I'm having serious problems trying to add cats back to the output from
v.buffer so that I can link the buffered attributes back up to the
original attribute table for the original points objects. I think I'm
stuck after calling v.distance.  I do hope there's an easy way to do
this.   


Here's what I've done: 

GRASS 5.7.0:~/grassalpac > v.category input=wellsselect option=report
FIELD 1:
type       count        min        max
point          7       9202      67256
line           0          0          0
boundary       0          0          0
centroid       0          0          0
area           0          0          0
all            7       9202      67256


GRASS 5.7.0:~/grassalpac > v.category in=wellsselect field=1
option=print
9202
42724
57869
58276
62189
65873
67256


GRASS 5.7.0:~/grassalpac > v.buffer input=wellsselect output=wellstemp
type=point buffer=100
\WARNING: Vector 'wellstemp' already exists and will be overwritten.
Lines buffers ...  100%
 
Building parts of topology ...
Building topology ...
7 primitives registered
Topology was built.
Number of nodes     :   6
Number of primitives:   7
Number of points    :   0
Number of lines     :   0
Number of boundaries:   7
Number of centroids :   0
Number of areas     :   -
Number of isles     :   -
Snapping boundaries ...
All vertices:   168
Registered points (unique coordinates):   138
Nodes marked as anchor     :   138
Nodes marked to be snapped :     0
Snapped vertices :     0
New vertices     :     0
Breaking boundaries ...
Intersections:     0
Removing duplicates ...
Duplicates:     1
Attaching islands ...
Building topology ...
6 areas built      0%
6 isles built
Topology was built.
Number of nodes     :   6
Number of primitives:   7
Number of points    :   0
Number of lines     :   0
Number of boundaries:   7
Number of centroids :   0
Number of areas     :   6
Number of isles     :   6
Number of areas without centroid :   6
Attaching centroids ...
Building topology ...
Topology was built.
Number of nodes     :   12
Number of primitives:   13
Number of points    :   0
Number of lines     :   0
Number of boundaries:   7
Number of centroids :   6
Number of areas     :   6
Number of isles     :   6
Rebuilding topology ...
Building topology ...
12 primitives registered
6 areas built      0%
6 isles built
Topology was built.
Number of nodes     :   12
Number of primitives:   12
Number of points    :   0
Number of lines     :   0
Number of boundaries:   6
Number of centroids :   6
Number of areas     :   6
Number of isles     :   6
GRASS 5.7.0:~/grassalpac >

---------------------------------------------------
DON'T UNDERSTAND WHY THERE ARE ONLY 6 AREAS - THE ORIGINAL POINTS 
ARE DISTINCT AND DO NOT OVERLAP - EVEN WITH MUCH LARGER BUFFERS THAN I
AM USING. 
---------------------------------------------------  



GRASS 5.7.0:~/grassalpac > v.category input=wellstemp output=wellsbuf
option=add field=2 step=1


GRASS 5.7.0:~/grassalpac > v.category in=wellsbuf type=centroid 
option=report
FIELD 1:
type       count        min        max
point          0          0          0
line           0          0          0
boundary       0          0          0
centroid       6          1          1
area           0          0          0
all            6          1          1
FIELD 2:
type       count        min        max
point          0          0          0
line           0          0          0
boundary       0          0          0
centroid       6          1          6
area           0          0          0
all            6          1          6




GRASS 5.7.0:~/grassalpac > v.distance -a from=wellsbuf
from_type=centroid from_field=2  \
>     to=wellsselect to_type=point  \
>     max=2 upload=cat col=LINK_KEY table=wellsbuf_att
 
Statistics:
0 categories with more than 1 feature in 'from'
0 categories - no nearest feature found
7 distances calculated
7 records inserted
0 insert errors


---------------------------------
## Wellsbuf_att looks like:

alpac_netdown=# select * from wellsbuf_att;
 from_cat | link_key 
----------+----------
        1 |     9202
        2 |    42724
        2 |    57869
        3 |    58276
        4 |    62189
        5 |    65873
        6 |    67256
(7 rows)

-----------------------------------------


GRASS 5.7.0:~/grassalpac > v.db.connect -o map=wellsbuf
table=wellsbuf_att key=from_cat field=2 \
>     driver=pg database="dbname=alpac_netdown,user=caumann"
WARNING: The table <wellsbuf_att> is now part of vector map <wellsbuf>
and may be deleted or overwritten by GRASS modules.


-----------------------------------------------------------

NOW, WHAT IS THE v.category COMMAND THAT I NEED TO ISSUE TO GET LINK_KEY
FROM THE LINKED TABLE COPIED OVER INTO THE CAT FOR A GIVEN FIELD (1 OR
3).  I JUST CAN'T FIGURE THIS OUT.  ALL THE OPTIONS I TRY DON'T HAVE THE
DESIRED BEHAVIOR.  




More information about the grass-user mailing list