Skip to main content

Questions tagged [standalone]

able to operate independently of other hardware or software.

Filter by
Sorted by
Tagged with
0 votes
1 answer
51 views

import module qgis.core in standalone script with pyqgis without running bat before with environment?

To run a python script (example file "standalone.py") with module qgis.core I have to use a specific bat file (that call the py file!) with the following environment! "rem Call ...
simone100's user avatar
  • 193
2 votes
1 answer
105 views

Running SAGA Next Gen algorithms in QGIS standalone script

Does anybody know how to run SAGA Next Gen algorithms in a standalone script? It was possible in QGIS 3.28 when the SAGA provider was a core plugin. I recently upgraded to 3.36.2 and installed the new ...
jger's user avatar
  • 137
0 votes
0 answers
72 views

Using Python from the QGIS installation without opening QGIS itself

I have a Python script that should be started via a batch file, Using Python from the QGIS installation without opening QGIS itself. Unfortunately this doesn't work because I think the Python ...
notapro's user avatar
1 vote
1 answer
271 views

Converting layer with multiple geometry types into single layers using PyQGIS

I'm developing a standalone script in PyQGIS and have downloaded data from OpenStreetMaps via Overpass Turbo. The data is given as GeoJSON and has been converted to gpkg. It contains multiple ...
user210818's user avatar
3 votes
1 answer
146 views

Using PyQGIS 3 in Visual Studio Code

I did all the steps in the video below: https://www.youtube.com/watch?v=qobogVuXtJU&list=PLbGkCPlkC_XTAUG5HC1WPhxMuZQnBQ7jU&index=1&t=308s When I run the full Python file, it throws this: ...
Zoltán Dévény's user avatar
1 vote
0 answers
26 views

Converting digitized shapefile into network in ArcGIS Pro - Standalone user-defined junction is detected

I am new to ArcGIS. I will briefly present my use case. I have an historical map of a railroad network in Italy. I have georeferenced the map and digitized it accordingly. I have now 2 shapefiles, one ...
Matteo's user avatar
  • 11
0 votes
1 answer
74 views

Can I utilize vectorization to improve performance instead of iterating over QGIS Features?

I am using Python to write a standalone application with QGIS. The application uses requests to allow the user to update a shapefile from the internet on demand. After fetching the shapefile, I need ...
Zach Longhofer's user avatar
3 votes
2 answers
200 views

Accessing layers from QgsContext transferred by completed QgsTask using PyQGIS

We have a headless QGIS standalone script that needs to run some I/O intensive layer retrieval tasks, each as parallel background threads before doing further GIS processing. We are invoking our ...
eliangius's user avatar
  • 275
1 vote
0 answers
84 views

IDW processing not running as expected in standalone script

I'm trying to automate idw interpolations from my database using PyQGIS in a standalone script. I copied the python command from the GUI which is how I got the fields I am using for the algorithm. ...
cucumber's user avatar
7 votes
1 answer
175 views

Hiding/showing layers in legend does not work in QGIS standalone

I'm building a standalone app with PyQGIS. I encountered some difficulties building a canvas that show the result layers after some operations. The canvas works, but the associated legend does not ...
Julien Goletto's user avatar
1 vote
1 answer
116 views

Run QGIS tool from standalone Python keeps locks on files

I have a Python application that runs some QGIS processing tools. The tools are called in a loop and I am looking to clean up the tool outputs (shapefiles) in between each iteration. I have found ...
Alex Gray's user avatar
2 votes
1 answer
805 views

Setting up QGIS Python scripts in Docker container

I am trying to set up QGIS within a Docker container in order to run standalone Python scripts, but I have a few problems. I first had a No module named PyQt5.sip error which I fixed by adding PyQt5 ...
Timothée Billiet's user avatar
0 votes
1 answer
133 views

Improving throughput of fullwms for standalone geowebcache

Currently, I am running an instance of geoserver, as well as a standalone instance of geowebcache. I've been trying to make use of the fullwms feature available in geowebcache, in order to proxy ...
tim kebbel's user avatar
2 votes
0 answers
96 views

