I am writing a code to copy rows of matching columns from CSV to PostgreSQL table. I am using python and qgis for the same.Code is as follows
connection=psycopg2.connect(host=host, port=port, dbname=dbname, user=name_user, password=password) …
I am trying to normalize my data. But it says, .map is not a function. How can I come up with this?
var Stprep = raindata.subtract(ltamean).divide(ltastd);
var SPI = Stprep .map(function(image){
var Imin = Stprep .reduce(ee.Reducer.min())
var…
I would like to use python and execute the Shortest Path Processing using QGIS. But I would like to ask on how can I load the Vector Layer (endPointLayer ) in the END_POINT (params)?
The below is my python code
endPointLayer =…
I'm building a plugin for QGIS using PyQGIS and PyQt5. I want to work with multiple windows. After clicking a button, a new window should open. Ideally, it should overlap window 1. After editing in window 2, it should go back to window 1.
My…
I need to convert this:
from qgis.core import QgsProcessing
from qgis.core import QgsProcessingAlgorithm
from qgis.core import QgsProcessingMultiStepFeedback
from qgis.core import QgsProcessingParameterVectorLayer
from qgis.core import…
Prior to the last Visual Studio Code update, I was able to set the windows environment variables.
Now with the new update I can't and I don't know what to do.
My code is quite long so to simplify it I have tried to change the windows prompt,…
I recently updated my QGIS and I noticed the styles now show the band Band 1(Gray)
The issue is it now shows within my print layout:
Using PYQGIS, how can I remove just the Band 1 (Gray)?
For reference, here is how I am currently setting the…
I'm trying to use a script that loads in a point layer from CSV. The code that I used is:
uri = "file:///some_path/PyQGIS/Some.csv?delimiter={}&xField={}&yField={}".format(os.getcwd(), ";", "X", "Y")
vlayer = QgsVectorLayer(uri, "Name",…
I have QGIS 3.16.3-Hannover installed with Qt 5.11.2 and 64-bit windows 10. In two more computers I also have it installed in similar conditions.
I am using the PyQgis to stand-alone applications from Qgis and I think there is something that is not…
I have a QGIS script that I am trying to load a vector layer that is stored in a Postgres database. When I print the layer's isValid() method I get False. Here is my code:
from qgis.core import *
db_client = 'postgres'
db_host = 'localhost'
db_port…
I have a list called 'DistInt' that contains values of Intensity with corresponding Distances for an earthquake event. Is there a way I can just print a specific row within list?
import math
import json
# Open JSON file
f =…
I am trying to convert some raster layers (from a wms) to vector layers, by using the Polygonize tool in QGIS3.14, however I always get this decoding error:
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x92 in position 41: invalid start…
I am using this code in QGIS's built-in python-editor.
How can I make the script wait while I mark the necessary lines, and only then continue execution? So far, I cannot do this: the window starts, but the script continues to execute and therefore…