If you want them for display purposes only, go to Settings --> Options --> General and check the box "Show group (thousands) separator":
You need to restart QGIS before changes will have effect.
For labelling purposes I suggest to use the expression format_number() directly in the label with or value field (name depends on the QGIS version) ...
If you use pure white over your shapefill then you can use "Multiply" to blend the layers which makes the white parts transparent. Adjusting widths gets me this:
Here's the style properties for the two layers - the Simple Fill is just a thick dotted white line, and the shapefill is a gradient infill:
Important thing is that "Multiply" ...
What you are telling the program to do is to draw gridlines every 5 units. The units for the grid projection you are using (Pseudomercator) are meters. So you are asking for a gridline every five meters. At the scale you are mapping a five meter inverval is extremely close, so all lines are bunched together. The grid on the map you are trying to replicate is ...
You assume that there is a feature for ids 0 and 1, but table.getFeature(0 or 1).attributes() tells us that it is not true.
The following code prints existing feature ids.
ids = [f.id() for f in table.getFeatures()] # list comprehension
# OUT: [2, 3, 4, 5]
Then, continue using ids to be sure you use an existing ids.
for i in ids:
You can use QGIS expression with overlay functions: they work even with invalid geometries. To attach to each point the $id of the polygon, use this expression (poly is the name of the polygon layer):
Two polygons with intentionally invalid geometries. Points are correctly assigned to the polygons they are within,...
You have to use like this:
QgsVectorFileWriter.writeAsVectorFormatV2(#layer#, #file_path#, #transform_context#, #options#)
transform_context = QgsCoordinateTransformContext()
options = QgsVectorFileWriter.SaveVectorOptions()
options.driverName = "ESRI Shapefile"
Adding as file is not a problem in QGIS 3.22.2. Obviously there is a problem in QGIS 3.16.14.
I found a solution which doesn't add from file, but folder, in v3.16.
Copy all CSVs to a folder.
Select "Directory" in "Data Source Manage | Vector" window.
Create an attribute that counts the no. of nearby points, than scale these values exponentially to reduce the range between min/max values so that you can set gradient stops properly. Be aware of the colors you use and reflet if the heatmap you create can be understood and interpreted in an appropriate way (details below).
How you can solve the ...
The trick is to use Geometry generator to create a geometry where label placement is allowed. You are free to define the geometry in a way to fit your needs. Adapt it as you want:
Go to label settings, placement tab and activate Geometry generator.
Use QGIS expressions to define an area (polygon) where placement is allowed: a buffer around the lake, but ...
A point has no 2D area or "range" so if there is a distance between it and another geometry, they are disjunct. A point has to lie exactly on the line for any of the geometry predicates you mention to evaluate to True.
As you mention in your comment, there is a distance of >0 between your point and the line so they do not intersect.
The image ...
You can create a temporary layer based on your Postgis layer.
You can either filter features of the layer wich intersect the canvas extent, or filter the features wich are completly within the canvas extent.
On the example below, I have a layer (red), a canvas extent (red line) zoomed on the green feature, features intersecting the extent (pink features) and ...
This might not be what you need, but do you know of
PostgreSQL execute and load SQL?
This algorithm performs a SQL database query on a PostGIS database
connected to QGIS and loads the query results as a new layer.
e = iface.mapCanvas().extent()
xmin = e.xMinimum()
xmax = e.xMaximum()
ymin = e.yMinimum()
ymax = e.yMaximum()
sqlquery = 'select * from public....
Use this expression for the Value field of the label dialog, where cars is the name of the attribute field:
Returns the configured representation value for a field value. It
depends on the configured widget type. Often, this is useful for
‘Value Map’ widgets.
A bit of theory
The NTv2 (National Transformation version 2) shift intended to facilitate the transformation between datums. It can be achieved by means of a grid file (encapsulates the shift values that are stored in a regular arrangement of geographic coordinates) which comes in two formats:
.gsa : a readable (ASCII) format (GSA)
.gsb : a binary format (...
The default settings can be edited and saved permanently through menu option
Settings-Options-GDAL-Raster driver options-GTiff
Preset options can be changed also when an image is saved with Save as... but those changes are not permanent.
I concur that there seems to be an issue with disconnecting the save() and resetValues() slots from the accepted and rejected signals of the QDialogButtonBox of QgsAttributeForm. Indeed, perusing the docs, I saw that the QgsAttributeForm class has a method disconnectButtonBox() which should take care of this nicely. Inspecting the c++ source code you can see ...
This is a projection issue: your wedge buffers are not symmetric. You very likely have:
The layer in a geographic CRS like WGS84, EPSG:4326 - that's why you have to divide the distance as units are in degrees
The project set to another (projected?) CRS like WebMercator, EPSG:3857. If so: EPSG:3857 ist not ideal for many tasks, so think about which CRS to ...
This is a known bug in 3.22, see https://github.com/qgis/QGIS/issues/45470 and https://github.com/qgis/QGIS/issues/44061, that is caused by PROJ.
One workaround could be to build the project from beginning in 3.22.
Or wait for the next Version (hopefully 3.22.4) since it looks like the bug is found and fixed.
If you are familiar with pytest, you could try using pytest-qgis plugin to write unit tests for QGIS. You don't need any of the boilerplate of starting the QGIS since it does it automatically.
Here is a sample test that checks that a layer has been added to the project:
project = QgsProject.instance()
I'm not sure to have well understood what you are trying to do here but I guess you shall have a look at the "join attributes by location" tool or the intersection tool:
-input layer: polylines
-intersect layer: Africa shapefile
Once you will have run the tool you will get a new polyline layer where every polyline features will be duplicated based ...
An alternation using processing tools and expressions (I know it's OT, but it might be useful)
Aggregate algorithm, set as below:
field to group
expression to use
The first communication with WMS server is done with GetCapabilities. The URL is for example
GetCapabilities includes OnlineResources for other WMS requests. In this example the OnlineResource for GetMap is
The script DistantBear.py does have a syntax error. As it is in your processing directory which is tied a profile, you receive an error when starting QGIS with this profile (default).
Fix the sytnax error in script DistantBear.py
Delete script DistantBear.py if unused
@Sangster answered to his own question:
The following has recovered the project so has been noted to
help others, but it does not identify or repair the original problem
so I am not marking it as the answer. Note that simply duplicating the
affected layer resulted in duplicating the problem too.
To recover from this problem:
Right click the affected layer ...