r-raster Questions

1

I know I could execute r.thin from GRASS GIS within the rgrass7 package, but I don't want to build up a grass gis environment, for this task. So are there other solutions in R? Small example, des...
Madalene asked 14/12, 2015 at 20:45

5

Solved

On extracting values of a raster to points I find that I have several NA's, and rather than use a buffer and fun arguments of extract function, instead I'd like to extract the nearest non-NA Pixel ...
Natal asked 19/12, 2014 at 8:17

2

Solved

given is a raster as well as a SpatialPolygonsDataframe. In order to retrieve the highest value of the raster within the area of a polygon, raster::extract can be used. It works fine. How to get...
Catchment asked 29/12, 2017 at 11:9

4

Solved

I have a script where I read a raster stored as .tif : f_treecover <- raster('Landcover_data/treecover_res_100_q.tif') The script used to run fine a few months ago, but now I get the following...
Hourigan asked 28/6, 2021 at 10:8

1

Solved

{leaflet.extras2} implements the leaflet side-by-side plugin and provides this minimal example: library(leaflet) library(leaflet.extras2) leaflet(quakes) %>% addMapPane("left", zInde...
Stigma asked 29/3, 2022 at 23:22

2

Solved

Here is a gradient color legend I created using rasterImage: colfunc <- colorRampPalette(c("red", "blue")) legend_image <- as.raster(matrix(colfunc(20), ncol=1)) plot.new(...
Acquaintance asked 2/1, 2022 at 11:39

2

Solved

I would like to use aggregate function from the terra R package to aggregate raster with a quantiles approach as aggregation function. Here below, I used the quantile function from R base to comput...
Flurry asked 20/8, 2021 at 15:5

1

Solved

I just noticed that terra::cellSize() produces cell area estimates that do not match those produced by raster::area(). First, why do these two methods not provide the same answer? Second, which est...
Adenoid asked 8/7, 2021 at 20:39

1

Solved

I'm changing my spatial workflow to use the terra package instead of the raster package. With the raster package I used to read in multiple rasters directly into a stack. filelist_temp <- list.f...
Mile asked 8/2, 2021 at 19:20

1

Solved

Is there a straightforward way to convert polygonal SpatVector class objects (from the terra library) to either simple features or SpatialPolygonsDataFrames?
Edington asked 23/9, 2020 at 20:18

4

Solved

Is there a way to filter out those parts which don't belong to the main path? As you can see in the picture i would like to remove the crossed out part while keeping the main path. I already tried ...
Terina asked 1/10, 2020 at 16:45

0

I have a large elevation raster from the ASTER database made by using raster::mosaic(). Each tile represents a one-degree by one-degree portion of the earth with an estimated raster resolution of 3...
Moorer asked 19/7, 2020 at 21:23

2

Solved

I am working with daily observation of climate data organized in .nc files. I read them using the stack command of the raster package. Each file (corresponding to a year) is a RasterStack element w...
Wickner asked 3/8, 2015 at 23:31

1

Solved

Problem statement: With ggquiver::geom_quiver() we can plot vector fields, provided we know x, y, xend, and yend. How can I calculate these parameters for an arbitrary RasterLayer of elevations? H...
Agronomy asked 7/5, 2020 at 1:47

1

Solved

I have some code that loops over a list of study IDs (ids) and turns them into separate polygons/spatial points. On the first execution of the loop it produces the following error: Error in (funct...
Heiduc asked 4/5, 2020 at 17:40

1

I would like to plot a legend with two axes. Specifically, I have combined two spatial objects that have been classified, the first showing intensity of an event and the second showing the probabil...
Filomena asked 6/3, 2020 at 23:21

2

Solved

I'd like to evaluate the time to extract data from a raster time series using different file types (geotiff, binary) or objects (RasterBrick, RasterStack). I created a function that will extract th...
Caribbean asked 10/1, 2020 at 18:2

1

I have installed R (3.5.1) and R-studio (1.1.456) just now (using Anaconda). Then, I installed the raster package (2.9-5). Everything was okay, but when I tried to import, I got this message: >...
Embrangle asked 22/5, 2019 at 9:28

1

Solved

I am trying to downscale climatic conditions using the methodology in this article using the R software. I am almost there, but I am missing a couple of steps Packages and data needed For this exam...
Copenhagen asked 6/12, 2018 at 14:13

2

Solved

In R, we can take a raster and turn it into a SpatialLinesDataFrame with the function rasterToCountour: library(raster) f <- system.file("external/test.grd", package="raster") r <- raster(f...
Eberle asked 4/12, 2018 at 20:40

2

Solved

I'd like to do a small program in R for interactive visualization and modification of some raster datasets, seen as colored images. The user should open a file (from the terminal it's OK), plot it,...
Gobioid asked 8/6, 2015 at 8:35

1

Solved

I have 50 geotiff files in the same folder. All of them represent elevation data in different parts of the world. I would like to merge certain geotiff files, and I found mosaic in R might help us....
Tabathatabb asked 8/5, 2018 at 12:52

1

Solved

Taking a raster file of monthly temperature data for multiple years which has a name attached accessible via names(object) in the following format 'Jan.1981', 'Feb.1981' etc (example files for two ...
Pragmatism asked 1/5, 2018 at 16:24

1

Previously I was using raster::crop and raster::mask with shapefiles of class Spatial*, read in using rgal::readOGR. I am just "upgrading" my scripts to use sf for reading and manipulating polygo...
Fry asked 21/3, 2017 at 12:38

1

Solved

I'm trying to plot two variables taken from raster datasets on a map in R to produce something that looks a bit like this: However, ideally I'd like the scale from bottom left to top right to be...
Serg asked 1/2, 2018 at 22:23

© 2022 - 2025 — McMap. All rights reserved.