christoph
  • Member for 7 years
  • Last seen this week
Merging all tiles from one directory using GDAL
30 votes

You could create a virtual mosaic from all Tiff files: gdalbuildvrt mosaic.vrt c:\data\....\*.tif and convert it afterwards: gdal_translate -of GTiff -co "COMPRESS=JPEG" -co "PHOTOMETRIC=YCBCR" -co ...

View answer
QGIS Labels with HTML formating
Accepted answer
15 votes

As others have already mentioned, HTML formatting for labels is currently limited to colors. But with a very nice undocumented feature we can build dynamic labels, using label backgrounds with inline ...

View answer
Drawing wavy/wiggly lines in QGIS
12 votes

Attention! This answer is outdated. Please follow the link here: Custom QGIS linestyle expression function won't work with MultiLineStrings In QGIS 3.10 it's possible to dynamically create zig-...

View answer
Using embedded SVG symbol in multiple layers
10 votes

Found the answer to my problem: We can store the base64 encoded SVG string in a project variable and link to this variable (i.e. 'mySymbol'). base64:...

View answer
Does QGIS support HTML5 and CSS3?
Accepted answer
9 votes

It depends on your QGIS version and the Qt toolkit version it's based on. First look into Help > About to retrieve the Qt version. If you are referring to a print layout, QGIS uses QWebView (HTML ...

View answer
Extracting number from address string using QGIS
Accepted answer
8 votes

You have to add regex word boundaries (\b) to extract your numbers: regexp_substr("address", '\\b\\d+\\b')

View answer
Use text diagram for labeling in QGIS
Accepted answer
8 votes

I was really interested by myself, if it's possible to use dynamic SVG creation to build these label circles and came up with this solution: Simply add a Geometry Generator with a SVG Marker to your ...

View answer
Interrupting contour lines beneath elevation labels (instead of using label buffers) using QGIS?
7 votes

During my research to achieve a mostly dynamic labeling of contour lines in QGIS 3.10, I put everything together in a small cooking recipe and changed my original answer to share the findings with the ...

View answer
Read (and write) SVG from Geopackage with QGIS
6 votes

I was very interested by myself, to find out how we can package a QGIS project with all external dependencies inside a GeoPackage database. With the help of the "indispensible" expression ...

View answer
Custom QGIS linestyle expression function won't work with MultiLineStrings
Accepted answer
6 votes

After a lot of changes in my terrible inefficient code, it's now working with all geometry types. I could add some caching to make it a little bit faster, but for the moment it's ok. import itertools, ...

View answer
Changing Raster Layer Resampling with PyQGIS?
Accepted answer
6 votes

Ok, looking deeper into the API helped: rasterLayer = iface.activeLayer() resampleFilter = rasterLayer.resampleFilter() resampleFilter.setZoomedInResampler(QgsCubicRasterResampler()) resampleFilter....

View answer
Create (autogenerate) report in QGIS, with a map for each type of feature
Accepted answer
5 votes

You could use a virtual layer (i.e. vtrees) to group your species into multipoint geometries. SELECT species, CastToMultiPoint(Gunion(geometry)) as geom FROM trees GROUP BY species Style your layer ...

View answer
Visualising WKT geometry string in QGIS
5 votes

In QGIS 3.18.3 (Windows) we can copy one or multiple WKT strings into clipboard and past them using Edit > Paste Feature As > Temporary Scratch Layer... into map canvas. CRS needs to be adjusted ...

View answer
Inconsistent display of HTML table font size in QGIS layouts
Accepted answer
5 votes

If you use CSS size definitions in QGIS, it‘s best to use em relative units instead of pt or px. pt/px units are changing with the dpi settings of the Layout.

View answer
Clipping/extracting raster from loaded XYZ Tiles basemaps (e.g. Google Satellite)
4 votes

You could use GDAL (i.e. gdal_translate) to crop your WMS/XYZ/WMTS rasters. As an example load the OpenStreetMap TMS Example into QGIS (drag & drop XML file into map canvas). Use gdal_translate to ...

View answer
Building exaggerated elevation profiles from VRT DEM in QGIS
Accepted answer
4 votes

Looking beyond QGIS I found the answer directly in GDAL VRT, and it's so simple. I only need to add <Scale>10.0</Scale> to the VRTRasterBand: <VRTDataset rasterXSize="412502" ...

View answer
Elevation Profile with labels on waypoints (QGIS, Python)
Accepted answer
4 votes

You could combine QGIS with HTML/Javascript (Highcharts or any other framework) to produce appealing elevation profiles. With the help of some Python expression functions, it's possible to use the ...

View answer
Importing massive amounts of raster files
4 votes

Only a small addendum to the given answer: It's always wise to translate raster data into compressed TIF format (GeoTiff Compression for Dummies - Paul Ramsey). In your case, I don't know your data (...

View answer
How to lock a WMS layer to scale in QGIS?
4 votes

I struggled around with the same problem: always getting unreadable text when printing WMS layers to poster format in QGIS. Even though the reduction of the layout resolution (i.e. 150DPI) helps ...

View answer
Styling line pattern fills with geometry generator
3 votes

Since QGIS 3.18 we have dynamic SVG parameters which we can use to draw wavy line pattern fills. The idea is to create dynamic SVG Bézier curves as the basis for our fills. (https://www.sitepoint.com/...

View answer
Adding HTML Table in Print Composer
3 votes

In QGIS 3.x you could use a combination of HTML/CSS and the expression function aggregate to imitate a QGIS attribute table, that has a bottom position and only shows features of 'mylayer' which are ...

View answer
Polygon to Lines in Virtual Layer
3 votes

You will get best results if you install Grass GIS together with QGIS and use the processing tool v.to.lines.

View answer
Using embedded SVG symbol in multiple layers
Accepted answer
3 votes

While playing around with Data URIs, I managed to store SVG images inline without base64 encoding. Only have to put 'data:image/svg+xml;utf8,' in front. Depending on the SVG content, the inline SVG ...

View answer
Changing data in QGIS using a CSV
3 votes

With the GDAL/OGR Virtual Format you have another option to import your Excel table into QGIS. Create the VRT file (see below) in the same directory as your Excel and set the filename, tablename and ...

View answer
Is it possible to add an atlas variable to the SQL query when creating a virtual layer?
3 votes

You cannot use Expression variables in your virtual Layers directly. Use the Expression function var() instead (i.e. SELECT var('project_crs')). Unfortunately this won't help in your case, because ...

View answer
QGIS Atlas pages with different raster base layers?
Accepted answer
3 votes

Found the answer by myself. It is possible by using python expression functions inside a composer label. All we have to do is: enable/disable the raster layer one page before it should be visible/...

View answer
Set grid position behind map in print layout QGIS
2 votes

Duplication and synchronisation of the map is definitely the key to solve this issue, as @BenW already suggested. The map underneath should contain the grid afterwards. But there's one question ...

View answer
Making symbology non path dependent in exported layer using QGIS
2 votes

If you are going to share QGIS projects with others, I would recommend to store the projects in GeoPackage files (Project > Save To > Geopackage...). Then save all your SVGs inside the same ...

View answer
Georeferencing PNG image in QGIS when the coordinates of image corners are known
2 votes

You can use gdal_translate (https://gdal.org/programs/gdal_translate.html) with parameter -a_ullr to georeference your image. In the example below I'm georeferencing a PDF file: gdal_translate --...

View answer
Convert vertices of polygon features to points using Virtual Layer in QGIS
2 votes

Since I was not able to suxessfully run the given SQL scripts in QGIS 3.22.0, I came up with another solution using regexp_replace and a common table expression to split the WKT polygon representation ...

View answer