Opened 10 years ago
Closed 6 years ago
#2641 closed defect (wontfix)
Copy cat value to a new layer does not work
Reported by: | pvanbosgeo | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.0.7 |
Component: | Vector | Version: | unspecified |
Keywords: | attribute | Cc: | |
CPU: | Unspecified | Platform: | Unspecified |
Description
I have a vector map with layer=1 linked to attribute table and layer=2 providing the number of overlapping categories. Aim is to create a third layer with unique values for each feature/polygon. The third step below, uploading the cat values from layer 2 to layer 3 doesn't work.
# Add layer 3 to the vector layer test
# add attribute table v.category test op=add layer=3 type=centroid out=test2 v.db.addtable test2 layer=3 column="cat2 integer"
# Upload cat from layer 2 to layer 3 v.to.db test2 layer=3 query_layer=2 op=cat columns=cat2
Error message:
... WARNING: Record (cat 75456) already exists (not inserted) WARNING: Record (cat 75457) already exists (not inserted) WARNING: Record (cat 75458) already exists (not inserted) WARNING: Record (cat 75459) already exists (not inserted) WARNING: Record (cat 75460) already exists (not inserted)
100%
75460 categories read from vector map (layer 3) 75460 records selected from table (layer 2) 75460 categories read from vector map exist in selection from table 0 records updated/inserted (layer 3)
Change History (11)
comment:1 by , 9 years ago
Milestone: | 7.0.1 → 7.0.2 |
---|
comment:4 by , 9 years ago
Component: | Default → Vector |
---|---|
Keywords: | attribute added |
comment:5 by , 9 years ago
Replying to pvanbosgeo:
I have a vector map with layer=1 linked to attribute table and layer=2 providing the number of overlapping categories. Aim is to create a third layer with unique values for each feature/polygon. The third step below, uploading the cat values from layer 2 to layer 3 doesn't work.
# Add layer 3 to the vector layer test
# add attribute table v.category test op=add layer=3 type=centroid out=test2 v.db.addtable test2 layer=3 column="cat2 integer"
# Upload cat from layer 2 to layer 3 v.to.db test2 layer=3 query_layer=2 op=cat columns=cat2
AFAIK query_layer is only used for op=query (and op=sides), but not for op=cat.
Currently, if you need to get the cats of another layer, you have to create an attribute table linked to that layer and the use op=query to get the cat values, although I don't know what will happen with a layer 2 as yours where some features have several cat values...
BTW, I tried to test the case where you want to upload cat values to a new column (not the key column) to see how v.to.db handles uploading several cat values for a single feature, but v.to.db chokes on that since before uploading cat values it tests whether these value already exist in the key column of the database, even if you want to upload these values to another column than the key column... But that should probably be documented in another bug report.
In brief, I wouldn't consider this a bug (or at most a documentation bug), as uploading cat values into one column in the case where a feature might have several values is not clearly defined...
comment:8 by , 9 years ago
Milestone: | 7.0.4 → 7.0.5 |
---|
comment:9 by , 8 years ago
Milestone: | 7.0.5 → 7.0.6 |
---|
comment:10 by , 7 years ago
Milestone: | 7.0.6 → 7.0.7 |
---|
comment:11 by , 6 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
Ticket retargeted after 7.0.1 milestone closed