Using from qgis.gui import * in QGIS standalone application

I have QGIS 3.28.7 installed on my computer and in its Python Console this command works: from qgis.gui import * I tried to use it in some Python IDE's. For example, in Spyder. The following paths ...
eug100's user avatar
  • 63
3 votes
1 answer
95 views

Loading and using QGIS plugins in standalone PyQGIS application

Is there a way to load and use the plugin outside of qgis3, in a standalone python application? I need to use the quickMapServices plugin to display an interactive basemap and mark points on it.
Ina G's user avatar
  • 31
0 votes
1 answer
264 views

Updating map after updating standalone tables with ArcGIS Pro [closed]

I am using ArcGIS Pro and have added a CSV file called 'Period 1' as a standalone table and mapped its destinations in my project. And now, I have a new version of 'Period 1' file after data cleaning. ...
Rachel Li's user avatar
1 vote
1 answer
268 views

Adding layers to QGIS from standalone PyQGIS script

Code snippet: from qgis.core import QgsApplication, QgsProject, QgsVectorLayer import os os.environ["PROJ_LIB"]="/Applications/QGIS.app/Contents/Resources/proj" app = ...
Pro Vebbis's user avatar
1 vote
0 answers
140 views

Adding markers to the map in standalone PyQGIS

I want to add markers to the map at geographical coordinates, preferably numbered labels as I need to identify different addresses given in a list. Later I want to export the map into PDF using ...
Tambet Väli's user avatar
2 votes
0 answers
113 views

Use VertexTool in QGIS/PyQGIS standalone application

I want to have a simple possibility to edit the geometry of a polygon in a QGIS standalone application. The VertexTool from QGIS would work well. I am in a standalone application and have therefore no ...
vezzon's user avatar
  • 569
3 votes
1 answer
209 views

Getting QGIS Project data from outside Python script

In my project, I have to connect .Net with the QGIS app, so I need to know how an outside script can get data from QGIS. I can run this script from .Net perfectly: from qgis.PyQt.QtWidgets import ...
Andrés Rodríguez's user avatar
0 votes
1 answer
312 views

Unable to run standalone PyQGIS script with launch.bat file

https://www.qgistutorials.com/ru/docs/running_qgis_jobs.html I want to run a script in a file called my_plugin.py. The script is: print ('Hello QGIS!') The path for the script is: C:\OSGeo4W\apps\...
simone100's user avatar
  • 193
0 votes
1 answer
62 views

Execute Slyr Algorithm in a standalone app

I'm trying to execute the Slyr : lyr_to_qml.py script (a script written by NorthRoad) in a standalone app. I'm having trouble running it, I get an "ModuleNotFoundError: No module named 'qgis'&...
Joseph's user avatar
  • 1
1 vote
1 answer
60 views

Missing translation for QgsMessageBar in standalone PyQGIS app

