[Qgis-developer] Python ogr driver issue (was ----> (no subject))
ludo
ludovic.granjon at wanadoo.fr
Mon Aug 27 00:32:56 PDT 2012
Hi
Ok so I try your script Tim and I obtain this :
Application state:
Prefix: /usr
Plugin Path: /usr/lib/qgis/plugins
Package Data Path: /usr/share/qgis
Active Theme Name:
Active Theme Path: :/images/themes//
Default Theme Path: :/images/themes/default/
SVG Search Paths: /usr/share/qgis/svg/
User DB Path: /usr/share/qgis/resources/qgis.db
Could not find OGR provider!
When I do
for i in r.providerList():
print i
I have
delimitedtext
gdal
gpx
But the same in the python console of QGIS :
\etat de l'application :
Prefixe: /usr
Chemin de l'extension : /usr/lib/qgis/plugins
Chemin vers les donnees : /usr/share/qgis
Nom du theme actif : default
Chemin vers le theme actif : :/images/themes/default/
Chemin vers le theme par defaut : :/images/themes/default/
Chemin SVG: /usr/share/qgis/svg/
/home/ludo/.qgis//svg/
Chemin vers la base utilisateur : /usr/share/qgis/resources/qgis.db
and
WFS
gdal
gpx
grass
grassraster
memory
mssql
ogr
osm
postgres
spatialite
wms
Do you know where is the problem ?
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
> ==============================================
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20120827/0da082c6/attachment.html>
More information about the Qgis-developer
mailing list