I am trying to add a raster layer in c++ application with QtCreator and QGIS
2.6.0. I am currently trying to create a 32bit application under 64 bit
windows system. I am not sure if this would be the cause.

My code is as follows: 
QgsRasterLayer * layer = new
QgsRasterLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&pretty=true","raster";);
 
However, when I call layer.isValid(), it always return false.

I tried the python equivalent in qgis python console and it works fine. The
python code is as follows: layer =
QgsRasterLayer("http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer?f=json&pretty=true","raster";);

Any help is appreciated.



--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/Fail-to-create-raster-layer-in-C-but-is-able-to-do-so-in-python-tp5176356.html
Sent from the Quantum GIS - Developer mailing list archive at Nabble.com.
_______________________________________________
Qgis-developer mailing list
Qgis-developer@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to