Opened 11 years ago

Closed 6 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 by martinl, 11 years ago

Keywords: v.in.ogr added
Milestone: 7.0.0

comment:2 by martinl, 7 years ago

Milestone: 7.0.07.0.5

comment:3 by martinl, 6 years ago

Resolution: worksforme
Status: newclosed

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

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

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 by martinl, 6 years ago

In 69241:

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

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

Replying to mlennert:

Redefining this as a bug and reopening.

Please try r69241.

comment:7 by martinl, 6 years ago

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

in reply to:  6 comment:8 by mlennert, 6 years ago

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 by martinl, 6 years ago

Resolution: fixed
Status: closedreopened

comment:10 by martinl, 6 years ago

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 by martinl, 6 years ago

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.