Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_elev_raster #67

Open
PM-deer opened this issue Feb 17, 2022 · 2 comments
Open

get_elev_raster #67

PM-deer opened this issue Feb 17, 2022 · 2 comments

Comments

@PM-deer
Copy link

PM-deer commented Feb 17, 2022

I have been using the function get_elev_raster to pull in a dem of my study site to look at habitat selection of mule deer. This was working until today and now I am getting this error code:
Error in h(simpleError(msg, call)) :
error in evaluating the argument 'CRSobj' in selecting a method for function 'spTransform': NA.
I am not sure how to go about resolving this issue.
Here is the code I am trying to run:
tp.aoi <- read_sf(dsn = 'txdot_2015_county_detailed_tx.shp')

Pull just Brewster, however you can add to the list of counties to get more

tp.aoi <- tp.aoi[tp.aoi$CNTY_NM %in% c('Brewster'),]

Pull the DEM

Elevtr way

dem <- get_elev_raster(locations = tp.aoi, z = 11)
Here is the shapefile:
txdot_2015_county_detailed_tx.zip

@jhollist
Copy link
Owner

jhollist commented Mar 9, 2022

@PM-deer, first, apologies for the delay in getting back to you on this.

Your code runs fine on my machine. This error is usually a result of out of date packages. Make sure that sf, sp, rgdal, raster, and elevatr are all current. There have been a lot of changes and a lot of moving parts to keep track of WRT to how R now handles coordinate reference systems. So older packages may not work well with how I currently have elevatr set up.

@PM-deer
Copy link
Author

PM-deer commented Mar 15, 2022

I updated my packages to sf (1.0-6) sp (1.4-6), rgdal (1.5-28), raster (3.5-15), and elevatr (0.4.2) and I am still getting the same error code. Any Idea? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants