USEPA / elevatr

An R package for accessing elevation data
Other
202 stars 25 forks source link

Feature suggestion: Ability to change where raster tiles are stored #95

Closed andrew-caudillo closed 9 months ago

andrew-caudillo commented 9 months ago

Hello, This package is great and very efficient, but I would like to suggest adding the ability to declare where the temp raster tiles are stored. Some institutions, like mine, require us to store data in specific folders. Currently, elevatr does not allow this.

Thank you,

jhollist commented 9 months ago

@andrew-caudillo Turns out this was a pretty quick to track down. The current version on the main branch has this ability. Just specify a location for tmp_dir in get_elev_raster. The location needs to already exist as I don't create a new directory.

Let me know if this works as you had hoped for! Thanks for the suggestion.

andrew-caudillo commented 9 months ago

Thanks for looking into this, Jeff! I did this: get_elev_raster(mypolygon, tmp_dir = my//special//directory, z=12) and it did not save to my//special//directory. Did I use the correct syntax?

jhollist commented 9 months ago

Hmmm... Let me take another look. I tested it with tmp_dir = "." and that did the trick. All my unit tests assume tempfile() is used.

jhollist commented 9 months ago

I am able to specify any path and it works. Make sure you have the latest version from github (will be 1.0.0.9999). It may be still seeing the older version you had from CRAN.

andrew-caudillo commented 9 months ago

Thanks, Jeff- I will look into that! That is probably the reason, I do not have that version

jhollist commented 9 months ago

Yep! remotes::install_github("jhollist/elevatr") will get the new one, and then just make sure you start with a fresh R session.