New answers tagged raster
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 ...
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
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
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 ...
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
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:
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 ...
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 ...
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 ...
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 (...
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 ...
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 ...
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 ...
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 ...
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 ...
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.
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 ...
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....
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.
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 ...
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=...
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)
...
Top 50 recent answers are included
Related Tags
raster × 10090qgis × 2877
r × 1780
arcgis-desktop × 1658
gdal × 904
python × 825
coordinate-system × 495
arcmap × 449
clip × 406
postgis × 401
geotiff-tiff × 397
arcpy × 396
dem × 388
raster-calculator × 365
vector × 348
polygon × 320
grass-gis × 293
shapefile × 281
pyqgis × 266
arcgis-pro × 230
arcgis-10.0 × 214
rasterio × 207
geoserver × 181
spatial-analyst × 179
arcgis-10.1 × 176