Skip to main content

New answers tagged

2 votes

QGIS point sampling misses data on edge of raster (possible bug?)

It's not just the bottom row, it's the right side points as well. And this is not really a bug, it's just the way raster indexing works. It affects other software as well. Rasters are indexed top ...
user2856's user avatar
  • 67.2k
2 votes

Issue with delineation using dem because of a DAM

Gokul is correct in that filling the artefact depression created by the dam would be suboptimal as it would modify every DEM value upstream of the dam up to the spill point, which will affect your ...
Nigel Van Nieuwenhuizen's user avatar
0 votes

Issue with delineation using dem because of a DAM

You can modify manually your DEM to "remove" the DAM elevation points and adjust it to the your upstream and downstream river elevations using either the "terrain modification" on ...
dimitris fotopoulos's user avatar
0 votes

Overlapping emmissions with Euclidean decay

I have a solution: The focal function of the terra package provides the possibility to pass a custom, weighted matrix as the window. This is a pretty awesome feature of terra, most software only allow ...
Ratnanil's user avatar
  • 1,003
0 votes

Using raster as 3D layer in ArcGIS Pro

If you can convert your TIFF to a LAS it might work better. I use CloudCompare to do that. Then you can create a LASD (Create LAS Dataset tool) and go from there.
TheOmoSlide's user avatar
2 votes

Soften/round edges of raster layer using QGIS

You can use the QGIS Processing GDAL -> Raster extraction -> Contour polygons tool
user2856's user avatar
  • 67.2k
0 votes

Setting band 4 of raster to alpha with GDAL?

If there's someone wondering, this can be done as well for a VRT using the Python API: from osgeo import gdal ... ds: gdal.Dataset = gdal.OpenEx(product_vrt_path, gdal.GA_Update) rb: gdal.Band = ds....
Guillermo Moreno Castaño's user avatar
2 votes
Accepted

Showing bin upper/lower bound for discrete legend for raster in QGIS

Change your interpolation to "Discrete". E.g:
user2856's user avatar
  • 67.2k
4 votes
Accepted

Assigning Z value along line on raster using QGIS

Optionally create a small buffer around your line Rasterize your vector layer (Processing Toolbox/GDAL/Vector conversion/Rasterize with attribute or fixed value). It'll burn the the value into the ...
Zoltan's user avatar
  • 7,400
0 votes

Clipping raster image using coordinates from CSV file with Python

You can clip using rasterio.mask and geopandas: import geopandas as gpd import rasterio, os from shapely import box from rasterio.mask import mask raster_file = r"/home/bera/Drives/data1/gisdata/...
Bera's user avatar
  • 74.8k
1 vote
Accepted

Sample raster (Landsat) using points (preferably using Python or maybe GEE Code editor)

You can simplify the value extraction by using rasterstats: import geopandas as gpd from rasterstats import zonal_stats df = gpd.read_file(r"/home/bera/Desktop/gistest/pointgrid.shp") ...
Bera's user avatar
  • 74.8k
0 votes

Style group of values different in a raster dataset in GeoServer-SLD

I'm not really sure what happens when you apply a filter to a raster - it is technically allowed by the specification, I'm just not sure that what should happen is defined. Filters are designed to ...
Ian Turton's user avatar
  • 82.2k
0 votes

Removing white background from GeoTIFF in GeoServer

For those who can install GDAL, it looks like the better command to do this is nearblack (also works with white ^^). It's made especially to remove black, white or custom color border background (...
Adrien Rey-Jarthon's user avatar
2 votes
Accepted

Cloud masking ECOSTRESS LST data

@Spacedman I found another solution, which seems to work okay and there is no need to install other libraries. library(terra) # working dir wd <- "path/" # read the raw LST lst_raw <-...
Nikos's user avatar
  • 1,093
1 vote

Cloud masking ECOSTRESS LST data

Using the bitops package you can work on values at the bit level: > library(bitops) First test a matrix with all 8-bit values from 0 to 255 in a 16x16 raster: > r = rast(matrix(0:255,16,16)) ...
Spacedman's user avatar
  • 65.1k
