All Questions
34
questions
0
votes
0
answers
50
views
How to keep attributes after a clipping operation in PyQGIS?
I'm trying to do a spatial clipping operation between 2 point layers, representing buildings and earthquakes, and a buffer area created by the user. The problem is that after operation, all attributes ...
0
votes
0
answers
40
views
Clip function for QGIS plugin is not accurate
I am trying to build a QGIS plugin using QGIS 3.28.14, python 3.9 and in VS code environment. The problem is that when I use Native: Clip function, the resulted file has smaller area than the area I ...
4
votes
1
answer
340
views
"Could not load source layer for MASK: invalid value" error when iterating over features in polygon layer and clipping raster by mask layer in PyQGIS
I have just started using PyQGIS and need to loop over parcels in a vector layer to clip a raster layer.
For each parcel, I want to generate a .tif file with the feature.id() in the filename. I will ...
3
votes
1
answer
322
views
Clipping point layer with polygon overlay using PyQGIS
The following script works just fine and as intended:
import processing
import time
start_tot = time.time()
path = 'C:\\Users\\tlind\\Dropbox\\Documents\\'
ext = ".shp"
municipalities = [...
1
vote
0
answers
330
views
Processing raster changes pixel value from 255 to 0
I have a raster which I need to clip with a polygon using PyQGIS. So far it works fine, but now I came across some special cases in my source rasters where my script shows behaviour I do not ...
1
vote
1
answer
49
views
Splitting and exporting quadrant of big map [closed]
I'm quite new to Python and QGIS (and to PyQGIS).
I have a very big map, made of many layers, and a fishnet overlaying it. I would like to clip and export the map for each quadrant (or maybe just ...
1
vote
0
answers
143
views
How to use a clipped Raster with Raster Calculator in a script
I want to make a script which will asking me a raster layer, a vector layer and a double.
The point is to clip the raster and then process to filter data, like (raster > filter)*raster.
My script ...
1
vote
0
answers
158
views
PyQGIS 3.4 Processing Memory Issue
I am using GDAL to clip my DEM by the selected polygon in the active layer with QGIS 3.4. I am facing a problem with the memory layer. I read the questions asked before related to this topic PyQGIS ...
2
votes
1
answer
444
views
Clip overlap from polygons
I am trying to script the clipping of overlapping areas from a set of polygons. After having fetched features (outerFeature) a loop (innerFeature) is to check if other features intersect with area > 0....
4
votes
1
answer
438
views
QGIS processing.run() standalone script does not write .prj and .cpg output files of shapefile?
I've created a python standalone script to clip two shapefiles with qgis. I've installed qgis3 with OSgeo4W. The logic is as follows:
import qgis
from qgis.core import *
from qgis.core import ...
2
votes
0
answers
133
views
Clipping vector by iterating through input clippers using PyQGIS?
I have a python script that I want to work in QGIS 3.0.
#importing all necessary modules
import processing, os, glob
result_path =("/home/brent/Documents/Hansen_new_data/Regions_Min/Province/TI/CADT/...
2
votes
1
answer
2k
views
Extracting raw data from WCS raster using QGIS python console?
I am trying to replicate the following manual workflow in the Python console of QGIS 3.4.7
Manual workflow:
1) Connect to WCS service.
Name: USGS National Map Elevation OGC-WCS
URL: https://...
2
votes
1
answer
1k
views
Clipping in PyQGIS2 working but error in PyQGIS3 (argument 1 has unexpected type 'str')
I am trying to clip streets by a layer with municipalities in them. I was trying to run this script in QGIS3 but obtain the error hereunder.
Traceback (most recent call last): File
"C:\OSGEO4~1\...
1
vote
0
answers
99
views
PyQGIS clip results in empty layers
I am creating a Python/PyQGIS tool in QGIS 2.18 which combines a few functions:
Extract several attributes from source layer
Redefine a coordinate system
Optional: clip the source layer with a ...
1
vote
1
answer
425
views
Clip several overlapping polygons at a time - QGIS
I have a shapefile with lots of overlapping polygons made out of buffering street lines. I need to clip them so that the overlapping part goes to only one feature and gets excluded from the other, ...