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

Please add the support for convert the arc.raster object to SpatRaster object in terra package and stars object in stars package directly #84

Open
SpatLyu opened this issue Sep 20, 2023 · 3 comments

Comments

@SpatLyu
Copy link

SpatLyu commented Sep 20, 2023

Describe the bug
Now, the advanced R package fro processing raster data is terra and stars package, please add the support for convert the arc.raster object to SpatRaster object in terra package and stars object in stars package directly.I can achieve this now by use :

library(arcgisbinding)
arc.check_product()
library(terra)

arc.open("path/to/raster data") |> 
  arc.raster() |> 
  as.raster() |> 
  rast()

and

library(arcgisbinding)
arc.check_product()
library(stars)

arc.open("path/to/raster data") |> 
  arc.raster() |> 
  as.raster() |> 
  st_as_stars()

but it‘s inelegant, may be the team can add support to convet the arc.raster object to SpatRaster object in terra package and stars object in stars package directly?

@JosiahParry
Copy link
Contributor

Thank you @SpatLyu! This a great suggestion.

I think the cleanest approach would be to add generics for stars::st_as_stars() and terra::rast(). Is there a use case where you prefer stars over terra? I unfortunately am not too familiar with raster-based workflows.

@SpatLyu
Copy link
Author

SpatLyu commented Sep 20, 2023

Thanks, @JosiahParry! I use terra to deal with raster-data in most cases, which also has the SpatVector object to deal with vector-data .But I usually deal with vector-data in R use sf package ,when i use both raster and vector data, for me , the stars can work better with sf as sf and stars have a same author and these two packages have more unified function design style! In a word, sf for vector-data and terra for raster-data in most cases for me,but the stars is necessary needed. And the reason why I request for adding support to direct convert from arc-raster object to SpatVect object and stars object is that my friends like to use gdb to store raster layer and I usually use R 😂

@SpatLyu
Copy link
Author

SpatLyu commented Sep 20, 2023

Maybe two functions as.rast() and as.stars() can be added to convert them directly?

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

3 participants