<div dir="ltr">Hi,<div><br></div><div>I'd like to create from an existing GRASS vector map that has 3 layers (with three attribute tables) a new vector map that has only one layer and its associated attribute table (here the information related to layer 3). </div><div><br></div><div>What I am doing so far (in python):</div><div><br></div><div># First copy the map to a new one and copy table (that of layer 3) </div><div># that I want to re-connect to new map</div><div><div>grass.run_command("g.copy",</div><div><span class="" style="white-space:pre">             </span>overwrite=True,<br></div><div><span class="" style="white-space:pre">          </span>vector="oldmap,newmap")</div><div>grass.run_command("db.copy",</div><div><span class="" style="white-space:pre">             </span>overwrite=True,<br></div><div><span class="" style="white-space:pre">          </span>from_table="table_layer3",</div><div><span class="" style="white-space:pre">               </span>to_table="table_layer3_copy")</div><div><br></div><div># Second delete all tables of the newmap</div><div>for i in [1,2,3]:</div><div><span class="" style="white-space:pre">    </span>grass.run_command("v.db.droptable",</div><div><span class="" style="white-space:pre">                              </span>flags="f",<br></div><div><span class="" style="white-space:pre">                             </span>map="newmap",</div><div><span class="" style="white-space:pre">                            </span>layer=i)</div><div><span class="" style="white-space:pre"><br></span></div><div><span class="" style="white-space:pre"># Third reconnect a table to the newmap     </span></div><div>grass.run_command("v.db.connect",</div><div><span class="" style="white-space:pre">         </span>overwrite=True,</div><div><span class="" style="white-space:pre">            </span>map="newmap",</div><div><span class="" style="white-space:pre">            </span>table="table_layer3_copy")</div></div><div><br></div><div>When I check in the attribute table manager, there is only one layer listed (layer 1).</div><div>Similarly, v.db.connect reports:</div><div><div>v.db.connect -p map=newmap                                   </div><div>Vector map <newmap> is connected by layer <1/table_layer3_copy> table <table_layer3_copy> in database [...]</div></div><div><br></div><div>However, in d.vect I can still select from all three layers that were in the old map (-1,1,2,3),</div><div>and all of them can be displayed (with -1 specified)?</div><div>So does may newmap have three layers or only one?</div><div><br></div><div>How can I make the third layer the default layer 1 and remove all other layers?</div><div>Or is there a way to copy a vector map with just a single layer and its associated table specified as default?</div><div><br></div><div>Thank you very much!</div><div><br></div><div>/Johannes</div><div><br></div><div><br></div></div>