Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. uri = QgsDataSourceUri()
  2. uri.setConnection(host, port, db_name, user, password)
  3. uri.setDataSource("Data", "FieldOfViewIndex", "geom", "", "PlatformID")
  4. vlayer = QgsVectorLayer(uri.uri(False), "FieldOfViewIndex", "postgres")
  5. QgsProject.instance().addMapLayer(vlayer)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement