New answers tagged qgis
0
votes
Dynamic stats in the decoration title lable, by time stamp, in QGIS
Your issue is that the filter of your aggregate function is not a filter, but only an attribute. You need to add a comparison to actually make it a filter. Something like:
aggregate('Lake','mean',&...
2
votes
Accepted
QGIS converting text field with special characters to numeric (real) field
regexp_substr( "stringfield", '(-?\\d+\\.?\\d*)')
https://www.tutorialspoint.com/How-to-extract-numbers-from-a-string-in-Python
1
vote
Polygonize/Vectorize large raster
I would point out the a 47000 x 37000 pixel raster contains 1.7 billion pixels. If your binary raster is mostly "salt and pepper" (1's and 0's not clustered into contiguous areas) then you ...
0
votes
Separate canopy from ground - based on DEM generated from thermal imaging
Producing a canopy height model (CHM) is a well established procedure, so I don't think you will need to "re-invent the wheel" in python or Matlab.
See, for example:
from the pyfor package
...
0
votes
Exporting raster of a map to QGIS from GGplot in R
Your question reminds me of a quote from a smart fellow: "You're trying to get back the fish after making fish soup".
You should be saving to a "*.tif" raster file the density that ...
1
vote
Is there an Offset function in QGIS for Polygons?
If you just want your polygon shape to render offsetted, you could define the symbol with a Geometry Generator with the code :
offset_curve(
line_merge( exterior_ring( force_polygon_ccw( $...
0
votes
Attribute form constraint, using NULL
It does not work the way we imagined. We falsly assumed that the return-value from the expression nullif("interior_observed", false) would be assigned to the field content. My guess now is ...
5
votes
Accepted
Making new field with formatted values in QGIS
Try this expression:
substr("Kiinteistötunnus",0,3)
||'-'||
substr("Kiinteistötunnus",4,3)
||'-'||
substr("Kiinteistötunnus",7,4)
||'-'||
substr("Kiinteistötunnus&...
4
votes
Accepted
QGIS doesn't like the number 6?
I think the offset of 0.1 millimeters that you are using at the moment might be too small, I tried with a random set of polygons using "Outside Polygons" as a Mode and 0.1 millimeters as the ...
1
vote
Adding a fixed table to layout in QGIS
Late to the party but an answer
composerTitle = 'Layout 1'
project = QgsProject.instance()
projectLayoutManager = project.layoutManager()
# Access to the layout by name
layout = projectLayoutManager....
0
votes
Export PNG in QGIS, same extent but outputs are not exactly the same
Try using a Print Layout. When you can create a map in a layout, you can specify it's dimensions by accessing it's properties (1). Pan the map location as desired, export as image (2), select PNG as ...
2
votes
QGIS - copy/paste symbology labels
Your symbology can be loaded by clicking on the three dots next to Delete All button(On the Layer Properties window, Symbology section) option -Load Color Map from File...-. The file must have ...
1
vote
Accepted
When moving layer labels the labels connect
You need to choose a unique key. The window for this pops up the first time you move a label:
You cannot use an expression here. So in case you do not have one, you need to add it to the layer first. ...
1
vote
How to draw a scale or a graduated marker on QGIS?
One way to do it would be to trace a line perpendicular to your polygons then use the "Points along geometry" tool to place regularly spaced points on it. This way your points will be ...
2
votes
Accepted
Exporting layer with datetime field with milliseconds value
If you register a custom formatter as described in my answer on your related question (Displaying milliseconds in Attribute Table using PyQGIS),
the formatter can be applied to modify the exported ...
0
votes
Displaying only points within polygon I created in QGIS
Use symbolgy and assign the function 'geometry' as below:
pole_of_inaccissibilty($geometry,1)
or
use the plugin Point sample tools.
1
vote
How to set default attribute values on a new line based on overlay_touches/nearest for start_point and end_point
With your first expression, if you are getting NULL in the preview when setting up the default expression, this is normal if you have no features in your layer (or if all of the existing features ...
1
vote
Clip Line Layer to Polygon but retain the Lines outside the polygons
If your aim is to only keep the lines that do not intersects the polygons you could use the "extract by location" tool.
Layer to select from : your line layer
Additional layer : your polygon ...
4
votes
Accepted
I don't see menu in QGIS Print Layout for enabling atlas, or browsing through atlas pages
That's probably because you've created a new Report (Project > New Report) and not a new Print Layout (Project > New Print Layout)
As far as I know atlases are not available in Reports.
2
votes
Accepted
QGIS - Group by expression in attributes form completion
Try using this expression (QGIS 3.22) in the 'Filter expression' part of your Value Relation widget -
$id=array_first(array_agg($id,"culture"))
It groups the feature id value from the other ...
0
votes
Is it possible to overline labels / text / strings in QGIS 3.x?
Can you share how you've configured your rule-based labels to appear in those exact positions relative to each other? (did you use specific offsets?) Since you want these to be separate labels with ...
0
votes
Clip features of lines based on parameter from another shapefile (Polygon)
You can do this using pyQGIS:
canvas = iface.mapCanvas() # first, define the map canvas by referencing iface
layers = canvas.layers() # gather all layers into a list
for lyr in layers: # loop through ...
0
votes
Merge a .gpx with a DEM
Run Menu Raster > Conversion > Rasterize the line. Set the value for A fixed value to burn to 10 and define Output raster size units (either pixels or layer units) and set the resolution you ...
1
vote
Changing editing capabilities on MapInfo *.tab file using QGIS?
FYI...It seems that you can edit MapInfo .tab files as long they are not using .dbf to store the data. Doesn't look like it can edit those...I tested and I can edit with a .dat file, but not a .dbf ...
2
votes
Accepted
How can I activate GeoTIFF compression in QGIS 3.x gdal_translate?
Try 'OPTIONS':'COMPRESS=JPEG|JPEG_QUALITY=60'
I executed the tool manually in QGIS, pressed Ctrl+Alt+H to see the command syntax:
7
votes
Accepted
QGIS - Connection Lines using geometry generator between 2 layers in a relation N-1
You can do this using array_foreach() function
collect_geometries(array_foreach(string_to_array( "ID_UC" ),
Use this expression on the 'concpoints' layer.
collect_geometries(array_foreach(...
1
vote
How do I change my view to nadir in QGIS?
I had the wrong CRS.
After searching through, and trying several of the WMS services with NADIR imagery mentioned by Vince without significant changes, I tried making a new project altogether and ...
0
votes
Problems with uploading point coordinate British National Grid data into QGIS as .csv file
The "NT 9791" format would be a 1km x 1km square. You can download shapefiles here: https://github.com/charlesroper/OSGB_Grids/find/master
As for the 6-digit number, I don't know.
6
votes
What is meant by 'current feature' when using the field calculator or expression builder in QGIS?
The current feature is the one you're doing the calculation for. If you e.g. selected a single feature on the layer and choose to only updated selected features, the area is only calculated for that ...
4
votes
Accepted
Use point symbology tools in geometry generator of a polygon
You can use the Diagrams tab for this. Go to Layer Pproperties > Diagrams, then:
Choose a Pie Chart
Add your value field to the attributes list
Within Size menu choose "Scaled Size" with ...
1
vote
Clipping large shapefile using QGIS
In QGIS try:
1 Fix geometries, save the output as geopackage. 2. Create spatial index. 3. Clip
If it still doesnt work. 3. Multipart to Singlepart the output. 4. Create spatial index, 5. Clip
1
vote
QGIS: update query in db-manager fails
Ok, new day, fresh brain, solution is easy: the error message reveals that I had attempted to change the database from the wrong angle: I had been trying to change table content while being connected ...
1
vote
"One or more line ignored due to geometry not having a minimum of three vertices" error when "Line to Polygon" in QGIS
I could get the same error "One or more line ignored due to geometry not having a minimum of three vertices" when I was trying to apply the "Lines to polygons" geoalgorithm for ...
2
votes
QGIS difference operation extremely slow
Have you tried setting a spatial index? For some algorithms in QGIS this makes a large difference in the time to completion.
0
votes
Getting base Line of PostGIS skeleton
A simple approach to "trim the branches" could be by longitude but is not a complete solution.
with lines as (
SELECT
st_subdivide(
st_straightskeleton( ST_GeomFromText('POLYGON (( 190 190, ...
1
vote
Accepted
Clip features of lines based on parameter from another shapefile (Polygon)
Try this way:
Calculate a field for the overlay layer that contains the id (i will call it id, you can use this expression $id to get the id).
Intersect your base layer with the 25.1.19.4. ...
0
votes
Split TIFF and shapefile into smaller parts
This is my first project with geo data and for some reason I thought if I split the tif I must do the shape at the same time, so there should be a command to do just that.
My solution:
Created a grid ...
1
vote
Creating Network Flow Diagram using QGIS
In my opinion, you should start with the telecom project you are working on. Next, for sure you will find the layers you need to include in your network flow schematic. You can follow the steps:
...
2
votes
Is it possible to style the QGIS Message Bar using QSS?
Meanwhile, in QGIS 3.22 it works.
I got it with that code:
QFrame QFrame {
min-height: 70px;
margin:0px;
padding:0px;
}
QLineEdit {
border: 1px solid gray;
border-radius: 1px;
padding: 0 8px;
...
1
vote
Accepted
Load raster from Requester-Pays S3 bucket into QGIS
I was able to achieve this by setting the Gdal environment variable AWS_REQUEST_PAYER=requester in the same place as the others above.
1
vote
Is it possible to create Rule-Based Styling with $geometry intersecting a second layer?
Yes, it is possible. In the 'rule based' symbology, choose the rule to be:
intersects($geometry, geometry(get_feature('layer name', 'attribute field name', 'value')))
Let's say you want your layer to ...
4
votes
QGIS Apply Correction to Elevation Datum
Use this expression in the raster calculator: "name_of_your_dtm@1" + 2
But as Erik suggested it you shall have a look at the official tutorial where most of the solutions are already ...
0
votes
Accepted
PyQGIS script (.py) runs correctly on Windows but not on Mac
I found a solution, even if it doesn't solve all my doubts.
The mac computer does not seem to recognise the relative path given, in any of the tried formulations (".\", ".", "....
11
votes
Accepted
Update DEM based on line feature in QGIS
You can use r.carve within QGIS and set up a negative stream depth to increase the height of your DEM along your line feature
(In the image below a positive stream depth have been applied to the DTM)
1
vote
ArcGIS Online Interactive Legend filter features
To symbolize a feature based upon two TEXT fields create the symbology in ArcPro then share the layer to AGOL.
Setting layer to unique values using two fields
Results are:
6
votes
Accepted
Deleting the same column(s) from different shapefiles in QGIS
A PyQGIS solution. Tested on QGIS 3.24.1-Tisler.
Proceed with Plugins > Python Console > Show Editor and paste one of the scripts below.
The press Run script and get the output.
This approach ...
3
votes
I don't see menu in QGIS Print Layout for enabling atlas, or browsing through atlas pages
In your Print Layout, go to 'View', then 'Toolbars' and check 'Atlas Toolbar'
This is avaible for me in 3.10.2 so it should be in 3.10.4 aswell
1
vote
Artificially extend a DEM to clip it
I found a way to do it on Python: (PS: I USED A DIFFERENT DEM FOR THE EXAMPLE, TO DEMONSTRATE HOW TO DEAL WITH BORDERS)
# Open the DEM and extract all the info about it
src = rio.open('IfSAR_merged....
0
votes
Accepted
Reprojecting from EPSG:3857 to EPSG:28992
I managed to solve the problem by converting from EPSG:4326 instead of from EPSG:3857.
My understanding is that EPSG:4326 is a "flattened/map" version of EPSG:3857, so they are equivalent.
0
votes
QField - Can't locate project folder
The file is stored in a location only visible from a PC using a cable connection.
Connect to your phone (I assume it is android) by cable and look here: Android\data\ch.opengis.qfield\files'
It might ...
Top 50 recent answers are included
Related Tags
qgis × 35863pyqgis × 2719
raster × 2468
python × 2284
coordinate-system × 1862
qgis-plugins × 1746
shapefile × 1503
polygon × 1387
qgis-3 × 1387
postgis × 1307
print-composer × 1073
attribute-table × 963
labeling × 960
qgis-processing × 901
grass × 898
vector × 867
qgis-2 × 842
gdal × 836
point × 801
field-calculator × 754
line × 745
symbology × 698
layers × 650
fields-attributes × 611
style × 600