i'm trying to use de raster package to read a multilayer (multiband) image (ENVI format [.hdr]) that have 160 values of refletance and 160 values of wavelength per pixel, but when i use the code that i developed, the program returns only 1 band and the refletance value associated.section1=raster("./x")
getValuesBlock(section1, row=1, nrows=1, col=1, ncol=1 )
How to do the raster package identify all bands (layers) of a image?
961 views Asked by GustavoRiga At
2
There are 2 answers
0
Robert Hijmans
On
To create a multi-layer Raster object, you should use the brick function if they layers are in one file, or the stack function if they are in multiple files.
library(raster)
# example file name
f <- system.file("external/rlogo.grd", package="raster")
b <- brick(f)
b
# a single cell value
b[1]
Related Questions in R
- How to make an R Shiny app with big data?
- How do I keep only specific rows based on whether a column has a specific value?
- Likert scale study - ordinal regression model
- Extract a table/matrix from R into Excel with same colors and stle
- How can I solve non-conformable arguments in R netmeta::discomb (Error in B.matrix %*% C.matrix)?
- Can raw means and estimated marginal means be the same ? And when?
- Understanding accumulate function when .dir is set to "backwards"
- Error in if (nrow(peaks) > 0) { : argument is of length zero Calls: CopywriteR ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous> Execution ha
- How to increase quality of mathjax output?
- Convert the time intervals to equal hours and fill in the value column
- How to run an R function getpoints() from IPDfromKM package in an R shiny app which in R pops up a plot that utilizes clicks to capture coordinates?
- Replace NA in list of dfs in certain columns and under certain conditions
- R and text on Cyrillic
- The ts() function in R is returning the correct start and frequency but not end value which is 1 and not 179
- TROUBLING with the "DROP_NA" Function
Related Questions in PACKAGE
- How to install libfuse2 on Ubuntu 22.04
- chatbot respond to onequery type
- How to get argument from Command line for my python package
- How can I record the entire screen outside of my Flutter app or control a specific area for recording, including sound?
- hashcat : Depends: libminizip1t64 but it is not installable E: Unable to correct problems, you have held broken packages
- OS: Parrot OS (hashcat : Depends: libminizip1t64 but it is not installable)
- Flutter: when I try to hot reload to run the app I get this error when using carousel slider "Error: Couldn't resolve the package 'carousel_slider "
- Could not create '.egg-info': The system cannot find the file specified
- How to implement facebook pixel in flutter in 2024 any example?
- Flutter error on using local_auth package and conflicts with other packages
- Eclipse: "package...does not exist" when building a Maven package that references a class in another project
- Execution failed for task ':app:compileFlutterBuildDebug'. > Process 'command 'C:\flutter\bin\flutter.bat'' finished with non-zero exit value 1Error:
- Export and create package of c++20 modules
- Enforce schema on schemaless DynamoDB database
- Problem with the packages file in my flutterflow project on Visual Code Studio
Related Questions in LAYER
- How to reuse postgres database connection client across multiple AWS Lambda invocations?
- Accessing the last convolutional layer in the model name
- Delay observed between two moving sublayers
- Nuxt 3 Layers and Azure DevOps repositories
- How to Build and Export a MSAVI raster file from Google Earth Engine
- Can I track the position of an element on flutter and display measurements and distances as on figma?
- Custom Layer using Keras
- How to get Stamen background with political boundaries
- How can I solve this layering problem in Unity 2D?
- How can I make a transparent outline for circles so that the background shows through?
- ValueError: Layer 'dense' expected 2 variables, but received 0 variables during loading. Expected: ['dense/kernel:0', 'dense/bias:0']
- how to get the full sized layer mask like photoshop in LibPSD library
- Can we create a stored procedure or a SQL function in a B1 Database using Service layer?
- Python and 3D Design
- How can i use Tailwind directive @layer @apply, when i was in Tailwind CDN environment?
Related Questions in RASTER
- iterating through raster bands to perform calculation
- How to extract vineyard land cover from CORINE in R?
- get the band with the maximum value from a xarray stack
- can't export hd5 file to a tif using terra
- Converting hyperspectral .HDR files into raster arrays in Python to create a mirror image
- using terra to plot a netcdf returning an error
- R - update raster values which fall inside a polygon
- Grouping/Selected Layers using a threshold
- Reproject large raster using Python
- How can I get better quality for exported raster in Arcgis Pro?
- Simplify raster values in terra to category
- Issue displaying GeoTIFF raster data as layer in Leaflet map
- Calculate row-wise or column-wise means using R terra functions
- I have MODIS raster images, want to extract LST values at given lat long values USING python
- How to interpolate missing values given a SpatRaster object in R Terra package?
Related Questions in RGDAL
- Installing rgdal using its repos on Mac
- Add region column in movement data - alternative to retired rgdal package?
- rgdal package is not working in R 4.2.3 used Sf package but without success
- Problems of loading R packages using Rstudio server
- Raster stack does not seem to want to read file
- Error in R_nc4_open: No such file or directory
- Converting USNG or MGRS to Latitude/Longitude in R
- Proj.db not found when imported SHAPEFILE into Rstudio
- Problem with creating breaks and setting colours for choropleth maps in RStudio
- error when installing rgdal package on ubuntu 22.04, rstudio-sever 2023.06.02
- Using Multiple Bounding Latitudes, Not Boxes, to Clip a Polygon Shapefile in R
- R: Will the packages sp and rgdal still work after October?
- How to fix incompatible architecture when loading regal package on MacOs Ventura 13.1
- How do I find references to maptools, rgdal, or rgeos, in my R-package? sf is the only spatial analysis package in the namespace
- R package "rgdal" can not be installed
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Well, from the looks of it , it seems to me that you want to read a particular band of a raster file into the R environment ,
Change the values of the
bandparameter of theraster()method to control the band id of your raster. Hope this helps