Hi Tim,
We cannot provide the exact code due to organizational policies. But the logic
looks somewhat like this.
We are facing issue in selecting the spatial columns of the spatial table.
Also please provide the qgis-developer mailing list id.
from qgis.PyQt.QtSql import QSqlDatabase, QSqlQuery
if not QSqlDatabase.isDriverAvailable('QOCISPATIAL'):
print ('Oracle driver not available')
db = QSqlDatabase.addDatabase("QOCISPATIAL")
db.setDatabaseName('Hostname' + '/' + 'database')
db.setDatabaseName(‘hostname’+ ':' + str('port') + '/' + 'database')
db.setUserName(‘username)
db.setPassword('password')
if not db.open():
print ('Could not open connection.')
q = QSqlQuery(db)
q.exec_('SELECT * FROM tablename’)
while(q.next()):
print(str(q.value(0)))
db.close()
Thanks & Regards,
Gopal Krishna Mantri
Phone:- 020-67259194
[TCS Sig New]
From: Tim Sutton [mailto:[email protected]]
Sent: Tuesday, August 13, 2019 5:10 PM
To: Gopal Mantri <[email protected]>
Cc: [email protected]; Anupriya Mall <[email protected]>
Subject: Re: [Qgis-community-team] Issue regarding spatial data reading in
Python API
"External email. Open with Caution"
Can you direct your query to the qgis-developer mailing list rather please -
and do supply specific code examples of what you have already tried. If you ask
generic questions you will likely get generic answers.
Also make sure to consult the cookbook before asking your question:
https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/
Regards
Tim
On 13 Aug 2019, at 07:16, Gopal Mantri
<[email protected]<mailto:[email protected]>> wrote:
Hello team,
I want to create maps through python API in QGIS with Oracle database
containing spatial data.
I am able to connect the database. But, I am facing issue in reading the
spatial points.
Can I get help in how to read spatial data and create map through Python API?
Thanks & Regards,
Gopal Krishna Mantri
Phone:- 020-67259194
<image001.jpg>
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you
_______________________________________________
Qgis-community-team mailing list for organizing community resources such as
documentation, translation etc..
[email protected]<mailto:[email protected]>
https://lists.osgeo.org/mailman/listinfo/qgis-community-team
—
[cid:[email protected]]
Tim Sutton
Co-founder: Kartoza
Ex Project chair: QGIS.org<http://QGIS.org>
Visit http://kartoza.com<http://kartoza.com/> to find out about open source:
Desktop GIS programming services
Geospatial web development
GIS Training
Consulting Services
Skype: timlinux
IRC: timlinux on #qgis at freenode.net<http://freenode.net>
I'd love to connect. Here's my calendar link<https://calendly.com/timlinux> to
make finding time easy.
_______________________________________________
Qgis-community-team mailing list for organizing community resources such as
documentation, translation etc..
[email protected]
https://lists.osgeo.org/mailman/listinfo/qgis-community-team