I am running a standalone PyQGIS application. Using QgsMessageBar I noticed that it is not using the local translation. Consider this minimal example running in a OSGeo4W environment (using all the ...
bugmenot123's user avatar
  • 10.9k
1 vote
3 answers
750 views

Running SAGA tools from Pycharm standalone QGIS (PyQGIS)

I am trying to run SAGA through the Python interface of QGIS. So far I have worked with only Native QGIS, and below code works for native. I would like to use SAGA fromout the same script, but am ...
RickB's user avatar
  • 13
1 vote
1 answer
204 views

Using SAGA Proessing in PyQgis Standanlone Script with batch file calling. "NameError: name 'processing' is not defined"

I am trying to run a standalone script to run PyQGIS 3.22 processes faster. Call PyQgis.bat via cmd: @echo off SET OSGEO4W_ROOT=C:\OSGeo4W SET QGISNAME=qgis-ltr SET QGIS=%OSGEO4W_ROOT%\apps\%QGISNAME%...
Mabignix's user avatar
  • 140
3 votes
0 answers
247 views

Running Python script file exported from QGIS Graphical Modeller in external terminal

For instance, I have created a simple graphical modeler which gives NDVI as an output when the NIR band and Red Band are provided: I exported the Python script using 'Export as script algorithm' in ...
unknown123's user avatar
2 votes
1 answer
215 views

Adding PostGIS mixed-geometry layers in standalone QGIS scripts the same way as QGIS GUI?

I am trying to use PyQGIS to load PostGIS layers into QGIS 3 using the code below: from qgis.core import QgsProject, QgsVectorLayer, QgsDataSourceUri, QgsApplication #init Qgis QgsApplication....
tinlyx's user avatar
  • 11.1k
3 votes
1 answer
936 views

QgsRasterLayer is invalid when run as standalone PyQGIS

The following code behaves as I expect when I run it in QGIS Python Console, but when I run it as a standalone from the console, the layer is invalid. urlWithParams = 'type=xyz&url=https://tile....
Mads Skjern's user avatar
1 vote
1 answer
617 views

Selecting Features By Rectangle in PyQGIS standalone

I want to select features by a rectangle in QGIS standalone using Python but the function iface.actionSelectRectangle().trigger() is not available in a standalone application. How to code iface....
user206295's user avatar
0 votes
1 answer
589 views

'QGIS Processing Executor'_Issue: "sqlite3_open ... unable to open database file"

Trying to run a self built-in QGIS-model (*.model3) using the followoing 'QGIS Processing Executor' (qgis_process) command in the command line does not work. C:\Program Files\QGIS 3.24.1\apps\Qt5\bin&...
Rick Atb's user avatar
0 votes
1 answer
654 views

OGR error "is not a directory" when moving to Windows from UNIX

I have to write a script that works either on Windows or macOS. I want to run these lines : processing.run('native:refactorfields',{ 'FIELDS_MAPPING' : [{'expression': '"Name"','length': 10,'...
Meije3984's user avatar
  • 165
1 vote
1 answer
57 views

PyQGIS standalone app processing with selectbylocation not working

I'm trying to run processing with selectbylocation in standalone app, everything seems to run fine but the output I'm getting is the main layer always, so it's not really working. And I have no idea ...
Micha's user avatar
  • 163
2 votes
1 answer
212 views

Solve "ERROR: Too many connections: max 64 while"

I would like to apply zonalstatisticsfb to 30 raster file on 3 different areas each time. I guess Python have to loop 90 times. This is the code I am using : def extract_stats(a,b,c): import ...
Meije3984's user avatar
  • 165
0 votes
1 answer
784 views

How to solve 'Warning 1: Field of width 255 truncated to 254.'

I get this warning message Warning 1: Field Date of width 255 truncated to 254. when I run this code : # Prepare the environment import sys import os from qgis.core import * from PyQt5.QtWidgets ...
Meije3984's user avatar
  • 165
3 votes
1 answer
355 views

Running PyQGIS without using the GUI

I found this topic and it is exactly what I want to do. As @casta2k in 2015 I am running MacOS. So I follow the step and that is what I get : >>> import sys >>> import os >>>...
Meije3984's user avatar
  • 165
0 votes
0 answers
86 views

Read CSV file with x/y to shapefile in standalone PyQGIS Script

I have read quite a few Q&As on this topic so far but still I have problems with correct import CSV file. I'm working in PyCharm and trying write function which will read CSV and save as vector ...
nomad_gis's user avatar
3 votes
2 answers
3k views

Looking for manual on how to properly setup standalone PyQGIS without GUI

My goal is to create a standalone PyQGIS script that is able to run QgsProcessingAlgorithm scripts without GUI. My setup runs on Windows and my IDE of choice is VS Code. I've followed the Windows ...
Mar Tijn's user avatar
  • 503
4 votes
2 answers
3k views

PyQGIS outside GUI: module 'qgis.processing' has no attribute 'run'

When trying to use processing.run() from a standalone (no GUI) mode, I get the following error: module 'qgis.processing' has no attribute 'run' in the following trivial example: from qgis import ...
Mar Tijn's user avatar
  • 503
3 votes
1 answer
339 views

PyQGIS custom application: no GUI appearing

I'm following the following instructions on getting Python to work with QGIS, outside the QGIS GUI itself: Using PyQGIS in custom applications. But for some reason the GUI is not appearing, yet the ...
Mar Tijn's user avatar
  • 503
7 votes
2 answers
863 views

Running the GRASS algorithm in standalone Python code using the PyQGIS processing module

What is the right way to import GRASS algorithms for a standalone Python script? I tried the solutions (solution1, solution2), but they didn't help me. Here's the code that doesn't import GRASS ...
Comrade Che's user avatar
  • 7,251
0 votes
0 answers
35 views

GPX track appears scaled down and in center of world using standalone PyQGIS

I'm trying to load a GPX-track as a layer in PyQGIS (standalone) but the track appears entirely on the wrong scale and position (scaled down in the middle of the equator). When I load the file ...
Dorus's user avatar
  • 1
0 votes
2 answers
573 views

Connecting PostgreSQL/PostGIS registry in qgis.core.QgsProviderRegistry

I'm developing a standalone QGIS based Python script for loading layers from/to PostgreSQL/PostGIS database. If I check the list using code: providers = QgsProviderRegistry.instance().providerList() ...
Satya Chandra's user avatar
1 vote
0 answers
76 views

Generating standalone file with QGIS

I need to share a project including all feature including images, styles and print settings. The user that receive this project should be able to print a paper like the .pdf I generate from my PC. I ...
Ale's user avatar
  • 1,313
7 votes
1 answer
270 views

QGIS Stand alone python script terminating problem

I want to write Python standalone QGIS script to layout export and my code is as follows: import os from qgis.core import ( QgsVectorLayer,QgsProject, QgsWkbTypes,QgsVectorLayerExporter,...
Satya Chandra's user avatar
1 vote
2 answers
1k views

Does QGIS still support standalone PyQGIS application development (outside of QGIS program)?

We have developed a few PyQGIS standalone applications that bring in PyQt5.Qtcore, PyQt5.QtGui, and qgis.core to display map and do custom logics etc. The applications started with QGIS python 2.7 all ...
For Comment's user avatar
  • 1,115
2 votes
1 answer
676 views

Loading WMS layer into QGIS Project through Python standalone script

I can load WMS layers by coding on QGIS Python console, those are the codelines: # Google Satelite URL wms url = 'type=xyz&url=http%3A//mt1.google.com/vt/lyrs%3Dy%26x%3D%7Bx%7D%26y%3D%7By%7D%26z%...
ConsalterR-1988's user avatar
4 votes
1 answer
1k views

Using custom Processing algorithm from standalone PyQGIS scripts (outside of GUI)

How can I run a custom algorithm using processing.run ? I've extended a QgsProcessingAlgorithm following qgis docs. I've managed to run a native algorithm in a standalone PyQGIS script following Using ...
Dorin's user avatar
  • 143
1 vote
1 answer
425 views

Adding Layers panel to standalone/custom PyQGIS application [duplicate]

Is there an option for adding a "Layers" panel to a custom/standalone PyQGIS application (like the one available in QGIS) or do I need to construct my own using something along the lines of ...
user1650538's user avatar
3 votes
1 answer
2k views

Loading QGIS project file with standalone PyQGIS Script

I've been working on a standalone PyQGIS script that loads a QGIS project file and opens it on the main canvas. I've written the script directly based on the PyQGIS Developer Cookbook here: https://...
Sam Alexander's user avatar
2 votes
1 answer
195 views

Invalid PostgreSQL layer after loading it with PyQGIS [duplicate]

In a standalone PyQGIS script, I try to load a PostgreSQL (PostGIS) layer with the following code (see below). The layer is always invalid, however when entering the code directly into the Python ...
nbfr's user avatar
  • 41