Linked Questions

22 votes
3 answers
20k views

Importing qgis.core when writing standalone PyQGIS script

I am trying to write a standalone Python script in windows 7 that uses qgis.core and various other qgis libraries. I have found an old question on this subject at Writing standalone Python scripts ...
user24956's user avatar
  • 409
19 votes
3 answers
6k views

Import error for qgis.core when running OSGeo4w shell script

I've been trying, along with this post, to run a script in OSGeo4w Shell, outside of QGIS. But I get the following error: ImportError: No module named qgis.core I have also read the following ...
Joseph's user avatar
  • 75.3k
9 votes
3 answers
9k views

Where is QGIS installation path in Ubuntu

I can't find the QGIS installation path in ubuntu 12.10
Vassilis's user avatar
  • 3,436
6 votes
5 answers
24k views

How to merge many individual KML layers into one?

I'd like to open a USGS KML file of bedrock geology for an entire county, but there are over 2,000 individual polygon layers. Does anyone know if there is a way to merge all of these layers together ...
Patrick's user avatar
  • 271
5 votes
2 answers
2k views

Create normal vector and calculate distance between start point and intersection

I have one line-layer which pictures a street net and a point-layer which defines certain locations. Please see in the picture below: What I am trying to do is to create a normal vector through a ...
applebrown's user avatar
11 votes
2 answers
3k views

Writing scripts that can call on both Arcpy and PyQGIS?

I have spent quite a bit of time looking for a clear answer this topic and have still been unable to really accomplish my goal of accessing PyQGIS in a stand alone script. Parts of answers have been ...
CWDWILSO's user avatar
  • 111
2 votes
2 answers
3k views

QGIS layer tree API returns only groups and not layers

I am trying to use the QGIS python API to read out the groups and layers in a QGIS (2.4) project. Here is a code snippet from my script, which is run from a shell, not from the QGIS python console! ...
user39235's user avatar
2 votes
1 answer
2k views

Importing QGIS core into Python on OSX

I am interested in learning how to write standalone scripts using QGIS. An answer to my previous question directed me to the PyGIS CookBook which has the following instructions for importing the ...
djq's user avatar
  • 16.2k
4 votes
1 answer
322 views

QGIS: Script is being executed successfully in Python console (within QGIS) but not in a standalone python script [duplicate]

I have the following code which I have no problem executing within QGIS (2.8.6) via the python console. What the script does is it adds the two raster layers in my directory via the Raster Calculator: ...
ELD's user avatar
  • 507
3 votes
0 answers
637 views

Cannot run QGIS algorithm with python script without interface

I'm trying to run the QGIS 'intersection' algorithm from a Python script: (Working with Ubuntu) #!/usr/bin/env python # -*- coding: UTF-8 -*- import sys from qgis.core import * from PyQt4.QtGui ...
EliseB's user avatar
  • 343
0 votes
0 answers
289 views

Moving polygons to points and rotated using QGIS

I'm using QGIS 2.18.11. So I have a list of various coordinates and rotation angle. I'd like to paste a template polygon with each of their center point positioned on each coordinate and rotated by an ...
GIS_Newbie's user avatar