[GRASS-dev] [GRASS GIS] #3436: Renaming a vector map doesn't rename the layer name in the dbln metadata file

#3436: Renaming a vector map doesn't rename the layer name in the dbln metadata
file
-------------------------+-------------------------
Reporter: hcho | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Vector | Version: svn-trunk
Keywords: | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
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
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3436&gt;
GRASS GIS <https://grass.osgeo.org>

#3436: Renaming a vector map doesn't rename the layer name in the dbln metadata
file
--------------------------+-------------------------
  Reporter: hcho | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Vector | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by mlennert):

Replying to [ticket:3436 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.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3436#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3436: Renaming a vector map doesn't rename the layer name in the dbln metadata
file
--------------------------+-------------------------
  Reporter: hcho | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone:
Component: Vector | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by mlennert):

* Attachment "vect_rename_layer_names.diff" added.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3436&gt;
GRASS GIS <https://grass.osgeo.org>

#3436: Renaming a vector map doesn't rename the layer name in the dbln metadata
file
--------------------------+-------------------------
  Reporter: hcho | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.6.2
Component: Vector | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------
Changes (by martinl):

* milestone: 7.2.4 => 7.6.2

Comment:

Any chance to apply diff in trunk?

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3436#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3436: Renaming a vector map doesn't rename the layer name in the dbln metadata
file
--------------------------+-------------------------
  Reporter: hcho | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.6.2
Component: Vector | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by mlennert):

Replying to [comment:3 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. :wink:

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3436#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>