Geographic Information Systems Asked by Bryan Souza on July 18, 2021
I’m stuck with a problem:
I got three raster’s layers: "Sand", "Clay" and "BD" (Bulk density) of the same region.
How can I obtain a "table" or a "Data frame" with information for the values of the raster’s for each pixel?
I prefer to use QGIS or R.
My main goal is to obtain a lookuptable of this features of the soil:
So i will merge pixels with the same information for Clay, Sand and BD into a unique MU_GLOBAL index.
Do you need to calculate the values of the entire extent of the raster?
if so in QGIS is very easy and fast, you can use expressions and get the global statistics of your raster in a table.
We will use the statistics, you can calculate the value:
An example calculating the average, give a name to the field, define a decimal number, with two or more decimals.
raster_statistic('BASIN001D8',1,'avg')
In this case, 'CUENCA001D8' is the name of the layer as it appears in the layers panel. The value 1 is the band of the raster layer being queried.
Correct answer by Luis Perez on July 18, 2021
Using R, you could do something like:
# Assuming the raster layers are geotiff format
library(raster)
rast_list = c(""Sand.tif", "Clay.tif", "BD.tif")
soil_stack = stack(rast_list)
soil_values_df = values(soil_stack)
Although, depending on the size of your region, and resolution, this could be quite inefficient. Not sure what MU_GLOBAL refers to.
Answered by Micha on July 18, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP