Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
0 answers
21 views

stars and st_apply: summarise NetCDF for each timestamp and create multiple new attributes

I have a stars-object like this one: https://drive.google.com/file/d/1qcMATPjSyw-Rk9WpfFTa1rpr7dtOUxsu/view?usp=drive_link It looks like this: nc = read_stars("~/Desktop/SPARTACUS - Spatial ...
Lenn's user avatar
  • 1,379
0 votes
0 answers
590 views

How can I project very large rasters with terra, raster or stars packages in r?

I am trying to project a very large raster (about 7GB each) from NAD 1983 UTM Zone 16N to Wisconsin Transverse Mercator (ESPG:3071) and neither the terra nor the raster package seem to work. Terra ...
Bob SomeAle's user avatar
0 votes
1 answer
211 views

Find cells with maximum value per dimension in stars object (R)

I would like to find the cells, and their corresponding centroid, that hold the maximum value for each band in a multiband raster. Converting the stars-object to a sf-dataframe makes this easy somehow....
Lenn's user avatar
  • 1,379
1 vote
1 answer
359 views

Modify raster coordinates (wrong projection) using stars or terra

I downloaded a raster image from the following address, which corresponds to rivers and streams in the Barcelona area. https://geoserveis.icgc.cat/icgc_geotecnicbcn25m/wms/service?REQUEST=GetMap&...
marcbosch's user avatar
  • 157
1 vote
0 answers
208 views

Recursively mosaic rasters by directory (year) in R

I have hundreds of rasters spanning 10 years, files are stored by year (e.g., 2020, 2019, 2018, etc.). I would like to mosaic all the raster files within a directory, move to the next directory and ...
derelict's user avatar
  • 1,455
4 votes
1 answer
2k views

Mask a (raster) stars object in R with a vector (sf) object

In this question an stars object is masked with a raster object. But it is not clear to me how the masking can be done with a vector object using the stars pkg. Consider the following example in terra....
Francisco Jos Goerlich Gisbert's user avatar
3 votes
2 answers
823 views

What's the most efficient way to calculate line length per raster cell in R?

Problem I'm looking for an efficient, memory friendly to calculate total line (vector data) length per raster cell. The question of line length per cell has already been posed here in 2014 and a few ...
gosz's user avatar
  • 216
1 vote
2 answers
141 views

Is there an equivalent of "isLonLat" function in terra package in R?

I am refactoring my code which extensively relied on raster package to now use the newer and better terra package. I was making use of the isLonLat() function that returns TRUE if the crs of a raster ...
Faustin Gashakamba's user avatar
2 votes
1 answer
560 views

Expand stars-raster in R

In the r-package terra there is the function terra::extend. To my understanding it just expands the raster with no data values on each side right? I wanted to do something similar, but using a stars ...
Lenn's user avatar
  • 1,379