[Qgis-developer] Python ogr driver issue (was ----> (no subject))
ludo
ludovic.granjon at wanadoo.fr
Sat Aug 25 03:22:36 PDT 2012
Hello
Thanks for your answer but I think the prefix is ok. I verified in the python console of qgis with QgsApplication.prefixPath()
Ludovic
> Message du 25/08/12 12:08
> De : "Germán Carrillo"
> A : "ludo"
> Copie à : qgis-developer at lists.osgeo.org
> Objet : Re: [Qgis-developer] Python ogr driver issue (was ----> (no subject))
>
> Hi Ludovic,
>
> probably the prefix path you are using is wrong. Try with '/usr/local/' or check where qgis bins and libraries are located and adjust the prefix path accordingly.
>
> Regards,
>
> Germán
>
>
2012/8/25 ludo
>
> Hi
> Yes you are right, I forgot the title I'm sorry
> I try your code on monday and I tell you
> Thanks
>
> Ludovic
>
>
>
>
>
> Message du 24/08/12 19:09
> > De : "Tim Sutton"
> > A : "ludo"
> > Copie à : qgis-developer at lists.osgeo.org
> > Objet : Re: [Qgis-developer] Python ogr driver issue (was ----> (no subject))
> >
> > Hi (adding a proper subject line to your messages is always nice)
> >
>
> On Fri, Aug 24, 2012 at 12:09 PM, ludo wrote:
> > > Hi all
> > >
> > > I try to start the developpement for a custom application with qgis, so I
> > > try simple things like add a vector layer but I have some problems. In a
> > > python console when I try to do something like that :
> > >
> > >>>> core.QgsApplication.setPrefixPath('/usr',True)
> > >>>> core.QgsApplication.initQgis()
> > >>>> l = core.QgsVectorLayer('/home/ludo/data/test.shp', 'test', 'ogr')
> > >>>> l.isValid()
> > >
> > > I always have a False result
> > >
> > > But if I try in the python console of qgis :
> > >
> > >>>> l = QgsVectorLayer('/home/ludo/data/test.shp', 'test', 'ogr')
> > >>>> l.isValid()
> > >
> > > The result is True
> > >
> > > Is someone have an idea ? Are there any other documentation that
> > > http://qgis.org/pyqgis-cookbook/
> >
> >
> > There is a growing set of python unit tests that you can consult for ideas.
> >
> > Providiing the stdout from your console might help us to understand
> > where your problem originates. Here is a little sript I often use:
> >
> > -----------------------------------------------------------------
> >
> > import os
> > import sys
> > from qgis.core import QgsApplication, QgsProviderRegistry
> >
> > myUseDefaultPathFlag = True
> > QGISAPP.setPrefixPath('/usr', myUseDefaultPathFlag)
> > QGISAPP.initQgis()
> > s = QGISAPP.showSettings()
> > print s
> > r = QgsProviderRegistry.instance()
> > if not 'ogr' in r.providerList():
> > print 'Could not find OGR provider!'
> > else:
> > print 'Providers found ok!'
> >
> > -----------------------------------------------------------------
> >
> > Hope that helps!
> >
> >
> > Tim
> > >
> > > Thanks a lot
> > >
> > > Ludovic
> > > _______________________________________________
> > > Qgis-developer mailing list
> > > Qgis-developer at lists.osgeo.org
> > > http://lists.osgeo.org/mailman/listinfo/qgis-developer
> > >
> >
> >
> >
> > --
> > Tim Sutton - QGIS Project Steering Committee Member (Release Manager)
> > ==============================================
> > Please do not email me off-list with technical
> > support questions. Using the lists will gain
> > more exposure for your issues and the knowledge
> > surrounding your issue will be shared with all.
> >
> > Visit http://linfiniti.com to find out about:
> > * QGIS programming and support services
> > * Mapserver and PostGIS based hosting plans
> > * FOSS Consulting Services
> > Skype: timlinux
> > Irc: timlinux on #qgis at freenode.net
> > ==============================================
> >
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
> --
> -----------
> |\__
> (:>__)(
> |/
>
> Soluciones Geoinformáticas Libres
> http://geotux.tuxfamily.org/
> http://twitter.com/GeoTux2
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20120825/acd3d605/attachment-0001.html>
More information about the Qgis-developer
mailing list