Opened 6 years ago

Last modified 5 years ago

#3436 new defect

Renaming a vector map doesn't rename the layer name in the dbln metadata file

Reported by: hcho Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Vector Version: svn-trunk
Keywords: Cc:
CPU: Unspecified Platform: Unspecified

Description

The layer name in dbln is not renamed when renaming a vector map. For example, after renaming old to new:

g.rename vect=old,new
cat location/mapset/vector/new/dbln

prints

1/old|new|cat|database|pg

Expected output:

1/new|new|cat|database|pg

Attachments (1)

vect_rename_layer_names.diff (1.5 KB ) - added by mlennert 6 years ago.

Download all attachments as: .zip

Change History (5)

in reply to:  description comment:1 by mlennert, 6 years ago

Replying to hcho:

The layer name in dbln is not renamed when renaming a vector map. For example, after renaming old to new:

g.rename vect=old,new
cat location/mapset/vector/new/dbln

prints

1/old|new|cat|database|pg

Expected output:

1/new|new|cat|database|pg

Does the layer name necessarily have to correspond to the map name ? AFAIU, layer names are mostly used for direct OGR access. Internally in GRASS vector format, it's the layer number that is used. So I'm not sure I would call this a bug, but potentially an enhancement request for aesthetic reasons.

The same actually happens when you copy a map:

g.copy vect=roadsmajor,roads
Copie vector <roadsmajor@PERMANENT> vers <roads> dans le jeu de cartes
courant
GRASS 7.3.svn (nc_spm_08_grass7):~ > v.db.connect -p roadsmajor
Vector map <roadsmajor> is connected by:
layer <1/roadsmajor> table <roadsmajor> in database </home/mlennert/GRASSDATA/nc_spm_08_grass7/PERMANENT/sqlite/sqlite.db> through driver <sqlite> with key <cat>
GRASS 7.3.svn (nc_spm_08_grass7):~ > v.db.connect -p roads
Vector map <roads> is connected by:
layer <1/roadsmajor> table <roads> in database </home/mlennert/GRASSDATA/nc_spm_08_grass7/user1/sqlite/sqlite.db> through driver <sqlite> with key <cat>

I'll add a diff that seems to do the trick for me, but I'm not sure that this is really needed, nor if it is desirable. Martin introduced the layers names so he should probably have a look at it.

by mlennert, 6 years ago

comment:2 by martinl, 6 years ago

Milestone: 7.2.4

comment:3 by martinl, 5 years ago

Milestone: 7.2.47.6.2

Any chance to apply diff in trunk?

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

Replying to martinl:

Any chance to apply diff in trunk?

As I said; since you are the author of the layer name mechanism, I was leaving this to you for checking. ;-)

Note: See TracTickets for help on using tickets.