mapview icon indicating copy to clipboard operation
mapview copied to clipboard

added SpatVector and SpatRaster methods to mapView.R

Open joshualerickson opened this issue 3 years ago • 4 comments

Hey @tim-salabim, I've been running into issue #432 and thought I would take a go at adding methods for SpatRaster and SpatVector. In short, I added a setMethod() for both SpatRaster and SpatVector from which the functions are .stars_method and sf_method. Essentially converting to either stars::st_as_stars('some_SpatRaster') or sf::st_as_sf('some_SpatVector'). Hope this might be of some help... Thanks again for this great package! I use it so so much. Take care.

joshualerickson avatar Aug 03 '22 21:08 joshualerickson

Thanks for this @joshualerickson! Very helpful! Did you R CMD check the package? I think terra would need to be suggested/imported in DESCRIPTION (which I don't see in the PR).

tim-salabim avatar Sep 17 '22 09:09 tim-salabim

Hey @tim-salabim I can’t remember? One thing I have noticed is devtools::document() won’t run successfully with the current head. Not a big deal (we’ll might be…) but not sure why?

I can run a check tomorrow evening and put terra in the suggests and then push. Thanks again for the sweet package!

joshualerickson avatar Sep 17 '22 15:09 joshualerickson

No problem. I'll have a look tomorrow as well (a whole day of rain, so dev time 😁).

tim-salabim avatar Sep 17 '22 16:09 tim-salabim

Seems to check just fine without having terra in DESCRIPTION. I'll merge as soon as minor thing above is addressed

tim-salabim avatar Sep 18 '22 10:09 tim-salabim

Hi @joshualerickson @tim-salabim -- any updates on this?

(CC: @HannaMeyer)

Nowosad avatar Oct 27 '22 19:10 Nowosad

Hey @Nowosad I can't remember why we didn't merge? @tim-salabim do you remember? Is it the issue with devtools::document()? The fork works locally (i've been using it) but when I check in dev I get the error below.

> devtools::document()
ℹ Updating mapview documentation
ℹ Loading mapview
Error in setMethod("mapView", signature(x = "RasterLayer"), function(x,  : 
  no existing definition for function ‘mapView’
Warning message:
.onUnload failed in unloadNamespace() for 'mapview', details:
  call: NULL
  error: 'stopWatching' is not an exported object from 'namespace:mapview' 

Not sure if this was the minor issue you were talking about 🤷

joshualerickson avatar Oct 27 '22 19:10 joshualerickson

Sorry for the delay!

tim-salabim avatar Nov 04 '22 09:11 tim-salabim