Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. from qgis.core import *
  2. from qgis.utils import *
  3. import os, sys
  4.  
  5. QgsApplication.setPrefixPath("C:/OSGeo4W64/apps/qgis", True)
  6. app = QApplication([], True)
  7. QgsApplication.initQgis()
  8.  
  9. sys.path.append('C:/OSGEO4~1/apps/qgis/python/plugins')
  10. from processing.core.Processing import Processing
  11. Processing.initialize()
  12. from processing.tools import *
  13.  
  14. layer1 = "path/to/point_shapefile.shp"
  15. layer2 = "path/to/polygon_shapefile.shp"
  16. result = "path/to/output_shapefile.shp"
  17.  
  18. general.runalg("qgis:joinattributesbylocation", layer1, layer2, u'intersects', 0, '', 1, result)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement