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?
960 Views Asked by GustavoRiga At
2
There are 2 best solutions below
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
- in R, recovering strings that have been converted to factors with factor()
- How to reinstall pandoc after removing .cabal?
- How do I code a Mixed effects model for abalone growth in Aquaculture nutrition with nested individuals
- How to save t.test result in R to a txt file?
- how to call function from library in formula with R type provider
- geom_bar define border color with different fill colors
- Different outcome using model.matrix for a function in R
- Creating a combination data.table in R
- Force specific interactions in Package 'earth' in R
- Output from recursive function R
- Extract series of observations from dataframe for complete sets of data
- Retrieve path of supplementary data file of developed package
- r package development - own function not visible for opencpu
- Label a dataset according to bins of a histogram
- multiply each columns of a matrix by a vector
Related Questions in PACKAGE
- r package development - own function not visible for opencpu
- Composer scripts
- Importing with package name breaking enum comparison in Python
- install a R package from directory
- Uninstall unused packages with pip
- Roxygen error "Skipping invalid path"
- Error return from the pooledBin function (R package binGroup) depending on the method of confidence interval calculation
- r package development imports not loaded
- Access database with new pacakage in Laravel 4.2
- Unity3D 5 packages conflict
- Code Gear RAD Studio Delphi 2007 can't find package error opening pas file
- how to install packages from pypi to anaconda?
- MELPA pointing to non-existent version of multi-term?
- How to disable automatic package installation / upgrade in Visual Studio?
- SSIS package execution succeeds but doesn't do its job
Related Questions in LAYER
- Converting Obj-C to Swift
- layer vs quickblox baas comparison
- Web application architecture, N-tiers, 3 tiers or multi-layer
- How to work in Atom Editor's view directly
- OpenLayers3: best way to display multiple WMS layers in trasparency
- Leaflet: layers control for WMS
- Where should I implement e-mail logic in N-tier application?
- get a SubLayer with swift2 and Xcode 7
- Modifying the look of an NSButton with a CALayer works differently in macOS 10.12 and 10.10
- How to choose layers in RNN (recurrent neural networks)?
- All new layer si transparent
- Can I transport just the image changes/layers i'm concerned with?
- View border Color not changing
- Add Translucent Image to JLayeredPane
- How to apply Perspective 3d Transform on image and save that image in document directory
Related Questions in RASTER
- gdal_merge on a three band .tif - remove the 'no data' value
- predict with glmer where new data is a Raster Stack of fixed efefcts
- how to create an extent which is not parallel to X and Y axis R raster
- How to rotate an image R raster
- How does R's tikzDevice deal with raster images?
- calculate average correlation for neighboring pixels through time
- How to find maximum value in rasterbrick?
- saving rotate images in R - avoiding background and maintaining size
- Plot basic graph with no borders, titles, etc
- reproject raster (WGS84 to BNG) with large resolution
- How can I avoid white space in my levelplot in R
- R raster functions, splitting multiple rasters from one
- Python Script for percent change in NPP ( Net Primary Production)
- How to plot a spatially explicit hdf5 file? - r - raster
- How to adjust two maps with different extent in R
Related Questions in RGDAL
- Missing projection file in R's rgdal package for geospatial analysis
- Multiple spplots in a page and with a single index
- readOGR .gdb with multiple Feature Datasets in R
- rgdal::readOGR versus readOGR namespace issue?
- gpclibPermit() not working
- Plotting shapefile points
- R rgdal::readOGR issue with file path refering to linux home directory
- how to export tm object without chart borders
- How to do the raster package identify all bands (layers) of a image?
- How to extract specific values from a DEM (digital elevation model)?
- Can't display polygon generated from rgdal in shiny-leaflet
- Error: isTRUE(gpclibPermitStatus()) is not TRUE when using fortify function, rgdal package
- readOGR cannot read a GML file
- How to load all fields/ExtendedData (not just 'name' and 'description') from KML layer into R
- Strange issue changing extent projection from UTM to latlon (WGS84) and back again to UTM
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)
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?
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