<div dir="ltr"><div>Hi Markus,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Mar 12, 2020 at 10:19 PM Markus Metz <<a href="mailto:markus.metz.giswork@gmail.com">markus.metz.giswork@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><br>On Thu, Mar 12, 2020 at 12:43 PM Johannes Radinger <<a href="mailto:johannesradinger@gmail.com" target="_blank">johannesradinger@gmail.com</a>> wrote:<br>><br>> Hi all,<br>> I am using v.in.ogr to import a shape file (line vector) that has only one layer. Although I am specifying the output parameter in v.in.ogr the layer name of the imported map still remains the original; it is only the output map and the associated table that gets a new name as defined by 'output'.<br>><br>> When checking the connections of that map using v.db.connect:<br>> v.db.connect -p map=my_new_map@analysis2 <br>> Vector map <my_new_map@analysis2> is connected by:<br>> layer <1/Watercourse> table <my_new_map> in database </.../analysis2/sqlite/sqlite.db> through driver <sqlite> with key <cat><br>><br><div>> Is that the intended behavior of v.in.ogr that the layer name does not get renamed based on the output parameter?</div><div><br></div><div>Not sure how much intention is in this behaviour, but the GRASS-internal layer name is mostly informative. GRASS vector layers are usually addressed by number, not by name. It is probably safe to ignore the layer name of native GRASS vectors.</div></div></blockquote><div><br></div><div>I agree that the layer name is probably mostly informative (at least I didn't realize so far how/where it is involved in daily work with GRASS). However, during some recent analysis I discovered that the layer name affected how tables get renamed when new additional tables in new layers are created... Then it is weird when the old initial layer name pops up in a table name.</div><div>To better illustrate the issue I generated a working example to reproduce what I mean. This is based on an INSPIRE GML file where the layer name did not get renamed during import and where it affected the (re)naming of a table:</div><div><br></div><div>####</div><div># Create location with EPSG:4258<br># Download GML file from <a href="https://geoportal.bafg.de/inspire/download/reporting_units/WFDDesignatedWatersFish/WFDDesignatedWatersFish_DE.gml">https://geoportal.bafg.de/inspire/download/reporting_units/WFDDesignatedWatersFish/WFDDesignatedWatersFish_DE.gml</a><br><br># Import vector data with user-defined output name<br>v.in.ogr input=/home/jradinger/Downloads/WFDDesignatedWatersFish_DE.gml output=Fishdata<br>g.region vector=Fishdata<br><br># Check connection parameters<br>v.db.connect -p map=Fishdata@PERMANENT <br>#Vector map <Fishdata@PERMANENT> is connected by:<br>#layer <1/WFDDesignatedWatersFish_LIN> table <Fishdata> in database </home/jradinger/GIS/GRASS_locations/Freshwater/PERMANENT/sqlite/sqlite.db> through driver <sqlite> with key <cat><br>### Layer name got not renamed! <br><br># To reproduce: Add new cat and table on layer 2 and layer 3<br>v.category input=Fishdata layer=2 output=Fishdata2 option=add<br>v.db.addtable map=Fishdata2 layer=2<br>v.category input=Fishdata2 layer=3 output=newFishdata option=add<br>v.db.addtable map=newFishdata layer=3<br><br>db.tables -p<br># A original table in layer 1 was renamed to newFishdata_WFDDesignatedWatersFish_LIN using the initial layer name<br></div><div>#########</div><div><br></div><div>Don't know the underlying mechanisms how tables get renamed....</div><div><br></div><div>/Johannes</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>Markus M</div><div><br></div>><br>> cheers,<br>> Johannes<br>><br>> <br>> _______________________________________________<br>> grass-user mailing list<br>> <a href="mailto:grass-user@lists.osgeo.org" target="_blank">grass-user@lists.osgeo.org</a><br>> <a href="https://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">https://lists.osgeo.org/mailman/listinfo/grass-user</a></div>
</blockquote></div></div>