New answers tagged

0

Yes, that's possible with the QGIS API, namely with QgsVectorLayerEditUtils.addTopologicalPoints(). This is a ready-to-use code snippet (adapted from here): # Preparation index = QgsSpatialIndex(layer) # Optimize intersection checks edit_layer = QgsVectorLayerEditUtils(layer) request = QgsFeatureRequest().setNoAttributes() # Get rid of attributes ...


2

To add a vertex you need to select the feature you want the vertex added to. Then activate vertex tool: When hovering with your mouse over your selected line you will see a small plus sign between two verticies. Click on that to add a new vertex, and drag & drop that new vertex to the existing one of the other (not selected) line. With snapping enabled (...


0

I'm no expert with QGIS, but it looks like the python process is trying to make a new directory in your var folder, which it won't have permissions to do. I just tried it out directly in python on my mac to confirm: >>> import os >>> os.makedirs('/var/folders/test') Traceback (most recent call last): File "<stdin>", line 1,...


1

Here is an of an example of how you could achieve your goal of allowing the user to select any number of available fields. This is how I would approach it anyway! Since you want to get user input, I am assuming you want some kind of simple GUI. You could use a few simple widgets like a QgsMapLayerComboBox, a QListWidget, a QTableWidget and a couple of ...


0

Could also be related to the fact that there are two QGIS executables that get installed, one without a lot of the additional extensions, one with. Check your shortcuts folder, there should be two icons/executables. Make sure you run 'QGIS Desktop with Grass 7.x'.exe


0

QGIS actually has a few different executables/shortcuts. Can you make sure you are running QGIS from the 'QGIS Desktop 3.x with GRASS 7.x' shortcut This ensures all GRASS resources were loaded into the application. It could be on your system, this manifests as an access denied error.


1

First, create the entire process within the modeler, and include the input "File/Folder". Then open it with the inbuilt Python editor in QGIS, then edit any code with the file path to the name of the input. In my example, I have defined the folder as "folderlocation", given it a path. This is the only place you will need to change the ...


1

Surprisingly, after @BERA's comment, this was not a computationally taxing as I thought it would have been. I used the Generate points (Pixel Centroids) inside polygons as you suggested; though it only made a list of points and with no values. I then used the Sample Raster Values to sample the DEM, using the points generated from the previous step. Made the ...


0

To take it a step further: get the extent, and build a new rectangular polygon from it. This works like the "Extract layer extent" tool in QGIS 3.8 (may be a quicker way, but this works for me. There's some bonus stuff in here too, like adding and populating new fields to an otherwise empty layer, and changing the opacity). In this example, ...


0

To take it a step further: get the extent, and build a new rectangular polygon from it. This works like the "Extract layer extent" tool in QGIS 3.8 (may be a quicker way, but this works for me. There's some bonus stuff in here too, like adding and populating new fields to an otherwise empty layer, and changing the opacity). In this example, ...


0

Had the same issue. Try exporting the TIN-ed layer and manually defining the extent, making sure that the North, East, South, and West values are divisible by the pixel size, in this case 5m Then define the resolution as the required pixel size. Hopefully this does the trick.


4

You can solve it using this expression in the tool Select by Expression if("datum" = array_last( array_agg( expression:= "datum", filter:= array_length( array_agg( expression:=$geometry, group_by:=geom_to_wkt($geometry)))>1, group_by:=geom_to_wkt($geometry) ) ) , $id, '') The ...


1

For QGIS 3.x you can use the pushInfo() method on a feedback object: feedback.pushInfo('This is a log message') See the scripts section of the user's manual for other relevant methods.


Top 50 recent answers are included