[Qgis-developer] timtut2: error message loading data

Martin Dobias wonder.sk at gmail.com
Thu Jan 13 16:21:03 EST 2011


Hi Sven

On Thu, Jan 13, 2011 at 4:37 PM, Sven Bauhan <sven.bauhan at ast.dfs.de> wrote:
> Hi,
>
> I am new here and dont know if this is the correct place for this question.
>
> I want to write an Editor for geographical data based on the QGis libraries.
> So i tried to compile and understand the code examples from Tim Sutton.
>
> The examples compile but in example 2 the loading of data fails with the
> messages:
>
> Failed to load
> Layer is NOT valid
>
> But the data seem to be correct, as it can be loaded into the QGis
> Apllication.
> Are there some hints to find out what the problem is?

you have probably forgotten to set the correct path to QGIS
installation. Without that, QGIS cannot locate modules which are
necessary for loading of various types of layers. Look for
setPrefixPath() function in your code and check what you pass there.
You don't write what OS do you use, but for example on unix systems
the default path where QGIS is installed is /usr (if installed from a
distribution package) or /usr/local (if built from source).

Regards
Martin


More information about the Qgis-developer mailing list