<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body><div style="text-align: left;">Hi Marco and Sebastian:<br><br>Sorry for my late answer, I was out for a week.<br><br>&gt; &gt; Is it possible that oracle, mysql, postgresql in ogr have multiple layers per <br>&gt; &gt; datasource?<br><br>The answer is yes, oracle, mysql&nbsp; and postgresql can have multiple layers per dataset<br>&nbsp; in fact a ogr dataset points to a database.<br><br>I have made some tests and I found some details:<br><br>1.- URIS for diferent database servers use different syntaxis, ej: for mysql<br>&nbsp; &nbsp; the connection string is "MYSQL:dbname,user=username,password=secret" for OCI<br>&nbsp;&nbsp;&nbsp; is something like this "OCI:user/password@database" and for Postgresql is something<br>&nbsp;&nbsp;&nbsp; like this "PG:host=server user=user password=password dbname=databasename".<br><br><br>2.- The ogr plugin uses a visual form to connect to the dataset and show a list of<br>&nbsp;&nbsp;&nbsp; available layers in the dataset, the user selects one and then the connection string<br>&nbsp;&nbsp;&nbsp; is sended to ogr provider constructor via qgis interface <br>&nbsp; &nbsp; <br>&nbsp; &nbsp;&nbsp; mIface-&gt;addVectorLayer(URI , layername, "ogr");<br><br>&nbsp;&nbsp;&nbsp; but only the URI is passed to ogr provider constructor.<br><br>could it be possible to add an alternate constructor to ogr provider that gets URI and layername<br>so we could do a simple test for "PG:", "MYSQL:" and "OCI:" in URI and if true, use the layername<br>parameter?<br><br>Best regards<br><br>Godofredo Contreras<br><br><br><br><br><br>&nbsp;<br></div><br><br><hr id="stopSpelling">&gt; Date: Wed, 1 Aug 2007 09:17:16 +0200<br>&gt; From: scb@lo-res.org<br>&gt; To: qgis-developer@lists.qgis.org<br>&gt; Subject: Re: [Qgis-developer] about ogr provider<br>&gt; <br>&gt; Mon 30 Jul 2007 19:38, Marco Hugentobler wrote:<br>&gt; &gt; The ogr provider is mostly used for reading shapefiles and GML. Afaik those <br>&gt; &gt; datasources have only one layer per file (which fits perfectly with the <br>&gt; &gt; approach in qgis). <br>&gt; &gt; Is it possible that oracle, mysql, postgresql in ogr have multiple layers per <br>&gt; &gt; datasource?<br>&gt; i dont know for oracle, mysql, postgresql but ogr supports that if the<br>&gt; fileformat allows it.. cf. e.g. the GRASS OGR driver..<br>&gt; <br>&gt; http://www.gdal.org/ogr/drv_grass.html<br>&gt; <br>&gt; (note however layered files are not that common in the standard use of<br>&gt; GRASS GIS)<br>&gt; <br>&gt; &gt; If yes, then we should think about how to handle that in QGIS. <br>&gt; &gt; I'm in favour that the plugin asks the ogrprovider how many layers are <br>&gt; &gt; present<br>&gt; that sounds reasonable..<br>&gt; <br>&gt; &gt; and the plugin then creates one Vectorlayer for each ogr layer.<br>&gt; that's not such a good idea. before any layer is created QGIS the<br>&gt; user should have the possibility to select the layers s/he wants.<br>&gt; <br>&gt; my cent,<br>&gt; s.<br>&gt; _______________________________________________<br>&gt; Qgis-developer mailing list<br>&gt; Qgis-developer@lists.qgis.org<br>&gt; http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer<br><br /><hr />Find a local pizza place, movie theater, and more….then map the best route! <a href='http://maps.live.com/default.aspx?v=2&ss=yp.bars~yp.pizza~yp.movie%20theater&cp=42.358996~-71.056691&style=r&lvl=13&tilt=-90&dir=0&alt=-1000&scene=950607&encType=1&FORM=MGAC01' target='_new'>Find it!</a></body>
</html>