Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uri = QgsDataSourceUri()
- uri.setConnection(host, port, db_name, user, password)
- uri.setDataSource("Data", "FieldOfViewIndex", "geom", "", "PlatformID")
- vlayer = QgsVectorLayer(uri.uri(False), "FieldOfViewIndex", "postgres")
- QgsProject.instance().addMapLayer(vlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement