New answers tagged

1

There is most of the time a loss of information when you convert float to integers. I would say that there are two types of solution to avoid losing too much : rescale the data by multiplying the raster values by a constant (e.g. 1000). In this case, think about the type of integer before you rescale (Byte goes up to 255, uint16 up to 65535 etc). the "...


3

Example data library(raster) r <- raster(ncol=3, nrow=3, vals=c(0,100,1000,1000,100,0,0,100,1000)) You can do: rasterToPoints( match(r, 100)) # x y layer #[1,] 0 60 1 #[2,] 0 0 1 #[3,] 0 -60 1 or as.data.frame( match(r, 100), xy=TRUE, na.rm=TRUE) or, for multiple values rasterToPoints( match(r, c(0, 100))) # x y layer #[1,]...


1

I was able to do a stacking using osgeo/gdal. When stacked, it will generate a new image with a bounding box that extends to both image. After that you can read both band from the stacked image and perform the calculation. Each band from the stacked image will have 0 values on the extent which it not have original values. from osgeo import gdal red_filename =...


4

If you have ample memory to read the raster into RAM you can use which. We will first create a raster with 3 values (0, 100, 1000) per your description. library(raster) r <- raster(nrow=100, ncol=100) r[] <- sample(c(0,100,1000), ncell(r), replace=TRUE) Now we can use which to identify the position of cells meeting the query and xyFromCell to ...


2

You need to specify the .tif extension when you save the raster, otherwise it will save to grid format. It is a good practice to explicitly define your input and output rasters. Here are the changes I would make: in_raster = r"C:\image.tif" out_raster = r"C:\Geoprocessing\band_1_rast1.tif" raster1 = arcpy.Raster(in_raster) band1 = ...


1

QGIS has a graphical modeler. there you can define inputs, build all the steps of the model and invoke the batch processor and specify inputs. Since now you only have 1 process, it should work. so it would look something like this. This is too simple, you'll probably want to add an Extent input, and a raster calculator: and then invoke as a batch process, ...


3

I may suggest a couple of workflow according to your QGIS version. Personally I prefer Greater than frequency tool, which keeps me from reclassifying each of the input distribution maps. Classic approach (prior to QGIS 3.16) This is the workflow what you have described. Reclassify your distribution map (continuous values) into binary ([0 or 1]) raster. ...


-2

My experience is that PostGIS is less suitable for calculating with raster data. You could try using the GeoDMS, open source software for modelling with (large) geo datasets (both vector and raster). More information on wiki.objectvision.nl With a simple script you can relate your polygon vector dataset to the raster data and count the number of landcover ...


2

Use the "Mosaic to New Raster" tool in ArcMap. (Don't confuse this with creating a Mosaic raster dataset, which is a different thing.) This tool creates a new single raster by merging multiple rasters. In the tool, you can configure which rasters take precedence in areas where they overlap. In this case, you would want your water depth raster to ...


1

Starting from QGIS 3.16 you can perform cell-based statistics natively using Cell Statistics tool. For your case, you can use Mean cells as a statistic method to calculate the mean of all 52 rasters.


1

Starting from QGIS 3.16 you can perform cell-based statistics natively using Cell Statistics tool. For your case, you can use Count statistic method to count the cloud coverage located in each raster, and the final output will give you the total number of times the value of cloud occured in this cell.


Top 50 recent answers are included