[Qgis-developer] vector layers loaded using pyQGIS not isValid()
Martin Dobias
wonder.sk at gmail.com
Mon Apr 4 07:50:39 EDT 2011
On Mon, Apr 4, 2011 at 1:45 PM, Marco Lechner - FOSSGIS e.V.
<marco.lechner at fossgis.de> wrote:
> Am 04.04.2011 13:20, schrieb Martin Dobias:
>> Hi
>>
>> you have to call QgsApplication.setPrefixPath() prior to call to
>> initQgis(). It is covered here:
>> http://www.qgis.org/pyqgis-cookbook/intro.html#using-pyqgis-in-custom-application
>>
>> Otherwise it fails to find data providers and thus it's impossible to
>> load layers.
>>
>> Regards
>> Martin
> so this is
> QgsApplication.setPrefixPath("/usr/", True)
>
> works.
>
> thnx.
>
> But why did it work for the geotif?
Until qgis 1.7 the raster layers were using data provider system only
for WMS. Ordinary layers opened with GDAL didn't require providers.
Martin
More information about the Qgis-developer
mailing list