New answers tagged

0 votes

QGIS GRASS tool r.cross support file

I recommend to use Semi-Automatic Classification Plugin plugin instead, in which you can use post-processing tool, there is one called "Land cover change". This options gives you both raster ...
Fabio Daniel Trinco's user avatar
1 vote
Accepted

Differences in raster statistics using gdal and gdalinfo

With your Python method by using the first "True" you ask GDAL to compute approximated statistics . stats = srcband.GetStatistics(True, True) See the documentation https://gdal.org/doxygen/...
user30184's user avatar
  • 62k
0 votes

Copying CRS from input file for writing to output file in Python without GDAL library

A CRS alone is not enough to georeference a raster, you also need to specify the transform when opening the output file, by copying that from the input: https://rasterio.readthedocs.io/en/stable/api/...
mikewatt's user avatar
  • 4,868
1 vote
Accepted

Rasters not having the same total area for classes within the same study area

I also do not believe this is an Origin/Nap issue. I believe that the reason for this is that the SLOPE calculations were performed after the DEM was clipped to the study extent. Because the slope ...
JasonInVegas's user avatar
  • 1,780
1 vote

Rasters not having the same total area for classes within the same study area

I do not believe that this is an origin/snap issue. Although, it is always prudent to set an analysis environment to control for cell size, origin/snap and mask. There are many operators that result ...
Jeffrey Evans's user avatar
2 votes
Accepted

Create multiband raster in Python from X, Y

You're doing a lot of unnecessary looping. You can create your random values in a single array and you don't need a dataframe. import numpy as np import rasterio as rio from rasterio.transform import ...
user2856's user avatar
  • 64k
-1 votes

Raster calculate in Python

You can use Geopandas and rasterstats: from rasterstats import zonal_stats import geopandas as gpd shapefile = r"C:\GIS\data\testdata\zones.shp" rasterfile = r"C:\GIS\data\...
BERA's user avatar
  • 67.1k
0 votes

How to export a jpeg image with a raster layer extent in PYQGIS?

For this kind of tasks using processing algorithms from pyqgis is usually the way to go. For example you can first extract one band with Rearrange Bands or Translate, and the burn a value with ...
Francisco Puga's user avatar
0 votes

Aligning two rasters of same resolution perfectly on top of each other in QGIS

I've got a tool that will automate aligning rasters in ArcGIS Pro - https://www.arcgis.co/home/item.html?id=4f5e9d4e3b974890991d33e7e5251231 See also https://gislandscapeecology.blogspot.com/2023/09/...
Tom Dilts's user avatar
  • 421
0 votes

SAGA - Raster statistics for polygons is not working

ohh, yes, you are right. I didnt see the wood for trees. Is it possible to execute a saga tool via "termial" in qgis and change the option "quantile" to "quantiles" ? ...
Kai's user avatar
  • 13
0 votes

After adding rasters to mosaic I can't see new raster without zooming in

The answer was in parallel processing - it has to be set up with 0
educated_morron's user avatar
1 vote
Accepted

Create multiple rasters in PostGIS from a (xyz) table

The Good News: There is an rpostgis package on CRAN which has a pgWriteRast function that can create a PostGIS raster. The Bad News: You only have another 9 days in which you can use it. It works by ...
Spacedman's user avatar
  • 61.6k
1 vote

Raster clip using REST API with shapefile polygon

You can use the provided WPS cropCoverage process which take a raster and a polygon.
Ian Turton's user avatar
  • 79.9k
1 vote
Accepted

Using "export table" on a raster attributes table in ArcGIS ModelBuilder is resulting in different results than using it outside of ModelBuilder

Using the copy rows tool solved the problem in ModelBuilder.
IA_arcGIS's user avatar
2 votes
Accepted

Building a WMS QgsRasterLayer from a QgsDataSourceUri

I manually added a WMS layer and looked at the URI as shown in the layer properties to work out what URI components are needed: And based on this example came up with the following which works in the ...
user2856's user avatar
  • 64k
0 votes

How to remove NA value of legend when using R tidyterra?

I prefer using tmap. Note my order of loading libraries, placing of functions, arguments and replacing == with %in%. This can be reproduced even more parsimoniously using other tidyverse functions I ...
Rion Lerm's user avatar
  • 159
