New answers tagged qgis
0
votes
Identifying dead-end/cul-de-sac areas in a road network
There are four simple steps that work like this in any geospatial software, here for QGIS:
Explode the road lines: each segement is a separate feature.
Extract start- and end-points of each line and ...
4
votes
QGIS The colors I choose and the colors that are on the screen are not the same
There's not quite enough information to debug what specifically is going wrong here, but here's what I do to troubleshoot weird raster colour shifts:
Temporarily make this raster layer the only ...
1
vote
QGIS 3.40.6 - Labeling Auxiliary Storage & arcgis-feature-server (REST)
The auxiliary data are saved with the QGIS project (you can access it if you unzip the [project_name].qgz, the auxiliary data are in the [project_name].qgd file that can be opened as a SpatiaLite ...
3
votes
Accepted
Override default keyboard shortcut while QGIS plugin window is active
In the end the solution I've used is:
On plugin startup, get a list of existing QGIS shortcuts
Add an eventFilter to my QMainWindow, and listen for WindowDeactivate and WindowActivate events
When ...
1
vote
More control of CSV in the QGIS model builder
You don’t necessarily need the Model Builder to solve this. QGIS can load a CSV file with an automatically detected delimiter using Python and PyQGIS. Python’s built-in csv module contains a Sniffer ...
1
vote
Using WFS layer as input on the QGIS Model Designer
Just use "Vector Features" as an input. This will allow you to use a WFS layer:
In python, your algorithm parameters will look like this:
{
CLIP: True,
EXTENT: '397745.6653,404496.5114,...
1
vote
Applying get_feature function over CSV layer in QGIS
Your expression is almost correct, you're literally just one( two) characters away from the solution: delete the last bracket and insert it before the last comma. You need a closing bracket after ...
1
vote
Applying get_feature function over CSV layer in QGIS
Try aggregate:
I have a line layer roads with the attribute Object-Nr, and a csv table colors with the same Object-Nr column and a column with color names color_name. The expression also works with ...
0
votes
Auto adjustment of table size automatically in ATLAS from QGIS
Also you can try playing around with the cel size of the table:
Attribute Table -> Item properties -> Main Properties -> Attributes...
There you can define the width of the column, alignment ...
0
votes
Missing GRASS in QGIS Processing Toolbox
So I had this problem - I had a two part solution.
a) Had to run the OSGeo4W installer again, to actually install GRASS.(It was not installed by default initially when I ran the installer)
b) Then I ...
0
votes
Converting las data into xyz with QGIS
I cannot comment yet on this platform, but I wanted to add to Marco's answer.
For me, installing the plugin in QGIS wasn't enough for me. It was not finding the "bin" folder. Turns out I ...
3
votes
Why Select Within Distance set to 1m selects every waterbody?
Use the following expression to create a unique ID for all polygons that are contiguous or have a distance of max 10 units (change that value on line 6). You could use this to create a new field with ...
0
votes
Labelling feature with count of values from another layer in QGIS
Use the following expression - see the result on the screenshot below, based on the values you posted:
with_variable('myarr',
with_variable('varcpl', "cpl",
aggregate ('tableA', '...
0
votes
Labelling feature with count of values from another layer in QGIS
get_feature( layer, field, field_value_to_match)
look it up here: https://gis.stackexchange.com/a/423479/266633
0
votes
New Features not snappable
Had a similar issue today in QGIS 3.40. In my case it was caused by the new feature triggering an update on the underlying databse, which QGIS did not get notified about. Interestingly the feature was ...
2
votes
How to find the right basemap for an informative map about historical sites?
OpenTopoMap
using QGIS 3.44 (QT6)
Using this excellent script [no plugins required] from Klas https://gis.stackexchange.com/users/55741/klas-karlsson
https://raw.githubusercontent.com/klakar/...
0
votes
3D map view in QGIS doesn't load with many 3D models
I had a similar issue. 3D Map View was working fine but I wanted to clip the dtm raster layer I was using to tidy up the 3D view.
The clipped layer was exactly the same layer format in the same CRS, ...
0
votes
Proper MBTiles export workflow to preserve display scaling factor in QGIS
I have a complex project that I export periodically to MBTiles, with scale-varying level visibility and symbology. I gave up on the MBTiles processing tool or even manually exporting from the canvas. ...
0
votes
Splitting Legend in QGIS in to 2 Columns - with Group Label Text spread across all Columns used by Subgoup Items?
Try the setting shown in this screenshot:
3
votes
QGIS 3.30 window stuck in full screen without title bar on Windows
f11, I just had to press f11, sorry.
3
votes
Accepted
Elevation Profile is empty in QGIS
You just need to select the line feature on the map canvas using the "Capture Curve From Feature" Elevation Profile's tool in order to generate the profile curve along that line, as ...
2
votes
Empty @layer_name variable in QGIS expression using the "Geometry by expression" tool
An alternative that works with the existing installation is using varibale @layers (not @layer). I creates a list (array) of a map layers in the current project.
Then loop through this array with ...
0
votes
Preventing clipped labels from QGIS Server WMS in Leaflet JS
Client-Side Alternative: Leaflet WMS Gutter Plugin
While the accepted answer correctly identifies server-side configuration as the standard solution, I've created a client-side plugin for cases where ...
6
votes
Accepted
Empty @layer_name variable in QGIS expression using the "Geometry by expression" tool
This is a bug (#54869) in the native (C++) Geometry By Expression tool as the tool is missing the input layer scope.
Instead, use the Processing parameter(name) function and pass it the 'INPUT' ...
1
vote
Aggregation of multiple values within a polygon
You can use a Virtual Layer.
All buildings with centroids overlapping a block are grouped per block, and the usage for each energy type is summed and reported in separate columns.
SELECT
a.block_id,...
4
votes
Accepted
Can I rescale many features on multiple layers at once?
For the vector data, you could use the Geometry by expression processing tool with an expression that uses the scale function to enlarge the geometries around the centroid of all aggregated geometries ...
1
vote
Getting the name of 3D map view with PyQGIS
The 3D canvas widgets themselves don’t expose their name through methods like canvas.title() or canvas.objectName(). All of those return empty values for 3D map views.
However, the parent widget does ...
0
votes
Make part of legend label italics either for layer header or items in QGIS Print Composer
I'm working on Bratislava 3.40.10 qGis and in the legend section, my items are scientific names for different species, and it worked!
< i > (non separated) Balaenoptera acutorostrata
However, ...
2
votes
ESA Sentinel-5 data in QGIS: "invalid projection"
Sentinel-5P .nc file is not a regular raster. Its coordinates are irregular arrays (swaths). Each pixel has its own coordinates.
To have your file correctly geolocated, run this command in the OSGeo4W ...
6
votes
Accepted
Calculating two highest maximum values of field in QGIS
You can use the following expression:
array_to_string(
array_slice( array_agg( "distance", "id", order_by:="distance" ), -2, -1 ),
', '
)
It creates an array ...
6
votes
Calculating two highest maximum values of field in QGIS
the following results in an array with the two maximum values for column "dist" grouped by "id"
array_slice( array_sort(array_agg( "dist","id"),false),0,1)
1
vote
Accepted
SQL syntax for joining multiple CSV in QGIS model builder
If you only have one input data source to "Execute SQL" tool, it will always be named input1. But it is possible to select multiple inputs by clicking the three dots symbol. They will then ...
4
votes
Editing label text on the map and updating attribute automatically in QGIS
I can't answer for 3.22, it's quite old now and was released in 2021.
However, as of 3.44 what you want (edit in place) is not possible. You should submit an enhancement request.
The closest you can ...
3
votes
Understanding scale in QGIS
For QGIS 3.38 and lower the scale is calculated at the bottom of the map (starting at QGIS 3.40 and up you can choose the method : Add scale method option for layout scale bar). For ArcMap it seem the ...
6
votes
Is there a QGIS plugin that creates evenly spaced points within a polygon layer?
You can create a grid consisting of points (create grid tool) with the desired spacing and then clip the grid using the polygons.
0
votes
WMS not showing in QGIS 3.34.3
The link response is:
Error occurred while processing request
Type: Status Report
Message:
Description: http.499:
ArcGIS Server
Was the URL provided to you by the data owner? If not it could be that ...
1
vote
Why does QGIS not recognize FlatGeobuf CRS?
The CRS of the layer is correctly recognized by the latest QGIS LTR 3.40.12 version on Windows 10 as EPSG:4269 NAD83
You need to verify that the installation of QGIS in your system is correct. You ...
0
votes
Producing raster data clipped automatically by multiple polygons in QGIS
Thanks to GDAL, automatic cropping/clipping of QGIS raster layers during Atlas creation is possible with just a few lines of Python Expression code.
I have uploaded an example project with some ...
0
votes
SoilGrids WCS and WMS from ISRIC platform appear not to be working. Are they, or it's me?
from soilgrids import SoilGrids
soil = SoilGrids()
# مثال للـ bounding box: لازم تحسبيه بدقة لمحافظة كفر الشيخ (lat / lon)
# القيم دي مثال تقريبي، ولازم تأكدها:
west = 30.7 # أقل خط طول (غرب)
...
2
votes
QGIS with Semi Automatic Categorization (SCP) for Mint 22
Simplest is probably to use the flatpak installation method:
flatpak install --user flathub org.qgis.qgis
See the note about plugin dependencies:
Extension support
If you need to install additional ...
0
votes
Interactively create route that snaps to route layer in QGIS
I am a bit late in this discussion.
Try this plug-in in Qgis from geoplatform / github.
Go there: https://plugins.qgis.org/plugins/gpf_isochrone_isodistance_itineraire/
It is working on every type of ...
4
votes
Understanding scale in QGIS
In order to have a map in a proper scale, you need set the CRS of the map item in the print layout to a projected coordinate reference system, like an UTM CRS, suitable for you area of interest.
1
vote
Filtering OS NGD data to only import data within a given boundary from a WFS connexion in QGIS
Try setting a Filter (right-click layer - Filter)
0
votes
Network analysis for several points in QGIS
Code below will execute Shortest path (point to layer) for each start point. Then merge all outputs into a line layer.
I suggest you try it on a subset of points, the execution time can be long.
def ...
3
votes
Vectorize multiband raster to points/polygons with multiple values
I would use the new GDAL CLI tool (first available in GDAL version 3.12) https://gdal.org/en/stable/programs/gdal_raster_as_features.html
Usage example:
gdal raster as-features --geometry-type point -...
2
votes
Vectorize multiband raster to points/polygons with multiple values
You can execute Raster pixels to points for the first band, name the output column band1 then sample raster values for each band using an expression in Refactor fields:
raster_value( layer:= @...
1
vote
Getting quantity of intersecting lines of polygons in QGIS
You can use the overlay_intersects function to create an array of the ids of the lines intersecting each polygon. Then count distinct ids. Change Path to the name of your line layer.
array_length(
...
0
votes
Accepted
Setting up QGIS plugin debugging in PyCharm
Got debug to work finally by changing the location of the debugger initialization from the __init__ method to a point after the plugin is created. In my case the plugin initialization creates a ...
5
votes
QGIS using raster in expression doesn't work with certain layer names
The string specified as the first parameter of the raster_value function and the raster layer's name string must be exactly the same: i.e. each utf-8 character contained in each string must be exactly ...
1
vote
Extracting min and max value from points shapefile in QGIS
I don't know if it's a bit late to reply, but I had the same need and couldn't figure it out. After a lot of trial and error and searching the manuals, I managed to do it like this:
select: "...
Top 50 recent answers are included
Related Tags
qgis × 42857raster × 2925
pyqgis × 2855
python × 2349
coordinate-system × 2211
qgis-plugins × 1962
polygon × 1765
shapefile × 1736
qgis-3 × 1642
postgis × 1459
print-composer × 1285
attribute-table × 1269
labeling × 1199
point × 1061
qgis-processing × 1054
vector × 1008
field-calculator × 980
line × 979
gdal × 953
grass-gis × 950
symbology × 931
layers × 904
fields-attributes × 860
qgis-2 × 846
expression × 815