Skip to main content

New answers tagged

0 votes

Raster resampling using PyQGIS

It seems like the raster resamplers only modify the settings, but the resampling is not applied on the canvas until you also configure the resampling method. After spending lots of time with the same ...
Vangelis Tasoulas's user avatar
1 vote

What is combine function in QGIS?

it is called r.cross (https://grass.osgeo.org/grass-stable/manuals/r.cross.html) finally found it too
gggeogael's user avatar
0 votes

Is there a tool in QGIS similar to ArcGIS Combine?

I was facing the same problem and today i found r.cross (https://grass.osgeo.org/grass-stable/manuals/r.cross.html), since i didn't find anything in the internet talking about it i am comenting here
gggeogael's user avatar
1 vote
Accepted

Exporting georeferenced image from WMS in QGIS

Yes, your option is correct. Second is to make layout and what you need Legend and North sign for example and export it with worldfile. Third option is to use processing rasterize chose range and ...
Łukasz Świątek's user avatar
4 votes

How to create a raster layer of distance to a vector layer's features (e.g. rivers, roads, lakes) in QGIS?

Rasterize your line layer. A fixed value to burn=1 Proximity (raster distance), target_pixels = 1, distance_units=Georeferenced coordinates
Bera's user avatar
  • 77.6k
0 votes

Creating rasters with exactly 1km x 1km resolution in QGIS?

Can you use Create constant raster following the picture, I think it'll work, my QGIS version is 3.20.3:
孟泽楷's user avatar
3 votes

Converting ESRI FileGDB raster to vector without losing precision in QGIS

Make sure QGIS is using GDAL >= 3.7 (when filegdb raster support was introduced). Don't use the GDAL > Polygonize tool, use the Vector creation > Raster pixels to polygons tool which handles ...
user2856's user avatar
  • 69.5k
1 vote
Accepted

Calculate percentage of overlap between a polygon and raster in Python

I hope I understood your problem correctly. I created this sample raster and polygons overlapping it: This function uses shapely, rasterio, geopandas, and numpy just like your approach: import ...
juto96's user avatar
  • 1,068
0 votes

Setting transparency for range of colors in raster layers in QGIS

In the new version of QGIS 3.40 (released in Oct. 2024), this feature was implemented: Support tolerances for QgsRasterTransparency pixel values. Select a pixel that should be transparent, than ...
Babel's user avatar
  • 74.9k
8 votes

Getting number of pixels in raster layer with valid data in QGIS

Use the Raster Layer Statistics tool. The output report includes a count of non-NoData pixels (tested in QGIS 3.40): Parameters: Output log: Text of OUTPUT_HTML_FILE.html: Analyzed file: raster.tif (...
user2856's user avatar
  • 69.5k
0 votes

Dealing with no-data values in QGIS Raster Calculator

Solution 1: Replace NoData with fixed, chosen value You can use the QGIS native algorithm Fill NoData cells to assign a "neutral", numerical value instead of nodata, e.g. 0 (if you add the ...
Babel's user avatar
  • 74.9k
1 vote
Accepted

Combining layer information from two different maps into another, separate map in R/terra

As Grzegorz Sapijaszko mentioned in a comment, the solution is as simple as using rbind() on the vectors for each dataset. This generates a vector that simply has NA in the columns for US when showing ...
Tal's user avatar
  • 21
1 vote

Read a .nc file and get variables at certain locations

I would use {terra} package for it. A kind of workflow might be: I have changed your data.frame a bit to have a date in the same period as the layers in provided .nc file, the same applies to ...
Grzegorz Sapijaszko's user avatar
5 votes
Accepted

Clipped raster is 5 times bigger than source

I could not reproduce your issue. I made a test by clipping to the full extent of the source image. I adjusted couple of the parameters (predictor and zlevel) for making the conversion perhaps a bit ...
user30184's user avatar
  • 69k
2 votes
Accepted

Plotting discrete/categorical rasters with custom colors slows down R/terra

This has been fixed in the development version of "terra". I now get: library(terra) #terra 1.8.2 r <- rast("example.tif") d <- r > 0.1 system.time(plot(r)) # user ...
Robert Hijmans's user avatar
0 votes

Draw forest road on Sentinel 2 TCI band

In this case, I recommend using any raster editor (Photoshop, GIMP, etc.) to modify the image (you will need skills with this software), and then set CRS in GDAL using the original image.
Comrade Che's user avatar
  • 8,208
2 votes

Aligning rasters using native:alignrasters with PyQGIS

Your parameter keys for the 'LAYERS' map are incorrect; the keys are 'inputFile' and 'outputFile'. This algorithm works with file inputs and outputs, so if you are working with QgsRasterLayer objects ...
Ben W's user avatar
  • 23.1k
0 votes

Setting max zoom level of QgsRasterLayer with PyQGIS

@DidacBusquets answered his/her own question: The following code does set the maximum and minimum levels of the layer (by appending it to the URL): "type=xyz&url=http://ecn.t3.tiles....
Taras's user avatar
  • 33.9k
0 votes

Terracing in Blender and Float32 > UInt16 Tiff (Daniel Huffman tutorial)

When exporting the TIFF > raw data is supposed to be exported, and not rendered image.
Krasimir Daskalov's user avatar
0 votes

Merging raster layers and taking maximum value of both using QGIS

Follow these steps: 1. Merge all your input rasters. The output (call it "step1_merged") will have the wrong values where the rasters overlaps, but it will overlap all the rasters you have ...
VZAP's user avatar
  • 1
2 votes
Accepted

Setting max zoom level of QgsRasterLayer with PyQGIS

I analyzed the source of the layer and saw, that the "min/max zoom level" are stored in the DataSourceUrl as the zmin/zmax parameters: print(iface.activeLayer().source()) type=xyz&url=...
juto96's user avatar
  • 1,068
0 votes
Accepted

Symbolizing QGIS Raster with PyQGIS

That's an easy fix. You just need to access the renderer color ramp shader's legend settings and set the minimum and maximum labels: sum_raster_in_map = QgsProject.instance().addMapLayer(sum_raster) ...
Ben W's user avatar
  • 23.1k

Top 50 recent answers are included