[Qgis-developer] about ogr provider

godofredo contreras frdcn at hotmail.com
Mon Aug 6 17:04:35 EDT 2007


Hi Marco and Sebastian:Sorry for my late answer, I was out for a week.> > Is it possible that oracle, mysql, postgresql in ogr have multiple layers per > > datasource?The answer is yes, oracle, mysql  and postgresql can have multiple layers per dataset  in fact a ogr dataset points to a database.I have made some tests and I found some details:1.- URIS for diferent database servers use different syntaxis, ej: for mysql    the connection string is "MYSQL:dbname,user=username,password=secret" for OCI    is something like this "OCI:user/password at database" and for Postgresql is something    like this "PG:host=server user=user password=password dbname=databasename".2.- The ogr plugin uses a visual form to connect to the dataset and show a list of    available layers in the dataset, the user selects one and then the connection string    is sended to ogr provider constructor via qgis interface          mIface->addVectorLayer(URI , layername, "ogr");    but only the URI is passed to ogr provider constructor.could it be possible to add an alternate constructor to ogr provider that gets URI and layernameso we could do a simple test for "PG:", "MYSQL:" and "OCI:" in URI and if true, use the layernameparameter?Best regardsGodofredo Contreras > Date: Wed, 1 Aug 2007 09:17:16 +0200> From: scb at lo-res.org> To: qgis-developer at lists.qgis.org> Subject: Re: [Qgis-developer] about ogr provider> > Mon 30 Jul 2007 19:38, Marco Hugentobler wrote:> > The ogr provider is mostly used for reading shapefiles and GML. Afaik those > > datasources have only one layer per file (which fits perfectly with the > > approach in qgis). > > Is it possible that oracle, mysql, postgresql in ogr have multiple layers per > > datasource?> i dont know for oracle, mysql, postgresql but ogr supports that if the> fileformat allows it.. cf. e.g. the GRASS OGR driver..> > http://www.gdal.org/ogr/drv_grass.html> > (note however layered files are not that common in the standard use of> GRASS GIS)> > > If yes, then we should think about how to handle that in QGIS. > > I'm in favour that the plugin asks the ogrprovider how many layers are > > present> that sounds reasonable..> > > and the plugin then creates one Vectorlayer for each ogr layer.> that's not such a good idea. before any layer is created QGIS the> user should have the possibility to select the layers s/he wants.> > my cent,> s.> _______________________________________________> Qgis-developer mailing list> Qgis-developer at lists.qgis.org> http://lists.qgis.org/cgi-bin/mailman/listinfo/qgis-developer
_________________________________________________________________
Find a local pizza place, movie theater, and more….then map the best route!
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20070806/5d0c9b5c/attachment.html


More information about the Qgis-developer mailing list