Advertisement
Guest User

Untitled

a guest
Dec 1st, 2014
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1. from PyQt4.QtCore import QFileInfo
  2. from qgis.core import *
  3.  
  4. def main():
  5.     QgsApplication([], True)
  6.     QgsApplication.setPrefixPath('/usr/share/qgis', False) #If this is set to true qgis can't find resources..
  7.     QgsApplication.initQgis()
  8.  
  9.     proj=QgsProject.instance()
  10.     proj.read(QFileInfo("source.qgs"))
  11.  
  12.     #do other stuff to the project
  13.  
  14.     proj.write(QFileInfo("target.qgs"))
  15.     QgsApplication.exitQgis()
  16.  
  17. if __name__ == "__main__":
  18.     main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement