Skip to main content
The 2024 Developer Survey results are live! See the results

Questions tagged [r-sf]

The motivation behind the `sf` package is to provide a complete, standardized implementation of simple features in R, with links to GDAL, GEOS and Proj.4. There is a also https://gis.stackexchange.com/ for spatial R questions.

478 questions with no upvoted or accepted answers
12 votes
0 answers
458 views

How to transform vertical z elevation coordinates in R sf

I have some spatial data recorded by a GPS/GNSS that includes Lat/Lon and Height Above Ellipsoid (HAE, meters) altitude values, all are referenced to NAD83(2011), EPSG:6318. I'm trying to convert the ...
DarwinsBeard's user avatar
9 votes
1 answer
2k views

Error when installing SF in R double free or corruption

The problem I was trying to install SF again in my Ubuntu 18.04 machine, because it was giving me some problems. Since I wanted to start everything clean I tried the following: remove.packages("...
Derek Corcoran's user avatar
7 votes
0 answers
1k views

How to make geom_sf() point northwards?

I am trying to make a mapping package for R and ggplot that would allow the users to define their data using decimal degrees but would use appropriate projection depending on where the user's data are ...
Mikko's user avatar
  • 7,680
7 votes
0 answers
284 views

R: Why does st_join give invalid times error?

I am trying to join 2 SpatialPointsDataFrames by nearest neighbour analysis using sf::st_join(). Both files have been converted using st_as_sf() but when I try the join I get the error Error in rep(...
Nebulloyd's user avatar
  • 264
6 votes
0 answers
171 views

Label a map with lead lines/call out using tmap in R

I am trying to produce a map using the tmap library. I want to label all areas and use lead lines to label tiny areas. I'm looking for a line of code that works like ggrepel in ggplot2 or ...
Joke O.'s user avatar
  • 577
6 votes
0 answers
534 views

Spatial join of 100 million points using R

I have a dataset that contains 100 million points. I need to spatially join them to the area they intersect with. I'm using sf and st_join, but unsurprisingly when I try to perform this operation my ...
Chris's user avatar
  • 1,237
6 votes
0 answers
526 views

Error using mapview package: (!is.na(getProjection(lst[[i]]))) { : argument is of length zero

I am trying to use the mapview package to plot a raster and sf feature. streamsTransform <- st_transform(streams, 2958) st_crs(streamsTransform) dem17N <- projectRaster(dem, crs = "+proj=utm +...
Jenna Patton's user avatar
6 votes
1 answer
3k views

rasterFromXYZ() Error in rasterFromXYZ() : x cell sizes are not regular

I am trying to plot points from a df (xyz/latlonvalue) as raster over a geom_sf shapefile. I tried the answers from another post but none of them helped. The data structure is below. First I try ...
ecology's user avatar
  • 643
5 votes
0 answers
3k views

Error sf: no simple features geometry column present

I tried to import an ESRI shapefile with sf with the following code: test = st_read("mont.shp", package="sf") However, I get the error message: Error in st_sf(x, ..., agr = agr, ...
BosBas's user avatar
  • 111
5 votes
0 answers
553 views

create animation of vehicle moving along a route "with timeline of events"

This is a followup question on How to create animation of vehicle moving form A to B along a route?. I could learn how to animate vehicles moving from A to B along the route. Thanks for the help! But ...
SiH's user avatar
  • 1,516
5 votes
0 answers
430 views

Fast geospatial sampling in R

I have a large set of polygons (about 20k) that I want to sample points from. I use the st_sample function from the sf package in R, but it's pretty slow. It takes about 5 minutes to sample from all ...
Ben's user avatar
  • 469
5 votes
0 answers
2k views

geom_sf does not use geometry coordinates in axes but plots correct shape of polygon?

My overall aim is to combine multiple shape files (polygons of river sub-basins from within a large river basin) into one file and plot as a map. This new combined file will later combine with ...
Katy42's user avatar
  • 51
5 votes
0 answers
2k views

Loop to check multiple polygons overlap in r SF package

I have a set of polygons which can overlap each other. I can find intersection by comparing 1 by 1 polygon each time step by step. by using st_intersection(x,y) The problem is my data contains many ...
aprilian's user avatar
  • 651
5 votes
0 answers
1k views

Google basemap and geom_sf aligned WITH custom geom_image symbols and annotation labels in R

I would like to use custom symbols and annotation on a geom_sf polygon layer that is placed on a google basemap. Initially, I had difficulty with the basemap and polygon lining up correctly So I ...
ErikaD's user avatar
  • 51
4 votes
1 answer
144 views

Error uploading spatial data to existing RPostgreSql table using sf::st_write() in R

I created the following RPostgreSql table with a primary key and foreign key: create table us_hurricanes ( id serial primary key , geo_id int ...
Julia Wagenfehr's user avatar

15 30 50 per page
1
2 3 4 5
32