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

GRASS GIS trac at osgeo.org
Fri Nov 10 11:01:07 PST 2017


#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 at 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>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list