To build on @kartoza-geek's answer, you can use all kinds of variables and values to determine the image filepath. Use their answer if you are relying on another layer to get the filename.
If your image filename is based on the project filename, you can use the project filename as a variable and extract the image name from it using regexp.
So in your ...
In QGIS 3.4 (and probably before that), you can use the ‘Vertex’ tool (which is next to ‘Add line’ on the toolbar, by default). Choose it, then hover the mouse over the ending or starting point of a line, and you'll see a plus symbol next to it—this allows you to continue the line. Similarly, it allows you to add a new point between other two by hovering the ...
You can add the following scripts as Processing script to Processing Toolbox. Then they can be used in a graphical model. The scripts don't include another Processing tool. Therefore, you can use them in different QGIS 3.x versions without concern. I've tested it in 3.4, 3.8, 3.10, 3.11, 3.12. (Please, also read the comments under processAlgorithm method)
Simply add the layer and the CSV (Excel) file to the project (drag'n'drop), then right click on the vector layer: Properties / Joins / Add new join (+ icon),
and there you have to refer to the common attribute field.
If you want to 'save' the connection, then you can create a new a field in the Field calculator and in the Expression panel just refer to the ...
I ended up creating a wkt field in the shapefile using the geom_to_wkt( $geometry ) command, and joined this column to the CSV with attribute data. I then re-imported the CSV using the well-known-text field to generate geometry attributes, and was able to pretty easily export this CSV to a geoJSON.
Looking at existing answer from Using Time Manager with joined layers?, it redirects you to a Github issue related to your question. In this issue, the solution is about using virtual layers (as stated at https://github.com/anitagraser/TimeManager/issues/148#issuecomment-463218771)
The link to a tutorial to use virtual layers (from the issue) you need to ...
You can use pyqgis to automate such things.
Look at https://kartoza.com/en/blog/how-to-create-a-qgis-pdf-report-with-a-few-lines-of-python/ which was done using QGIS 2 series. You can easily adapt this to the Pyqgis 3 syntax.
For a gentle introduction to Pyqgis read https://anitagraser.com/pyqgis-101-introduction-to-qgis-python-programming-for-non-...
You are trying to add an image to the map but the map item (picture) has no relationship with the layer items. So what you need to do is the following.
Add an image to the map.
In data defined settings select Edit
Enter the following formulae aggregate(layer:='New_scratch_layer_34fb05c7_8585_4ab4_ac73_d29eb398f3c2',aggregate:='concatenate', expression:="...
You can use the Processing Tool > Layer tools > Extract layer extent that will create a polygon that covers the complete extension of your DEM (Extent in the image).
Then, using the Processing Tool > Vector overlay > Intersection, you can create a new layer that contains only the points that are inside your raster (Intersection in the image).
This is an ...
One solution is to change the snapping status for the fishnet layer.
Both ArcGIS and QGIS support the enabling/disabling of snapping for individual layers.
For ArcGIS, if you select "list by snapping" under the contents pane you can tick snapping on/off for each layer.
For QGIS, select Edit Advanced Configuration tool under the snapping toolbar to ...
Open your symbology menu and click on your cluster symbol:
Now click on 'Font Marker' and scroll down to 'Character(s)':
Edit the data defined override and insert this expression, if your points perfectly overlap (if they dont see below):
Change "value" to the name of ...
You can achieve this task using arrays.
1) Create an array with the search themes AND the placeholders
2) for each value of the array, find if the name column contains it or not, using ilike
3) as the output of step 2 is an array of true/false values, check if this output contains at least 1 true result
I faced the same problem, I used this code but it isn't work.
My code is:
select l1.id as id1, l2.id as id2,
st_intersection(l1.geometry, l2.geometry) as geometry
from line l1, line l2
(st_overlaps(l1.geometry, l2.geometry) or
st_contains(l1.geometry, l2.geometry) or
and l1.id < l2....
Depending of your requirements, you may want to use a QgsLayoutItemLabel or a QgsLayoutItemHtml. To illustrate, we use QgsLayoutItemLabel. For QgsLayoutItemHtml, you may look at this existing question and its answers
from qgis.core import QgsLayoutItemLabel, QgsLayoutPoint, QgsLayoutSize
from qgis.PyQt.QtCore import Qt
project = QgsProject.instance()
Snapping to sketch' geometry is now available in development version and soon in 3.14, thanks to this PR. Here's how to do it:
Create a permanent vector layer.
Add polygon feature
Snapping toolbar > Self-Snapping
Joining fields from two different tables is possible when one field is common in both. They act as Join and Target fields.
So, whenever you are joining fields from two attribute tables, make sure that:
The data type of the "Join field" and "Target field" is same.
Both the join and target field has same dimension.
The data in both the join and target fields ...
Consider adding the CSV to your project then going to the KML layer> layer properties>joins, to join column X from the CSV to the KML (based on a shared unique ID).
Then go to the KML's styling options, and next to the relevant symbol's colour setting, look for the data defined button > Field. X should be available as an option so select that and the ...
Although in the layout, I suggested changing legend block position or reduce the map canvas to avoid overlay, a recipe to make some changes to your fonts in the legend
project = QgsProject.instance()
manager = project.layoutManager()
layout = manager.layoutByName('demo')
# I start from an existing QgsLayoutItemLegend named "legend1"
# here. You may create ...
David it took some time, but I managed to get the correct data for you using the TIN Interpolation Tool. However, there is a catch. During my research I came across this article from September 2019 on Github where somebody had the same problem having e+ values using QGIS 3.8.3.
In this article the statement was ...
This can be done by data-defining the image paths, and is documented in the Creating a Report section in the QGIS User Manual:
If field X has the value you would like to use for your "heatmap", you can do the following:
Open the layer properties and go to the "Symbology" tab
Select Graduated in the pull-down menu at the top
Set the Value to X
Choose the desired number of classes in Classes and press the Classify button.
Click on the Apply or OK button to see the result.
Getis-Ord G measures high/low clustering - so are there any high/low values that are close together.
Moran's I checks to see if there is spatial dependence between values. So basically it measures if there is linear correlation between values and its neighbours.
What is the purpose of checking for spatial correlation? What are you trying to identify? You ...
Having a vector layer with a polygon, you can use it to visually mask other layers. Open the layer styling panel (F7)
Click the symbol render option.
Select the inverted polygons option. Then choose the make color. In this case I choose white and no stroke.
For fun, I've tested a method with pure QGIS Expressions.
Disclaimer: I didn't test it on very large datasets.
For start, you can see the solution as a point 'geometry generator' (you can use 'geometry by expression' from toolbox to make it actual geometry) symbol layer in the stops point layer. Here the code:
The easiest way to solve your issue is to use an expression that creates the shortest line between the two points.
Here an example of the expression used in the Geometry generator that works perfectly using the algorithm Processing Tools>Vector geometry > Geometry by expression on the Graphical Modeler.
Using the following expression
I'm uncertain if I understand what is going on entirely but maybe this helps. You can set a projection if you know it to be the correct one through Python:
fn = '/path/to/my/infile.tif'
#define a projection
spatref = osr.SpatialReference()
crs_wkt = spatref.ExportToWkt()
# open in edit mode, omit the 1 ...
On the one hand, QgsMapCanvas is a class. You can always create new canvas objects from it (as you did already in your second attempt).
On the other hand, iface.mapCanvas() is an instance, an object of the class QgsMapCanvas. iface.mapCanvas() is initialized when you load QGIS app with GUI (Python should be enabled to use it), and refers to the main canvas ...
Thanks for everyone who read this question and decided it was probably a corrupt file; most likely to be the case.
I found a work around, which takes longer, with additional processes. The layer was thematically split into the 4 levels of data, saving each as a new layer and then each layer known to be faulty passed through the 'fix geometry' process found ...
I dont know why your SVG is not displayed as it should in QGIS but below is an SVG similar to yours that work well in QGIS
<svg height="100" viewBox="0 0 100 100" width="100" xmlns="http://www.w3.org/2000/svg">
<path d="m50 92.550484v-85.1009644" fill="none" stroke="#000000" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" ...
The "Height" property in Layer Properties > 3D View is used to place the bottom of the 3d object. You should be able to specify an attribute which indicates the starting height for each feature. If you do not have this then you can calculate it from the terrain layer you are using.
I had the same problem. The inconvenient is that QGIS seems that is not able to understand correctly the projection information stored on the .jp2 image files.
I recommend you to follow these steps:
(This worked on QGIS 3.10 A Coruña)
Open an empty QGIS project file.
Create a new projection by going to "preferences" -> "personalize projection".
Go to ...
You can make a column invisible by editing its widgets in Layer Properties > Attributes Form
More info: https://docs.qgis.org/testing/en/docs/user_manual/working_with_vector/vector_properties.html#edit-widgets
I try to use the first link and it works like this:
The second link is necessary to add ? between wmts and SERVICE
Finally the last link does not have a wms service, but I found a few on the ...
After you try and open QGIS and get the error, you need to open MacOS "System Preferences" and select "Security and privacy". You should now see an option there to run the program below the "Allow apps download from:" section.
This post has been relevant but nowadays there is a native function for this intent included in the expression calculator.
Now, you can simply run to_dms(5.1234, 'x', 2). A capture of the current doc can be seen below
I made some changes to the code to get the coordinates in DMS, if necessary.
Only adjustments to the EPSG information are needed.
(CASE WHEN $y < 0 THEN '-' ELSE '' END) || floor (abs(Y( transform( $geometry, 'EPSG:31983', 'EPSG:4326'))
)) || '°' || floor(((abs(Y( transform( $geometry, 'EPSG:31983', 'EPSG:4326'))
)) - floor (abs(Y( transform( $...
The QGIS Resource Sharing plugin (http://qgis-contribution.github.io/QGIS-ResourceSharing) was made for this purpose (sharing resources, among them processing scripts, processing models, symbols, layer styles, SVGs, R scripts, expressions, ...).
You can place your Collection on github or elsewhere on the Web and share it, as long as you follow the required ...
In general, a CSV file consists of points. Your example file contains X, Y and Z co-ordinates, and the X and Y co-ordinates look to be in metres [probably]. The key attribute you need to import a csv file into a GIS [I use QGIS] is that there must be an 'X' and a 'Y' column. These could be Universal Transverse Mercator co-ordinates or Ordnance Survey Grid co-...