<div dir="ltr"><div><div><div><div>Hello all,<br><br></div>I'm writing a GRASS module with pygrass to import data from a text file into a new vector map.<br>Those data have topological relationships: they are nodes and links of a sewer network. But those objects may have different types of attributes. For example a link could be a pipe or a pump.<br></div>Therefore I think that the use of vector layers is the right way to store those data.<br><br></div>With pygrass I managed to set DB links and import the attributes in different tables.<br>But the only way I've found to change the layer of geometric features is with .open(mode='w', layer=X). This works well for one layer, but I've to write different objects in different layers.<br></div>I tried to close the map and re-open it with another layer, but if I pass mode='rw', the map refuse to open because the layer not yet exist, and with mode='w', it overwrite the existing map.<br><div><div><br></div><div>I know there is a way to create a new map for each layer and then use existing GRASS modules to "merge" them into a single map, but I feel that this is overly complex.<br><br></div><div>So my question is: Is there a way to decide which layer to write new objects, and change this layer during the import process?<br><br>I'm using grass70-svn with the following version of libgis:<br>libgis Revision: 62395 <br>libgis Date: 2014-10-26 18:17:27<br><br>Thanks for you help.<br><br></div><div>Regards,<br></div><div>Laurent<br></div><div><br></div></div></div>