2 votes
Accepted

How do I use the Raster calculator to extract all cells that have one of a number of values?

I recommend using Reclassify by table instead of raster calculator for this task.
Comrade Che's user avatar
  • 7,016
0 votes

GEE - Is there a way to divide an image to a set number of rows and columns, then export those smaller images?

You can use coveringGrid to split a polygon into pieces.
Noel Gorelick's user avatar
1 vote
Accepted

Pixel level landcover change analysis

Ouch, that double loop is quite unnecessary :) You can use the terra::crosstab function to evaluate class-level change. We will move this analysis to terra so that the depreciation of raster will not ...
Jeffrey Evans's user avatar
0 votes

Take specific bands from multiple rasters and stack them into one new raster

Picking and choosing specific bands from different rasters and combining them together seems a bit tricky So far the best I've found is making a virtual raster of each band you want from each raster ...
Buff Fox's user avatar
  • 104
0 votes

Iterating through Bands of Raster using ArcMap ModelBuilder

I had the same trouble as another person connecting the Parse Paths to the Calculate Value. Eventually I worked out that the connections from Parse Path to Calculate Value are Preconditions, not ...
Malcolm's user avatar
1 vote

Turn off the setting of QGIS to produce XML when closing Raster layer

The *.aux.xml files are called persistent auxiliary metadata (PAM), and are created by GDAL to cache image statistics and speed up subsequent reads. If you want to disable their creation through QGIS, ...
Aaron Zuspan's user avatar
0 votes

Optimizing rasters and .mxd file to read them faster

built overviews and pyramids helped the most EDIT: Both helped in the same way because I tried my rasters as new raster and new dataset of rasters. They helped because they render low and different ...
educated_morron's user avatar
0 votes

Removing black box outside clipped raster layer using ArcGIS Desktop?

I was also facing similar issues. The no data option in the symbology didn't work for me. However, I conducted the clip/extract operation and tried to save the output raster within a geodatabase ...
Niraj 's user avatar
0 votes

Merging rasters with pixel/cell offset with QGIS

Assuming you want r2 to get the same extent as r1 and they have the same pixel size and CRS. One solution I found is this (QGIS 3.28.10): import your data create a point grid with the desired spatial ...
Nikos's user avatar
  • 882
1 vote
Accepted

Extent not found on NASA's Black Marble monthly images - How to set it?

Read the data using terra::rast - I'm not sure what sds wins you here, this works: r <- rast("VNP46A3.A2018182.h06v05.001.2021125183820.h5") Define the coordinates to be lat-long WGS84: ...
Spacedman's user avatar
  • 61.6k
1 vote
Accepted

Error 001491 Cannot process above the size limit

The error you're receiving is a result of the max row and column limit defined in the service itself. These properties exist mostly to protect the service (server) from having to dispatch large ...
KHibma's user avatar
  • 16.6k
0 votes
Accepted

How to remove values from raster band QGIS

I ended up re-saving the the raster file and adding "no data classes". This effectively removed them from the projection, it also sped up further analyses. I went to export > save as all ...
Hartje's user avatar
  • 123
0 votes

Get values from raster file in R

The .ovr file contains "overview" images - lower-resolution versions of the main data file to make mapping at low resolutions quicker, for software that understands it. If you try creating a ...
Spacedman's user avatar
  • 61.6k
4 votes
Accepted

QGIS 3.28: Set the "no data" colour to transparent for multiple rasters?

In QGIS 3.32.2-Lima - you can copy a raster style and paste it into multiple raster layers:
Comrade Che's user avatar
  • 7,016
0 votes

Double indexing and looping over raster lists in R

This aproach shoud work: re_zero <- list() for(i in 1:length(re)){ r <- re[[i]] r[is.na(r[])] <- 0 re_zero[[i]] <- r }
sermomon's user avatar
  • 1,084
0 votes

Extending a raster with specific slope

If I understand your request, you might look at the GRASS GIS module r.grow.distance (module manual page). This module takes a raster as input, with features and NULL cells surrounding. THen it ...
Micha's user avatar
  • 15.4k

Top 50 recent answers are included