All Questions
54
questions
1
vote
1
answer
80
views
Issue projecting polygon that crosses dateline R
I have a polygon in a North America equal area projection and I would like to transform to unprojected long/lat. I would like to use it to crop a global raster in unprojected longlat.
The problem is ...
2
votes
1
answer
83
views
How to adjust population data in a raster dataset using census data from an administrative boundary shapefile
I downloaded 100m resolution population raster data from WorldPop, and through transprojection and cropping, I got a city's population spatial distribution raster data, in addition, I have the ...
0
votes
2
answers
115
views
Cut up overlapping polygons in a gdb using terra or sf
I have a massive gdb of lots of polygons, many of them overlapping (sometimes partial overlaps and sometimes full overlaps). The polygons represent landscape treatments with different attributes I'd ...
1
vote
4
answers
167
views
Cumulative length of a LINESTRING using sf or terra
is there a more efficient way to measure the cumulative length of a <LINESTRING> or <MULTILINESTRING>? In other words, I need to measure the distance between points from the start to the ...
1
vote
0
answers
119
views
How do I generate the correct volume contour from a raster using sf, spatialEco, and terra?
I am interested in using R packages spatialEco and terra to generate some kernel density estimates with data of varying weights so that I can export contour shapefiles for mapping. I'm currently ...
1
vote
0
answers
457
views
Installing `terra` or `sf` R package using Conda
I would like to install the terra or sf R package in a Conda environment (on a Linux HPC). The following error appears if I install it from within R:
# remotes::install_github("rspatial/terra&...
1
vote
1
answer
595
views
Convert a vector grid created with sf::st_make_grid into a raster stack
I have a vector grid created with sf::st_make_grid() with several columns of
values. I would like to convert it to a raster stack, with each column of values becoming
a layer of the raster stack.
I ...
0
votes
0
answers
222
views
R terra cannot create SpatVector from sf MULTILINESTRING if line contains only single point
I have an MULTILINESTRING sf that appears to be ok (see dput below), but when I try and convert it to a SpatVector using pv <- terra::vect(test2) I get the error:
Error: [as,sf] coercion failed. ...
1
vote
0
answers
125
views
How to buffer coastlines from rnaturalearth?
I need to be able to generate buffer shapes of the global coastline to filter vessel traffic data. The buffer I'm currently trying to generate is for 200 nautical miles, but hopefully the method can ...
1
vote
1
answer
179
views
Sampling based on polygon size/area
I am trying to sample about 10000 points in multipolygon (12) with different sizes. The multipolygon has "ID" and "Area". I want the sample to be drawn based on each polygon size (...
0
votes
1
answer
214
views
terra::vect does not work for larger polygons
I am trying to convert watershed boundaries delineated using the R package streamstats to SpatVector objects using terra::vect. I uploaded an Rdata file with a list of a subset of 6 of the sf object ...
0
votes
1
answer
773
views
Why does terra::rast change raster values from numeric to factor?
I need to clip the national landcover database raster to a watershed boundary vector. This post works for some of the watersheds I am working with, but not all of them. For the ones that it does not ...
0
votes
1
answer
375
views
Creating 1m, 5m, 10m, 50m, 100m and 500m grids with OS National Grid codes in R
I previously asked this question on how to add OS National Grid codes to grids 1km and above. However, I now need a method of creating grids below 1km (1m, 5m, 10m, 50m, 100m and 500m) that have OS ...
0
votes
1
answer
374
views
Convert raster to geodatabase (gdb) file
I am trying to convert a raster to geodatabase (gdb) file using R and then read this gdb file back into R. The gdb file contains a column (gridcode) that I need for other calculations within my R ...
0
votes
2
answers
160
views
subset raster to separate two classes
I have a raster that is too large to post here but can be downloaded from here: https://login.filesanywhere.com/fs/v.aspx?v=8c6c688b586472bcab6a . When I plot it I see a mix of water and land. I would ...