0 votes

QGIS Clipping raster with vector-getting all touching pixels

As of now (2024) it seems, gdal:cliprasterbymasklayer, which is based on gdalwarp retains only pixels, whose center-point lies within the clipping mask. I needed to have only pixels that do not ...
Beni's user avatar
  • 356
1 vote
Accepted

Raster extract function on R return values incompletely

The problem is likely with the cropping and masking of the input rasters before running exact_extract. There is no need to do this - the values can be extracted from the original rasters directly. ...
dbaston's user avatar
  • 13.2k
1 vote

Comparing COG and other rasters, Do fast 'gets' mean display benefits? only when serving from cloud? or also when on network and local drives too?

Cloud-optimised geotiffs (COGs) do provide benefits, even when not involved with the cloud, especially when considering displaying the data. Imagine a case where you are loading a multi-GB image into ...
Mikkel Lydholm Rasmussen's user avatar
1 vote

Changing NULL values of raster to 0 in QGIS

Is there not a simpler solution, using "Fill NoData cells". As the tool states "This algorithm resets the NoData values in the input raster to a chosen value, resulting in a raster ...
IanGS's user avatar
  • 388
1 vote
Accepted

Error when using tmap: Error in if (hover != "" && !hover %in% smeta$vars) rlang::arg_match0(hover, : missing value where TRUE/FALSE needed

Using version 3.99.9001 from github, I get your error, but you can't use tm_borders with a raster. > r = raster(matrix(runif(100),10,10)) > tm_shape(r) + tm_borders() + tm_scale_intervals(style =...
Spacedman's user avatar
  • 65.1k
0 votes

Extract highest point in raster and convert to point vector

You need a unique id column in your polygon layer. Clip raster by mask layer (your polygon layer) Raster pixels to points Join the polygon id to the points. If you have many points you should create ...
Bera's user avatar
  • 74.8k
2 votes

Vary raster transparency based on cell values in ArcGIS Pro

In the original layer's Symbology choose a color ramp of your choice. For example, a black to white ramp called 'Continuous Color Scheme' is a good option. After selecting the color ramp click on the ...
GBG's user avatar
  • 10k
3 votes

Correlation analysis between large number of environmental rasters

If you have enough memory to read in and correlate two rasters you can do it one pair at a time. I've created a sample set of four .asc raster files. > rastlist [1] "r1.asc" "r2.asc&...
Spacedman's user avatar
  • 65.1k
1 vote
Accepted

Splitting and calculating across a large RasterStack using Terra in R

I'm not sure if I did exactly what you expected with the names but, this works, even if some of the spatrasters within the stack are NA or empty. I tweak the function the create the layer names there ...
César Arquero Cabral's user avatar
0 votes

How to make PyQGIS to return 4 raster subdivisions calculated by inequations

I'm answering this question because it is necessary to increase the information about the use of Raster Calculator in PyQGIS (QgsRasterCalculator and QgsRasterCalculatorEntry classes and methods). Its ...
xunilk's user avatar
  • 30k
0 votes

QGIS crashes when using pyQGIS QgsRasterCalculator

QGIS crashes were produced because it was used a wrong method in QgsRasterCalculatorEntry; specifically this one: ras.layer = lyr1 instead of: ras.raster = lyr1 Following code, by using my own paths ...
xunilk's user avatar
  • 30k
3 votes
Accepted

"Latitude Grid Not Spaced Evenly" warning from NCEP-NCAR reanalysis 2m Air Temp raster

As a first comment, please consider using terra because that package has now superseded the raster package. The filename air.2m.gauss.1961.nc already suggests that the data is distributed on a ...
darius.goergen's user avatar
2 votes

Expression is not working in QgsRasterCalculator with PyQGIS

Following code produces a result by using two arbitrary layers (with random values between 0 and 10) created by me in a Linux system (for this reason the differences in syntax for naming directories). ...
xunilk's user avatar
  • 30k

Top 50 recent answers are included