Opened 8 years ago

Closed 3 years ago

#1494 closed defect (fixed)

v.in.ogr key flag does not change category values and you loose connection between features and attributes

Reported by: mlennert Owned by: martinl
Priority: major Milestone: 7.0.5
Component: Vector Version: svn-trunk
Keywords: v.in.ogr Cc: grass-dev@…
CPU: Unspecified Platform: Unspecified

Description

Currently, v.in.ogr internally creates cat values for an imported vector. It would be great if one could tell v.in.ogr to use an existing attribute column as cat value, including when importing using the -t flag to not create any attribute table within grass.

Change History (11)

comment:1 Changed 8 years ago by martinl

Keywords: v.in.ogr added
Milestone: 7.0.0

comment:2 Changed 3 years ago by martinl

Milestone: 7.0.07.0.5

comment:3 Changed 3 years ago by martinl

Resolution: worksforme
Status: newclosed

v.in.ogr in GRASS 7 has key parameter which allows you to define key column,

comment:4 in reply to:  3 ; Changed 3 years ago by mlennert

Priority: normalmajor
Resolution: worksforme
Status: closedreopened
Summary: wish: v.in.ogr add possibility to use existing attribute column as category value, including with -t optionv.in.ogr key flag does not change category values and you loose connection between features and attributes
Type: enhancementdefect

Replying to martinl:

v.in.ogr in GRASS 7 has key parameter which allows you to define key column,

Yes, but apparently it doesn't work:

g.copy vect=boundary_county,bc
v.db.addcol bc col="newcat int"
v.db.addcolumn bc col="newcat int"
v.db.update bc col=newcat qcol=cat+1000
v.out.ogr bc out=bc
v.in.ogr bc/bc.shp out=bc_test key=newcat
v.db.connect -p bc_test
v.db.univar bc_test col=newcat
v.category bc_test op=report

You will see that the db connection is correctly defined with the 'newcat' column as the key, but the features' category values are still automatically generated from 1. You thus loose the connection between features and attributes !

Redefining this as a bug and reopening.

Moritz

comment:5 Changed 3 years ago by martinl

In 69241:

v.in.ogr key flag does not change category values and you loose connection between features and attributes (see #1494)

comment:6 in reply to:  4 ; Changed 3 years ago by martinl

Replying to mlennert:

Redefining this as a bug and reopening.

Please try r69241.

comment:7 Changed 3 years ago by martinl

Cc: grass-dev@… added
Owner: changed from grass-dev@… to martinl
Status: reopenednew

comment:8 in reply to:  6 Changed 3 years ago by mlennert

Resolution: fixed
Status: newclosed

Replying to martinl:

Replying to mlennert:

Redefining this as a bug and reopening.

Please try r69241.

Seems to work perfectly. Thanks !

Leaving open until backport.

comment:9 Changed 3 years ago by martinl

Resolution: fixed
Status: closedreopened

comment:10 Changed 3 years ago by martinl

In 69250:

v.in.ogr key flag does not change category values and you loose connection between features and attributes (see #1494) (merge r69241 from trunk)

comment:11 Changed 3 years ago by martinl

Resolution: fixed
Status: reopenedclosed

In 69251:

v.in.ogr key flag does not change category values and you loose connection between features and attributes (fix #1494) (merge r69241 from trunk)

Note: See TracTickets for help on using tickets.