rsbivand / rgrass

Interpreted interface between the GRASS geographical information system and R
https://rsbivand.github.io/rgrass/
24 stars 8 forks source link

rgrass7 impending breaking changes #6

Closed rsbivand closed 2 years ago

rsbivand commented 4 years ago

This is now the development repository for rgrass7. The version here (>= 0.2) may need use_sp() in scripts and depends/imports/suggests packages. The idea is to avoid loading and attaching both sp/rgdal and sf/stars, and is preliminary (only vector works with sf).

The aim is to establish rgrass7 on r-spatial - see https://github.com/r-spatial/discuss/issues/18.

Attn: @MiKatt, @tim-salabim, @pat-s, @jannes-m; I'll email other maintainers. At least please install this package version and see what breaks downstream. If helpful downstream, please PR after trying R CMD check on the package in the GRASS small NC location.

Could @Nowosad, @jannes-m, or @Robinlovelace please check impacts on GeoCompR.

tim-salabim commented 4 years ago

ping @gisma

gisma commented 4 years ago

got it

veroandreo commented 4 years ago

This is now the development repository for rgrass7. The version here (>= 0.2) may need use_sp() in scripts and depends/imports/suggests packages. The idea is to avoid loading and attaching both sp/rgdal and sf/stars, and is preliminary (only vector works with sf).

This is great news! I'm really looking forward for this change! It could be in syntony with the new image collections under development in GRASS GIS [1].

Is it planned to implement a direct import of STDS (raster/vector space-time datasets) from GRASS into stars objects??? This would be just awesome!

[1] https://github.com/OSGeo/grass/pull/63

jannes-m commented 4 years ago

Thanks for letting us know, I will check if the Geocompr code still works or if we have to update it.

MiKatt commented 4 years ago

Thanks for the information. I will check what needs to be updated.

Best, Mira

Am 29.07.2019 um 19:49 schrieb Roger Bivand:

This is now the development repository for rgrass7. The version here (>= 0.2) may need |use_sp()| in scripts and depends/imports/suggests packages. The idea is to avoid loading and attaching both sp/rgdal and sf/stars, and is preliminary (only vector works with sf).

The aim is to establish rgrass7 on r-spatial - see r-spatial/discuss#18 https://github.com/r-spatial/discuss/issues/18.

Attn: @MiKatt https://github.com/MiKatt, @tim-salabim https://github.com/tim-salabim, @pat-s https://github.com/pat-s, @jannes-m https://github.com/jannes-m; I'll email other maintainers. At least please install this package version and see what breaks downstream. If helpful downstream, please PR after trying R CMD check on the package in the GRASS small NC location.

Could @Nowosad https://github.com/Nowosad, @jannes-m https://github.com/jannes-m, or @Robinlovelace https://github.com/Robinlovelace please check impacts on GeoCompR.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rsbivand/rgrass7/issues/6?email_source=notifications&email_token=AEYLU64MGZYKNMRM3JEKO4LQB4UQ5A5CNFSM4IHUYKG2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HCDL2FA, or mute the thread https://github.com/notifications/unsubscribe-auth/AEYLU63LYZLBMLVFACQGZATQB4UQ5ANCNFSM4IHUYKGQ.

-- Dr. Mira Kattwinkel Quantitative Landscape Ecology Institute for Environmental Sciences University of Koblenz-Landau Fortstraße 7 76829 Landau Germany Fon: + 49 6341 280-31553

rsbivand commented 4 years ago

Probably if (packageVersion("rgrass7") >= "0.2.1") use_sp() will be sufficient to load sp and rgdal as in 0.1.* versions. Note that sp is now only loaded, not attached, so you may need to add sp:: and rgdal:: if you had relied on rgrass7 to attach these packages.

Robinlovelace commented 4 years ago

Thanks for heads-up @rsbivand - this is @jannes-m's forte so will defer to his judgement on impacts in the geocompr code. I can see writeVECT(SDF = as(london_streets, "Spatial"), vname = "london_streets") here https://geocompr.robinlovelace.net/gis.html#rgrass

Suspect this will need or benefit from being updated.

rsbivand commented 4 years ago

If both vector and raster are used, until stars raster support is in place, use_sp() will be needed. If only vector, use_sf() should work OK. Switching may work, but then all the packages (sp, rgdal, sf and stars) will be loaded. For your case, add a lineif (packageVersion("rgrass7") >= "0.2.1") use_sf() and writeVECT(SDF = london_streets, vname = "london_streets") should be OK, but you may need an else writeVECT(SDF = as(london_streets, "Spatial"), vname = "london_streets") if users haven't upgraded rgrass7 (I won't submit to CRAN until things look stable).

rsbivand commented 4 years ago

By the way, Edzer suggested working on rgrass7 in Münster at Geostat: https://twitter.com/edzerpebesma/status/1156277394434678785

Robinlovelace commented 4 years ago

Many thanks for the clear guidance @rsbivand. You up for adjusting the code accordingly @jannes-m ? Sceptical about if statements in the code. We could just say in the prose something like (note: the code below assumes you are running **rgrass7** 0.2.1 or above).

jannes-m commented 4 years ago

sure, will do

jannes-m commented 4 years ago

I have updated the rgrass7 section in Geocompr, everything works fine with use_sf(). You can find the updated version in a new branch (https://github.com/Robinlovelace/geocompr/tree/rgrass7_sf_stars). We will merge this branch into the master as soon as rgrass7 is released on CRAN. We will do the same with the updated exercises (https://github.com/geocompr/geocompkg/tree/grass7_sf_stars).

rsbivand commented 4 years ago

rgrass7 0.2-1 released on CRAN. Documentation also on https://rsbivand.github.io/rgrass7/.