-
Notifications
You must be signed in to change notification settings - Fork 11
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
Problem with the initialisation of a grass session in R #88
Comments
Downgrading rgrass to version 0.3-9 did not solve the issue. |
@amelinevallet Could you run |
@rsbivand here is what I obtain with rgrass_0.4-2
I thought I managed to downgrade rgrass to version 0.3-9 in my previous message, but indeed, not : when I uninstall the package and force the installation of version 0.3-9, version 0.4-2 is automatically installed (see bellow). I have to figure out how I can install correctly this previous version before being able to make the required test with version 0.3-9. Sorry for that.
|
Get 0.3-9 from https://cran.r-project.org/src/contrib/Archive/rgrass/rgrass_0.3-9.tar.gz and use: |
I have managed to install rgrass 0.3-9, here is session and traceback info:
|
Please install from the source package downloaded from CRAN only, do not use The underlying problem may be that GRASS 8.3.2 is emitting XML that is not in UTF-8 encoding in your locale. R sees your locale as |
Yes, indeed session_info() indicates a mismatch between loaded and on-disk rgrass 0.3-9 versions when I installed it with devtools.
I re-installed rgrass 0.3-9 version from the source package as indicated. Here is the session_info and traceback info:
|
Regarding your suggestion about encoding, I checked GRASS and R sessions locales. Here is what I obtained for GRASS
And here for R:
So if I understand properly, both use the same encoding (fr_FR.UTF-8)? Is there something else to check for GRASS? @rsbivand do you know where the xml files generated by GRASS are located ? I could check if their encoding really is fr_FR.UTF-8, or if there is an incomplete string somewhere ? |
With |
I removed GRASS 8.2 version, but I am re-installing it right now. |
To install GRASS 8.2, and easily switch between GRASS versions, I used the following lines:
|
With GRASS 8.2 I do not receive the same error message:
I am not sure to understand what is the problem, but apparently, with the downgraded GRASS 8.2 version and rgrass 0.3-9, the error do not appear anymore. So we do have a workaround until the issue with GRASS 8.3 is more clearly identified, it is a good news !!! Thanks, |
Could you please try with rgrass 0.4-2? |
I just tried, it worked with rgrass 0.4-2 too. Here is the session_info for the test with rgrass 0.3-9
And here for the test with rgrass 0.4-2
I hope this information is useful |
A pbm raised when using GRASS 8.2 : it is not possible to download addons from github with g.extension. The problem is documented here: https://gis.stackexchange.com/questions/474069/cannot-install-grass-addons-in-grass-8-2-ubuntu-jammy, and the workaround proposition works well. |
Having at last rebuilt my GRASS 8.3.2 (GEOS was updated last night, so I rebuilt GEOS, GDAL and finally GRASS from source) on Fedora 40, with R 4.4.0 and current rgrass, I do not see any problem. I cannot see from https://github.com/OSGeo/grass/commits/main/lib/gis/parser_interface.c that My guess might then be that GRASS 8.3.2 was not updated successfully from 8.2 in your case. How was GRASS 8.3.2 installed, from source or binary? If from source, which configure arguments were used, and did |
Grass 8.3.2 was installed with : |
No problem here with GRASS GIS 8.3.2 on Linux Mint 21.3 (based off Ubuntu 22.04) + R 4.4.0 + rgrass 0.4.2 (CRAN): Code and output$ R
R version 4.4.0 (2024-04-24) -- "Puppy Cup"
Copyright (C) 2024 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> packageVersion("rgrass")
[1] ‘0.4.2’
> library(rgrass)
GRASS GIS interface loaded with GRASS version: (GRASS not running)
> initGRASS(gisDbase = "/home/floris/grassdata", location = "nc_basic_spm_grass7", mapset = "PERMANENT", override = TRUE)
No gisBase set. Trying to detect from the GRASS_INSTALLATION environment variable.
No GRASS_INSTALLATION environment variable was found.
Trying to set gisBase by running command `grass --config path` (requires grass in the system PATH).
Taking gisBase value from `grass --config path` output: /usr/lib/grass83
gisdbase /home/floris/grassdata
location nc_basic_spm_grass7
mapset PERMANENT
rows 1350
columns 1500
north 228500
south 215000
west 630000
east 645000
nsres 10
ewres 10
projection:
PROJCRS["NAD83(HARN) / North Carolina",
BASEGEOGCRS["NAD83(HARN)",
DATUM["NAD83 (High Accuracy Reference Network)",
ELLIPSOID["GRS 1980",6378137,298.257222101,
LENGTHUNIT["metre",1]]],
PRIMEM["Greenwich",0,
ANGLEUNIT["degree",0.0174532925199433]],
ID["EPSG",4152]],
CONVERSION["SPCS83 North Carolina zone (meter)",
METHOD["Lambert Conic Conformal (2SP)",
ID["EPSG",9802]],
PARAMETER["Latitude of false origin",33.75,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8821]],
PARAMETER["Longitude of false origin",-79,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8822]],
PARAMETER["Latitude of 1st standard parallel",36.1666666666667,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8823]],
PARAMETER["Latitude of 2nd standard parallel",34.3333333333333,
ANGLEUNIT["degree",0.0174532925199433],
ID["EPSG",8824]],
PARAMETER["Easting at false origin",609601.22,
LENGTHUNIT["metre",1],
ID["EPSG",8826]],
PARAMETER["Northing at false origin",0,
LENGTHUNIT["metre",1],
ID["EPSG",8827]]],
CS[Cartesian,2],
AXIS["easting (X)",east,
ORDER[1],
LENGTHUNIT["metre",1]],
AXIS["northing (Y)",north,
ORDER[2],
LENGTHUNIT["metre",1]],
USAGE[
SCOPE["Engineering survey, topographic mapping."],
AREA["United States (USA) - North Carolina - counties of Alamance; Alexander; Alleghany; Anson; Ashe; Avery; Beaufort; Bertie; Bladen; Brunswick; Buncombe; Burke; Cabarrus; Caldwell; Camden; Carteret; Caswell; Catawba; Chatham; Cherokee; Chowan; Clay; Cleveland; Columbus; Craven; Cumberland; Currituck; Dare; Davidson; Davie; Duplin; Durham; Edgecombe; Forsyth; Franklin; Gaston; Gates; Graham; Granville; Greene; Guilford; Halifax; Harnett; Haywood; Henderson; Hertford; Hoke; Hyde; Iredell; Jackson; Johnston; Jones; Lee; Lenoir; Lincoln; Macon; Madison; Martin; McDowell; Mecklenburg; Mitchell; Montgomery; Moore; Nash; New Hanover; Northampton; Onslow; Orange; Pamlico; Pasquotank; Pender; Perquimans; Person; Pitt; Polk; Randolph; Richmond; Robeson; Rockingham; Rowan; Rutherford; Sampson; Scotland; Stanly; Stokes; Surry; Swain; Transylvania; Tyrrell; Union; Vance; Wake; Warren; Washington; Watauga; Wayne; Wilkes; Wilson; Yadkin; Yancey."],
BBOX[33.83,-84.33,36.59,-75.38]],
ID["EPSG",3358]]
>
> sessioninfo::session_info()
─ Session info ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
setting value
version R version 4.4.0 (2024-04-24)
os Linux Mint 21.3
system x86_64, linux-gnu
ui X11
language nl_BE:nl
collate nl_BE.UTF-8
ctype nl_BE.UTF-8
tz Europe/Brussels
date 2024-06-14
pandoc 3.1.11 @ /usr/lib/rstudio/resources/app/bin/quarto/bin/tools/x86_64/pandoc
─ Packages ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
package * version date (UTC) lib source
cli 3.6.2 2023-12-11 [3] RSPM (R 4.3.0)
codetools 0.2-20 2024-03-31 [3] RSPM (R 4.3.0)
Rcpp 1.0.12 2024-01-09 [3] RSPM (R 4.3.0)
rgrass * 0.4-2 2024-03-17 [3] RSPM (R 4.3.0)
rlang 1.1.4 2024-06-04 [3] RSPM (R 4.4.0)
sessioninfo 1.2.2 2021-12-06 [3] RSPM (R 4.2.0)
terra 1.7-78 2024-05-22 [1] RSPM (R 4.4.0)
xml2 1.3.6 2023-12-04 [3] RSPM (R 4.3.0)
[1] /home/floris/lib/R/library
[2] /usr/local/lib/R/site-library
[3] /usr/lib/R/site-library
[4] /usr/lib/R/library
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
> However GRASS GIS on my system has been installed somewhat differently (the PPAs that you list, don't have 8.3.2 for Ubuntu Jammy). The stable binary GRASS GIS releases for Ubuntu are at the ubuntugis-unstable PPA, as linked at https://grass.osgeo.org/download/linux/). Hence you need I have: $ apt policy grass
grass:
Installed: 8.3.2-1~jammy1
Candidate: 8.3.2-1~jammy1
Version table:
*** 8.3.2-1~jammy1 500
500 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu jammy/main amd64 Packages
500 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu jammy/main i386 Packages
100 /var/lib/dpkg/status
7.8.7-1 500
500 http://ftp.belnet.be/ubuntu jammy/universe amd64 Packages
500 http://ftp.belnet.be/ubuntu jammy/universe i386 Packages So I'd suggest to purge existing GRASS GIS 8.3.2, reinstall it from this PPA and try again. |
No problem here with GRASS GIS 8.3.2 and 8.5.0dev on Ubuntu 22.04 and R 4.4.0 + rgrass 0.4.2. |
Dear all,
Since I updated GRASS (8.2 -> 8.3.2) and rgrass (?-> 0.4-2), the installation seems broken and I can't start a GRASS session from R anymore. The error message I receive is the following:
Here below an example which I hope is reproducible:
I receive the same error message whether I use a custom path for temp files or not, and when I manually indicate within the initGRASS function custom entry parameters.
We are using GRASS 8.3.2 and R version 4.4.0 in a linux environment (Ubuntu 22.04.4 LTS). GRASS works well (I can use all applications from a GRASS session started in the terminal).
The environment variables seem all correct:
Anyone knows what might be the problem?
Best regards,
Améline
The text was updated successfully, but these errors were encountered: