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

All Questions

Tagged with
0 votes
2 answers
105 views

Cannot write shapefile to working directory from sp object using rgdal package in R 4.2.3

The rgdal package is not working anymore. I used writeOGR: writeOGR(occ_sp, species_set[i], driver = "ESRI Shapefile", dsn = dsn, overwrite = TRUE) but got this error: Error in writeOGR(...
A. Aldow's user avatar
0 votes
0 answers
316 views

How do I find references to maptools, rgdal, or rgeos, in my R-package? sf is the only spatial analysis package in the namespace

In my R package I replaced calls to other spatial analysis packages with sf functions, but still get a message: "The legacy packages maptools, rgdal, and rgeos, underpinning this package will ...
Thomas Smith's user avatar
0 votes
0 answers
211 views

Issues with st_intersection or st_difference to cut polygons spread outside USA

I have a following use case to cut/diff the polygons that spread outside the boundary. I am trying to migrate from rgdal package to sf packages as they are expiring. The code below works fine. ...
Muhammad Raees's user avatar
0 votes
1 answer
234 views

How to create a spatial gridlines using Latitude and Longitude in R

How to create a gridline of 7*7 sqkm using Latitude and Longitude values. These values should be the centroid value of a single square in the grid. I am not sure if I am doing it in the right way. I ...
Usman YousafZai's user avatar
0 votes
0 answers
163 views

How can I use write_sf in R to limit the number of decimal places in the DBF?

I have had issues with writing new shapefiles and limiting the number of decimal places in the DBF file. My code is rather simple : write_sf(temp_points, "temp_points.shp") and even though ...
EmburMaps's user avatar
1 vote
0 answers
348 views

How to optimize speed in spatial thinning in r

The problem I am embarking on a project were I will need to build more or less 30,000 species distribution models (SDM), and I have been testing several ideas. Right now my bottleneck is to speed up ...
Derek Corcoran's user avatar
0 votes
0 answers
40 views

Skewed geography plotting census shapefiles in R

I've pulled US census data by block and merged the block shapefile on it manually with the sf and rgdal packages. When I plot the resulting sf object it's showing a skewed map despite the crs ...
BLP92's user avatar
  • 189
0 votes
2 answers
431 views

Converting WSG84 to UTM, rgdal alternatives

I have numerous existing scripts in which I used project() from the rgdal package to convert WSG84 Latitude/Longitude coordinates into UTM. rgdal has intermittently been giving me headaches by ...
Anke's user avatar
  • 599
0 votes
1 answer
1k views

r - readOGR(), terra::vect and sf::st_read : cannot open shapefile while file.exists = TRUE and .shp, .dbf and .shx files in the same folder

I don't understand why I get the error : "Cannot open data source" while my path should have been at least once correct and that the .shp, .dbf and .shx files are in the same folder. I've ...
Muriel's user avatar
  • 3
0 votes
0 answers
67 views

st_extract in stars with bilinear = TRUE crashes R on mac with M1 chip

Apparently the bilinear extraction in st_extract from the stars package causes problems on a mac with the M1 chip. Does anybody found the problem and/or has a workaround? The function st_extract works ...
SimeonL's user avatar
  • 77
0 votes
0 answers
160 views

Longitude and Latitude of a shape file

I created a data frame (projects) by merging a shape file (US Zip codes) and a dataset. The below line of code returns the X and Y coordinates of my data frame (project)! I Would like to include ...
Nader Mehri's user avatar
0 votes
1 answer
348 views

Dissolving polygons by distance - R

I'm quite new to geospatial analysis in R and need help with dissolving polygons based on their location. I have a shapefile with about 1500 polygons. Each polygon has a property code. There are a ...
Lari Delazari's user avatar
0 votes
1 answer
2k views

Trouble installing package "sf" in R (Big Sur)

I tried to install the sf package because it is a dependency for tidycensus, which is the package I'd like to use. I am using a Mac with Big Sur. Per the Github for r-spatial, I tried following the ...
TCW's user avatar
  • 25
2 votes
1 answer
858 views

Extracting Long/Lat from a shapefile and calculating nearest distance between two sets of coordinates

I have two sets of data that I'm working with. The first is a list of addresses and their respective Longitude and Latitude coordinates: First is the list of addresses and their long/lat coorindates: ...
user avatar
1 vote
1 answer
249 views

How to extract random coordinates from some place keeping its own geometric form?

I'd like to get random coordinates into the red bounded area: The code below is what I've tried so far but I'm not sure if this does what it is supposed to do since this is a mix of a few codes and I'...
Davi Américo's user avatar

15 30 50 per page