Questions tagged [standalone]

able to operate independently of other hardware or software.

Filter by
Sorted by
Tagged with
17
votes
2answers
631 views

Accessing existing instance of QGIS in stand-alone Python script

For my own data analysis pipeline, I am running a split screen setup with IPython notebooks on one side, generating variables from source data, pushing them to a CSV file which QGIS then reads/joins ...
9
votes
2answers
3k views

how to load the QGIS openlayers_plugin in standalone python script (not the QGIS embedded python console)

if I try to load the openlayers plugin in a standalone application it always fails with False, although paths are set, and plugin shows available. (tested on Ubuntu 14.04, QGIS 2.4, python-2.7) #!/...
7
votes
2answers
2k views

Adding legend to canvas in standalone PyQGIS application? [closed]

I am trying to develop a standalone PyQGIS application. The map display does not pose any problems, but I do not know how to add a legend to the canvas.
7
votes
2answers
5k views

Using GRASS GIS in Python standalone scripts

I am trying to find a least cost path script for Python. I came across r.drain from GRASS GIS. Is it possible to use GRASS GIS in a Python standalone script? If so where can I download the bindings?
7
votes
1answer
497 views

Problem executing Processing Vector Grid algorithm in a standalone script

I have the following piece of code which I execute within QGIS 2.8.6 import processing import ogr restrLayer = QgsVectorLayer("/home/usr/Desktop/trial/EligibleAreas_polygons_filtered.shp", "...
5
votes
1answer
3k views

Saving vector memory layer to file using PyQGIS gives empty file?

I am learning to write standalone scripts with Pyqgis. I am trying to read a file with a big shapefile of polylines (64MB), create a memory layer, copy the features to, and save into another file ...
5
votes
1answer
1k views

Error: Could not load source layer for INPUT

Very simple piece of code. I'm trying to run this as a stand alone Python script, not in the console. Keeps giving the error "Could not load source layer for INPUT", shape not found. But the os.path....
4
votes
1answer
103 views

Adding column with area values in attributes table with standalone PyQGIS

I would like to add an area column to the Attributes table using Python. I prefer not to use QGIS Python console. I would like to do that using cmd. How should I change my code? My code and error ...
4
votes
2answers
1k views

pyQGIS 3.0 script not running with processing import

I have problems using version 3 of QGIS with Python 3. I followed different tutorials like this one : how to use pyqgis processing runalg clipvectorsbypolygon But it seems to be working only with ...
4
votes
1answer
1k views

PyQGIS Error: Cannot Create a QPixmap or Qwidget when no GUI is being used

I am trying to create a standalone script using the code below. I was able to add a shapefile with no errors but when I add map = QgsMapCanvas() after qgs.initQgis() and map.setLayerSet([...
4
votes
2answers
5k views

QGIS Python script for creating project file

Is there a way to create QGIS project file(.qgs) using only Python script outside QGIS Python console. I am trying to publish a map using QGIS Web Client using python. For this, I am trying to do ...
4
votes
1answer
385 views

Is it possible to create standalone installers for QGIS plugins?

Plugin in QGIS are managed by the internal plugin manager, and this requires active (and fast) internet connection. Another way to do it offline is answered here How to install a QGIS plugin when ...
4
votes
1answer
3k views

Making a Feature Form for a standalone PyQGIS application as in QGIS

In QGIS, there is a method named openFeatureForm defined in QgisInterface class. It opens a form that shows value of attributes for a given feature. layer = iface.activeLayer() feature = layer....
4
votes
2answers
147 views

QgsRasterCalculator fails in standalone Python application

I am trying to write a simple Python program which shall be a wrapper for QgsRasterCalculator() function, to use it in some batch processes. In both QGIS 2.14 (on Linux) and QGIS 3.10 (on Windows 10) ...
4
votes
1answer
1k views

Working Windows Standalone .EXE From QGIS Python Script Using PyInstaller?

Has anyone been able to create a working standalone Windows .EXE file from a QGIS Python Script Using PyInstaller?
4
votes
1answer
253 views

Creating standalone application with same directories and qgis-auth.db

I try to have a standalone QgsApplication (api documentation), but, instead of a lot of code samples found like this one below (I'm on Ubuntu): from qgis.core import QgsApplication QgsApplication....
4
votes
1answer
981 views

Select features and zoom to selection on standalone QGis application

I'm trying to select and zoom on selected features on standalone QGis application. Selection seems to work, console shows me list of selected items and they are exactly I expected. ids = [] for f in ...
4
votes
1answer
2k views

PyQGIS standalone script: how to join attributes by location?

I'm writing a stand-alone script using no GUI. Earlier I posted a question about having some code issues using JoinAttributes function. However, I found out that the function is not appropriate for ...
4
votes
1answer
85 views

Referenced table not found in standalone Python script

I'm trying to run a Python script from OSGeo4W Shell. Im doing this by typing "python-qgis C:\path\test.py" Everything seems to go fine until the script launches the processing module. After that ...
4
votes
1answer
299 views

mapCanvas.saveAsImage() doesn't work properly within loop in standalone script (only .PGW)

I have a problem with the export of QGIS 3 interface screenshots. I run stand-alone scripts and one of them launches QGIS and runs script.py with the following code : mapCanvas = iface.mapCanvas() ...
4
votes
1answer
91 views

Getting list of layers when opening a QGIS project on a standalone app?

I am trying to make a standalone QGIS app to read a .qgs file for rendering an image based on the vectors using LayoutManager. The problem is that when I try to print project.mapLayers() I get an ...
4
votes
2answers
548 views

Running standalone QGIS model script in Python

I am trying run an exported QGIS model as Python script from Anaconda. I followed Executing a standalone QGIS python script on Windows 10, and I get no error of modules, when running this I get no ...
3
votes
1answer
386 views

Get progression bar into PyQGIS 3 standalone script

When I run a treatment inside QGIS with Processing toolbox (native algorithms) I get a progression bar : Is there a way to use this percentage inside a standalone PyQGIS script? I searched in the ...
3
votes
1answer
1k views

Modifying the texture/fill of a vector layer in PyQGIS

Currently I am writing a standalone Python script to modify a few vector layers to have a wine fill pattern inside. The geometry I am working with is a polygon. I am aware of how to change outline ...
3
votes
1answer
3k views

How to create a valid QgsVectorLayer from delimitedtext?

I am having trouble loading csv files into layers using QgsVectorLayer(). I know this looks like a repeat, but I have carefully read Create a script to add delimited text layer in QGIS and http://...
3
votes
1answer
874 views

Viewer not displaying the data in my standalone PyQGIS Application

I tried creating a standalone external application of QGIS using python and I followed the tutorial mentioned in the link http://download.osgeo.org/qgis/doc/workshops/foss4g2007_qgis0.9_workshop_en....
3
votes
1answer
6k views

ERROR 4: Unable to open EPSG support file gcs.csv

I am writing a standalone QGIS python application to run some unittests. I am getting an error when I try to use the QgsCoordinateReferenceSystem library. ERROR 4: Unable to open EPSG support file ...
3
votes
1answer
4k views

from qgis._core import * ImportError: DLL load failed: [duplicate]

I have looked every pages, links, forums etc. It is a standalone application. I add all paths that I can find to the PATHS and PYTHONPATH is here: C:\OSGeo4W64\apps\qgis-dev\python C:\OSGeo4W64\apps\...
3
votes
1answer
6k views

QT C++ application using QGIS API

I'm trying to develop a QT C++ application that uses QGIS API and I can't manage Qt Creator to compile the code. I've read several topicts at gis.stackexchange and from other sources. The information ...
3
votes
1answer
197 views

Standalone QGIS App keeps crashing. Issue with Context or Threads?

I'm trying to setup an application for my company, that generates a PDF file for specific user generated coordinates: The user enters an address into the frontend (Flask generated), which is ...
3
votes
1answer
816 views

Which python version for standalone script with Qgis module

I'm writing a standalone python script, and I need to use Qgis module. For information i'm working on a Mac and I already have Qgis 2.18 installed. So in list of module importation, I wrote this : ...
3
votes
2answers
82 views

Algorithm qgis:joinattributesbylocation not found

I would like to join attributes by location using standalone PyQGIS but I'm getting error. I have QGIS 3.16 installed on my machine. from qgis.core import * QgsApplication.setPrefixPath("C:/...
3
votes
0answers
453 views

GeoPandas causing issues with PyQGIS standalone

I have a code where I would like to be able to use both GeoPandas and PyQGIS. However, it seems that including GeoPandas is causing issues in the output of PyQGIS. Here is a small illustration using ...
3
votes
0answers
318 views

Python standalone on linux: No module named qgis.core

I am using the Spyder IDE on my Ubuntu LTS 16.04. It does not find the module qgis.core. Therefore I wanted to manually add it to its search path but I do not now where it is located. What is the ...
3
votes
1answer
360 views

Choosing layers to dump in legend for a standalone application

I'm writing a standalone application using QGIS API to export maps automatically as pdf. When I'm building my QgsComposition, I have an issue: I have already built a list with the layers I want to ...
3
votes
0answers
485 views

Use QGIS API on standalone python program without install the entire application

I developed a standalone python program that makes use of QGIS API to create .qml files from sld files. This is a small program of about 15 lines of code that imports the following modules and uses ...
2
votes
1answer
64 views

No output in Python console when using PyQGIS

When I run my code in QGIS Python console I get output, but when I run my code from normal console I didn't get any output. Why does it work only in QGIS Python console? import sys, os sys.path....
2
votes
1answer
652 views

if __name__==“main”: in standalone Python script for QGIS

I am working on a standalone Python script for loading shapefile layers into an application window with my central widget being canvas. The previous code I had written is almost identical to the code ...
2
votes
2answers
1k views

Using Windows Batch File (.bat) for executing QGIS Python program without opening QGIS Software

I have a Python Program for doing some geoprocessing in QGIS. The starting of the Python program is given below. import sys from qgis.core import * import qgis.utils from qgis.gui import * from ...
2
votes
1answer
79 views

Why when dump a layer to memory, initial record is 1, if in original layer was 0?

I load a layer from a Shapefile (featuresA) and duplicate its contents into a memory layer (featuresB). featuresA[0].id() is 0, but when copy his content to memory over featureB is 1, ...
2
votes
1answer
145 views

Fails to run JoinAttributes in stand-alone PyQGIS script

I'm writing a stand-alone script using no GUI. I cannot use the function Join Attributes by Location. I think that the problem might be with proper passing arguments to the function. There's a piece ...
2
votes
1answer
215 views

Writing test suite for QGIS standalone application?

I have a rather simple QGIS standalone Python app (2.8.2, Windows 7/64), with some published methods to create different types of geometric primitives (rectangles, circles). class MyApp(QMainWindow, ...
2
votes
1answer
56 views

openFeatureForm in PyQGIS Standalone Application

I am trying to implement a desktop application with PyQGIS 3. When I try to use openFeatureForm to display the data of the selected layer object it shows an error, however when I use this code in the ...
2
votes
1answer
952 views

How to make a Standalone QGIS application run as an exe file

I had made a simple standalone application and that works fine. But the user have to execute a batch file(inside in which I had set the QGISHOME path, Python path and call my main python file) to run ...
2
votes
1answer
1k views

Loading Oracle Spatial Layers in standalone python qgis

I used below script to connect to postgres and load layers successfully.I want to aceive this using Oracle Spatial for both vector and raster loading.How can I achieve that?In other words what is the ...
2
votes
1answer
195 views

Calling a plugin (quickosm) from a python standalone application?

I am trying to call the QGIS-plugin quickosm from a standalone Python application and I´m not quite sure how to or if this is even possible. My QGIS version is 3.10 (using OSGeo4W64) with the ...
2
votes
2answers
185 views

Does ArcPy (Standalone) have option like Spatial filter?

I want to get the polyline features intersecting with a polygon geometry and having a particular field values in ArcPy standalone script. There is another link for similar subject but it is not for ...
2
votes
1answer
594 views

QGIS3 Creating spatial index in a standalone script as a part of output vector layer

I am making a buffer analisys in a standalone script. Is it possible to automatically during the analisys add index to the output vector layer (".qix" file)? I tried to add after the analisys like in ...
2
votes
1answer
475 views

Processing step is ignored in QGIS3 standalone python script

In my python script based on Qgis 3.0.3-Girona, the processing.run() is completely ignored. There are similar questions that are marked as duplicate - but those do not address or solve the issue that ...
2
votes
1answer
87 views

Spread attribute and recursively join in standalone pyqgis app

TL;DR Is there a pyqgis equivalent to R's tidyr::spread or reshape2::cast ? If not, how do we recursively join by attribute n layers to another without erasing previous join ? The problem I have a ...