<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>> > Is it possible that oracle, mysql, postgresql in ogr have multiple layers per <br>> > datasource?<br><br>The answer is yes, oracle, mysql and postgresql can have multiple layers per dataset<br> 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> the connection string is "MYSQL:dbname,user=username,password=secret" for OCI<br> is something like this "OCI:user/password@database" and for Postgresql is something<br> 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> available layers in the dataset, the user selects one and then the connection string<br> is sended to ogr provider constructor via qgis interface <br> <br> mIface->addVectorLayer(URI , layername, "ogr");<br><br> 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> <br></div><br><br><hr id="stopSpelling">> Date: Wed, 1 Aug 2007 09:17:16 +0200<br>> From: scb@lo-res.org<br>> To: qgis-developer@lists.qgis.org<br>> Subject: Re: [Qgis-developer] about ogr provider<br>> <br>> Mon 30 Jul 2007 19:38, Marco Hugentobler wrote:<br>> > The ogr provider is mostly used for reading shapefiles and GML. Afaik those <br>> > datasources have only one layer per file (which fits perfectly with the <br>> > approach in qgis). <br>> > Is it possible that oracle, mysql, postgresql in ogr have multiple layers per <br>> > datasource?<br>> i dont know for oracle, mysql, postgresql but ogr supports that if the<br>> fileformat allows it.. cf. e.g. the GRASS OGR driver..<br>> <br>> http://www.gdal.org/ogr/drv_grass.html<br>> <br>> (note however layered files are not that common in the standard use of<br>> GRASS GIS)<br>> <br>> > If yes, then we should think about how to handle that in QGIS. <br>> > I'm in favour that the plugin asks the ogrprovider how many layers are <br>> > present<br>> that sounds reasonable..<br>> <br>> > and the plugin then creates one Vectorlayer for each ogr layer.<br>> that's not such a good idea. before any layer is created QGIS the<br>> user should have the possibility to select the layers s/he wants.<br>> <br>> my cent,<br>> s.<br>> _______________________________________________<br>> Qgis-developer mailing list<br>> Qgis-developer@lists.qgis.org<br>> 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>