1

I have loaded rasters from PostGIS and Oracle Spatial 11g with below script. Both layers are visible in QGIS Dekstop. My OWS settings are correct but the Oracle raster layers are not visible in QGIS-Web-Client.

Why are these not visible?

uri = QgsDataSourceURI()
uri.setConnection("localhost", "5432", "MYRASTER", "postgres", "password")
connString = "PG: dbname=MYRASTER host=localhost user=postgres password=pass port=5432 mode=2 schema=public column=rast table=demelevation" 
layer = QgsRasterLayer( connString, "My Postgres Raster" )
QgsMapLayerRegistry.instance().addMapLayer( layer )


#Connect to Oracle and Fetch Table Names 
con = cx_Oracle.connect('ins/ins@189.88.22.122:1521/mydb')
print con.version
cur = con.cursor()
cur.execute(u"select DISTINCT RASTERID from MASTER_RDT ")
tables = cur.fetchall()
print tables

print "Layer loop"
for t in tables :
   print str(t[0])
   conn1="geor:ins/ins@189.88.22.122:1521/mydb,"
   conn2="MASTER_RDT,"
   conn3= str(t[0])
   vlayer=QgsRasterLayer(conn1+conn2+conn3,conn2+conn3)
   QgsMapLayerRegistry.instance().addMapLayer(vlayer)
0

Figured it out by trial and error.If the Layer name is comma separated like MYRASTER,2348 the layer is visible in Desktop but not in Web Client.I changed the name of Oracle rasters to single word and now can view them QGIS Web Client.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.