Displaying 20 results from an estimated 4000 matches similar to: "How to calculate the number of points that fall inside each cell of a given raster using R"
2018 Mar 28
0
netCDF to GeoTIFF by layer in r
Hi Ahmed,
When reading from a ncdf file you can use the 'varname', 'lvar' and 'level' arguments - see the 'Details' section in the docs
https://www.rdocumentation.org/packages/raster/versions/2.6-7/topics/raster <https://www.rdocumentation.org/packages/raster/versions/2.6-7/topics/raster>
We can't tell what is in the ncdf file from what you report other
2018 Mar 28
2
Fwd: netCDF to GeoTIFF by layer in r
Hi
I have a netCDF file of volumetric soil water content at four
different soil layers and want to convert each soil layer in the
netCDF file to a GeoTIFF layer. This code converts the netCDF file to
one GeoTIFF layer, i.e. unclear which soil depth.
file.nc <- "C:/Soil_Weather_data/Agro/VMC21/VMC21.nc"
file.tiff <- "C:/Soil_Weather_data/Agro /VMC21/VMC21"
importnetcdf
2007 Sep 20
2
Superimposing vector polygons over raster grid in a plot
Hello:
I would like to superimpose vector polygons (state outlines) from a
Shape file on top of a satellite image,
imported into a SpatialGridDataFrame from GEOTIFF via gdal_translate and
readGDAL.
When I plot polygon and point shape files in R, into
SpatialPointDataFrame and SpatialPolygonDataFrame,
the two feature sets line up geographically, so it seems logical that a
SpatialGridDataFrame
2007 Nov 14
2
geotiff calculations
Dear list,
I have to compare two digital elevation models in raster format (geotiff).
I then have to calculate the differences in altitude for each cell and make
some statistics (basic as mean, median, std, range but also more "advanced"
as RMSE) on that.
I do not know very much how to proceed:
1) is it possible to import the geotiff in R? If so with which package? if
not which is the
2018 Jun 01
0
Problem with adding a raster and a brick
This is now fixed in development on RForge, you can try it out by
installing from there, or from the Github mirror with
devtools::install_github("rforge/raster/pkg/raster").
(To get fixes into raster email the maintainer directly - you might not get
a response but it'll be addressed).
Cheers, Mike.
On Thu, 24 May 2018 at 20:08 Michael Sumner <mdsumner at gmail.com> wrote:
2018 May 24
0
Problem with adding a raster and a brick
On Thu, 24 May 2018 at 18:41 Mark R Payne <markpayneatwork at gmail.com> wrote:
Hi,
I seem to be having a problem adding the following two raster objects
together - one is a rasterLayer, the other is a rasterBrick. The extent,
resolution, and origin are the same, so according to my understand it
should work. The objects look like so:
> obs.clim
class : RasterLayer
dimensions : 60, 200,
2013 Mar 21
0
Problems of exporting raster to ArcGIS
Hello:
I am using R raster package to replace ArcGIS when processing multiple shp files. However, when I export R raster back to ArcGIS, it couldn't recognize R raster file correctly. For example, I used {raster} package and got a RasterLayer as followed.
class : RasterLayer
dimensions : 8280, 18480, 153014400 (nrow, ncol, ncell)
resolution : 0.008333334, 0.008333334 (x, y)
2012 Oct 29
3
How can I map numbers to colours with raster?
This code will read binary file and display it as a map. may problem is that
this code is using a continuous colour scheme, even though I have discrete
data (which is a classification scheme). How can I map numbers to colours
with raster? Please
require(raster)
conne <- file("C:\\lai.bin", "rb")
sd<- readBin(conne, integer(), size=1, n=360*720, signed=F)
2009 Aug 04
1
asc class object - how to get positions (coordinates) for a given raster ID?
In a raster asc object, I'd like to take the positions (x and y coordinates)
for a given "pixel" ID. Any idea about how to do this?
_______________
Paulo E. Cardoso
[[alternative HTML version deleted]]
2018 May 24
2
Problem with adding a raster and a brick
Hi,
I seem to be having a problem adding the following two raster objects
together - one is a rasterLayer, the other is a rasterBrick. The extent,
resolution, and origin are the same, so according to my understand it
should work. The objects look like so:
> obs.clim
class : RasterLayer
dimensions : 60, 200, 12000 (nrow, ncol, ncell)
resolution : 0.5, 0.5 (x, y)
extent : -70,
2012 Mar 21
2
To overlay my raster and its boundary
Hi
I want to overlay my raster and its boundary which is a shapefile.
When I used thise code separately, all is ok:
# Open raster
>Image<-read.table("C:\\Users\\Documents\\Nouveau\\Frequence.txt",sep="",dec=",",header=TRUE)
>testo<-rasterFromXYZ(Image)
>plot(testo)
>testo2 <- aggregate(testo,fact=10, fun=mean)
>plot(testo2)
# open
2009 Feb 21
1
Extracting xy from raster based on raster value
I have a raster (which I called glc), which I read
into R as a raster with "raster.create.from.file" from the raster package (R-forge). Values in glc range between 1 and 27 (whole numbers only). I'd like to extract all cells with a value of 1 to create
a new raster with only the cells that have a value of 1, or to extract
the xy values of all raster cells with a value of 1. Could you
2008 Aug 10
0
possible problem with rgdal
Hello all,
I recently installed rgdal 0.5.24-1 (kyngchaos framework) and I am having
trouble making sense of the row, col information provided.
> a = new("GDALDataset", "dummy.tif")
> GDALinfo("dummy.tif")
rows 420
columns 660
bands 1
ll.x -55.5
ll.y -14.5
res.x 0.008333334
res.y 0.008333334
oblique.x 0
oblique.y
2012 Jul 17
0
Arcgis in R
Hi all,
I am very knew to this R and Arcgis combination. I have already spent days
attempting to find my answer but have failed, therefore could you please if
possible explain any answers in simple form.
I am trying to access Arcgis through R, following a few steps:
1) Set up working directory
2)connect to Python
3) import arcgis- however, when I get to the import stage it comes up with
an error
2010 Oct 06
1
R getting slower until it breaks...
Hello R-users,
I'm currently facing a pretty hard problem which I'm hopping you'll be able to help me with. I'm using R to create images. That alone is not the problem, the problem is that I'm using R to create 168 000 images... My code (which is given below) use different package (raster and rgdal) to import a image (size 20gig) and divide it into 168 000 pictures that are
2011 Jan 31
1
str() on raster objects fails for certain dimensions
Hi,
str() on raster objects fails for certain dimensions. For example:
> str(as.raster(0, nrow=1, ncol=100))
'raster' chr [1, 1:100] "#000000" "#000000" "#000000" "#000000" ...
> str(as.raster(0, nrow=1, ncol=101))
Error in `[.raster`(object, seq_len(max.len)) : subscript out of bounds
This seems to do with how str() and
2013 Apr 25
0
creating raster image in R
Hi R-User
I was trying to make a raster map with WGS84 projection
in R, but I could not make it. I found one data set in Google that data
is almost the same format as of mine. I wanted to make a raster map of
temperature with 1 degree spatial resolution for the global scale.
I
could make it in the GIS software but I do have many variables (to be
many raster images) and ultimately I am
2020 Oct 31
0
[R-sig-Geo] raster::levels() not working in packaged function.
Many thanks,
That worked, since the NAMESPACE file incudes a warning about editing it
directly I ysed the reoygen tag in the fucntion script
#' @import raster.
On Sun, 1 Nov 2020 at 00:18, Marcelino de la Cruz Rot <
marcelino.delacruz at urjc.es> wrote:
> Maybe including
>
> import(raster)
>
> or
>
> importFrom("raster", "levels")
>
> in
2013 Oct 24
1
Plot.raster hides the axis layer
Hi all,
I am trying to plot a raster object (I can explain why but the point is that it would be a raster objeƧt)..
I have selected a small code to show you exactly the problem
require(raster)
test<-matrix(data=runif(10000),nrow=100)
m<-raster(test)
plot(m,axes="FALSE")
axis(1,at=c(0,1),labels=c("a","b")) # THIS DOES NOT CHANGE THE INVISIBLE AXIS WHILE
2024 Apr 18
1
Import multiple tif raster
Dear community
My aim is to import multiple .tif raster files using the help here:
https://stackoverflow.com/questions/52746936/how-to-efficiently-import-multi
ple-raster-tif-files-into-r
Does anyone now about the error "subscripts out of bounds"?
I am not sure about the check with alllrasters: is list() ok or should there
be a number (the number of imported .tif files?
Kind regards