Questions tagged [standalone]

able to operate independently of other hardware or software.

Filter by
Sorted by
Tagged with
4
votes
1answer
76 views

Error “No module named PyQt5.QtCore” in QGIS standalone application

import os, sys sys.path.append(r'C:\Program Files\QGIS 3.6\apps\qgis\python') sys.path.append(r'C:\Program Files\QGIS 3.6\apps\qgis\bin') sys.path.append(r'C:\Program Files\QGIS 3.6\apps\Python37') ...
1
vote
0answers
45 views

Setting the CRS of Raster in standalone PyGQIS

I'm generating raster files without a CRS and would like to assign one. I am attempting to use GDAL's assign projection, which works perfectly inside QGIS, but seems to have no effect when run in my ...
1
vote
1answer
60 views

Running 'r.null' processing algorithm in Standalone Python script on Windows

I want to run this code outside QGIS as a standalone Python script. import os import processing os.chdir('C:/Users/User/test/25') alg_params = { '-c' : False, '-f' : False, '-i' : False, '-n' : ...
0
votes
0answers
31 views

Running QGIS 3.1 Graphical Modeler Script as standalone

I have troubles running a Graphical Modeler Script as standalone via the OSGeo4W Shell console. Everything works fine when I run the script in QGIS. When I open it via shell, nothing happens. I think ...
4
votes
0answers
154 views

Using PyQGIS functions outside QGIS

I want to use PyQGIS function crs.isValid() in normal Python file outside of QGIS like this: wkt = 'GEOGCS["WGS84", DATUM["WGS84", SPHEROID["WGS84", 6378137.0, 298....
0
votes
1answer
54 views

QGIS: How to modify the selection style when selecting features in a standalone script

It's quite easy to modify the default style that QGIS applies when selecting attributes in the GUI by following the steps in this question: QGIS: How to modify the appearence of selected attributes ...
4
votes
1answer
4k 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....
2
votes
1answer
65 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 ...
4
votes
1answer
106 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 ...
2
votes
1answer
69 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....
0
votes
0answers
39 views

WFS layer invalid in standalone python script

I have a project in 3.10.11 (ltr) loading a layer from a Geoscience Australia WFS. https://services.ga.gov.au/site_1/services/Geomorphology_Scale_Guide_WM/MapServer/WFSServer?request=GetCapabilities&...
3
votes
2answers
98 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:/...
0
votes
0answers
40 views

Scale bar for standalone PyQGIS layout clumped together

I'm trying to implement a scalebar for my layout in a standalone application. This is my current code: def createLayout(Main): layers = Main.canvas.layers() project = QgsProject.instance() ...
1
vote
0answers
32 views

Importing processing from QGIS into IDLE

I have been trying to make a program that creates a virtual raster based on the files that are input. Whenever I run my code it says. Traceback (most recent call last): File "C:/Users/Zach/...
0
votes
0answers
92 views

DLL load failed when loading PyQGIS in PyCharm with script (Windows)

I am trying to setup PyCharm to work with PyQGIS. I followed this tutorial: https://silverspringenergy.com/using-pycharm-as-an-ide-for-qgis-3-plugin-development-2/. Some files were located elsewhere ...
0
votes
0answers
43 views

Using QGIS Processing-Toolbox in stand alone Python scipt (Microsoft Visual Studio)

I'm using QGIS 3.14, Python 3.7, Processing-Version 2.12.99 and Microsoft Visual Studio 2019 (IDE). Everything works fine, the only problem I have is the import of the processing-algorithms. Related ...
2
votes
0answers
52 views

PyQGIS Standalone QVectorLayer works and QRasterLayer not work without QgsApplication / initQgis()

I'm trying to make a standalone python app and I want to use in some parts of app functions of PyQGIS. I'm testing things to understand how it works. Doing tests I have found a situation that I do ...
1
vote
1answer
110 views

QGIS standalone application in python can't access 3d:tessellate processing tool

I'm developing a standalone QGIS application and I want to run the tessellate (3d:tessellate) processing tool using the following code:  import processing from qgis.analysis import ...
0
votes
1answer
133 views

Extract by location works improperly in PyQGIS standalone script

I have been trying to extract polygons from one layer that intersect a polygon in another layer, and another extract that is disjointed, and looping this over several files organized by date. When ...
1
vote
1answer
72 views

pyqgis: Get the Click on canvas standalone app

I added a subwindow in a MDI area containing a QgsMapCanvas. Defined the clic tool QgsMapToolEmitPoint. But when I click on the canvas there's no response, al least it should print 'clicked'. ¿¿May ...
2
votes
1answer
240 views

Errors while importing QGIS 3.10 from standalone Python, but not from QGIS's Python Console

I try to load a QGIS project in standalone Python on Windows 10. This is the code that I use: from qgis.core import * qgs = QgsApplication([], False) QgsApplication.setPrefixPath("C:\Program ...
0
votes
1answer
106 views

QGIS C++ API doesn't work with ECW files

I'm new with QGIS. After lots of trying I finally executed a successful compile on QGIS libs and used them in my program. In my simple program I just read some layers (vector and raster) and showed ...
2
votes
1answer
216 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 ...
3
votes
1answer
228 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 ...
4
votes
1answer
95 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 ...
0
votes
1answer
239 views

QGIS Application in C++ [closed]

I'm new to QGIS 2.8 Library to develop standalone map application in qt4, C++ language. I was wondering if there is any way that I can use QGIS plugins such as Advanced viewshed analysis, Contour ...
2
votes
2answers
223 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 ...
4
votes
1answer
104 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
175 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
263 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....
1
vote
1answer
87 views

Layer failed to load using PyQGIS on macOS Mojave

The following is the code that I wrote with the help of PyQGIS Developer Cookbook from qgis.core import * from qgis.gui import * import os #Reference to QgsApplication qgs = QgsApplication([], False)...
4
votes
2answers
633 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 ...
1
vote
1answer
830 views

Algorithm not found by PyQGIS?

I have troubles using PyQgis processing module with QGIS 3.8. For example, I can reproject a layer with QGIS graphic interface, but when using PyQgis processing module through the following script : ...
1
vote
1answer
149 views

Running QGIS script in external Python code gives TypeError?

I have one piece of Python code that I wrote in QGIS 3.6 (I'll call this code1) and I have a second piece of Python code that is a bigger project, which I wrote just in a normal text programme and ...
1
vote
0answers
99 views

Iterating over layers and exporting them as images with PyQGIS

In QGIS I have the layer tree with the following layers: Roads Transition Differences Study_area I would like to iterate over the layers and export two different images where Roads and Differences ...
0
votes
0answers
147 views

Loading .qgs and .qpt files in standalone PyQGIS script?

I have a .qgs and .qpt files. And I would like to know if it is possible to use them in a standalone PyQGIS script? I am using QGIS 2.18 and Python 2.7 This is the template that I would like to use. ...
5
votes
1answer
2k 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....
2
votes
0answers
58 views

Do I need the standalone GRASS app if I have the GRASS Plugin and Processing toolbox enabled in QGIS? [closed]

What processing abilities does the standalone GRASS GIS application have that aren't available in the QGIS GRASS plugin/toolbox? I'm trying to understand whether you would need/want the standalone ...
3
votes
1answer
416 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 ...
2
votes
1answer
659 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 ...
4
votes
1answer
318 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() ...
2
votes
0answers
190 views

How to use QGIS plugins functionality in standalone application

I'm new to QGIS 3 Library to develop standalone map application in qt4, C++ language. I was wondering if there is any way that I can use QGIS plugins such as Advanced viewshed analysis, Contour plugin ...
3
votes
0answers
475 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 ...
2
votes
1answer
484 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 ...
5
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 ...
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 ...
1
vote
0answers
99 views

QGIS 3, iterate shapefiles to export mulitple pdfs from a standalone python script

I would like to load my qgis project, and a template I made into my stand alone script (in pycharm). I have a folder with shapefiles and I would like to iterate over them, plot each one with the ...
1
vote
0answers
215 views

QGIS 2.18 C++ API: How do I match the scale of vector and raster layers with different crs?

I'm loading two layers to QGIS maps canvas: the first is a shapefile, with EPSG:4326 crs. The second is an xml for Goolge TileServer, with EPSG:3857 crs. Google TileServer - Hybrid.xml <...
2
votes
2answers
2k 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
88 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 ...