MiKatt / openSTARS

open source implementation of the STARS ArcGIS toolbox
https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0239237
Other
46 stars 13 forks source link

Issues using import_data #5

Closed sosotili closed 5 years ago

sosotili commented 5 years ago

Hi !

I want to use openSTARS to retrieve the edges of the streams over a region in France.

I am unable to import the sites shapefile to the GRASS session. I can't find on the internet anyone with the same issues. You can find below the error messages. I'm using GRASS GIS 7.4.4

Here is the result of sessionInfo()

sessionInfo() R version 3.5.2 (2018-12-20) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200)

Matrix products: default

locale: [1] LC_COLLATE=French_France.1252 LC_CTYPE=French_France.1252 LC_MONETARY=French_France.1252 [4] LC_NUMERIC=C LC_TIME=French_France.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] openSTARS_1.1.0 rgrass7_0.1-12 XML_3.98-1.18 sp_1.3-1 data.table_1.12.0

loaded via a namespace (and not attached): [1] igraph_1.2.4 Rcpp_1.0.0 rstudioapi_0.9.0 raster_2.8-19 magrittr_1.5
[6] hms_0.4.2 progress_1.2.0 maptools_0.9-5 MASS_7.3-51.1 bit_1.1-14
[11] lattice_0.20-38 R6_2.4.0 rlang_0.3.1 blob_1.1.1 tools_3.5.2
[16] rgdal_1.3-9 grid_3.5.2 SSN_1.1.13 DBI_1.0.0 rgeos_0.4-2
[21] assertthat_0.2.0 bit64_0.9-7 digest_0.6.18 crayon_1.3.4 Matrix_1.2-15
[26] codetools_0.2-15 memoise_1.1.0 RSQLite_2.1.1 compiler_3.5.2 prettyunits_1.0.2 [31] foreign_0.8-71 pkgconfig_2.0.2

And here's my code

initGRASS(gisBase = "c:/Program Files/GRASS GIS 7.4.4",

  • home = tempdir(),
  • override = T) gisdbase C:/Users/so-th/AppData/Local/Temp/RtmpUtDHxE location file76420d158d4 mapset file764f1d23de rows 1 columns 1 north 1 south 0 west 0 east 1 nsres 1 ewres 1 projection NA dem_path <- "DEM_230m_wgs84.tif" sites_path <- "station_loire_wgs84.shp" streams_path <- "stream_wgs84.shp" setup_grass_environment(dem = dem_path ) Setting up GRASS Environment ...

ATTENTION: Le verrouillage concurrent de jeux de cartes n'est pas pris en charge dans Windows

gmeta() gisdbase C:/Users/so-th/AppData/Local/Temp/RtmpUtDHxE location file76420d158d4 mapset PERMANENT rows 3775 columns 5861 north 51.44525 south 40.86117 west -5.601792 east 10.83087 nsres 0.00280373 ewres 0.00280373 projection +proj=longlat +no_defs +a=6378137 +rf=298.257223563 +towgs84=0.000,0.000,0.000

Everything works fine, until import_data...

import_data(dem = dem_path, sites = sites_path) Loading DEM into GRASS as dem ... Loading sites into GRASS as sites_o ... Error : XML content does not seem to be XML: 'ATTENTION: BUG dans les descriptions, l'option 'entrée' dans n'existe pas ATTENTION: BUG dans les descriptions, l'option 'région' dans n'existe pas <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE task SYSTEM "grass-interface.dtd">

...
    Error in parseGRASS(cmd, legacyExec = legacyExec) : v.import not parsed

Here is the full error message, which was to long to be included in the message. issue import_data.txt

It seems I have both an encoding issu with XML, i tried setting it to latin1 but it doesn't work... But also an issue to access to v.import... I'm new to this software. I asked a coworker about it and it works on his computer with the same data.

MiKatt commented 5 years ago

Hello, could you please add the following line on top of your code to get the messages in English and then post the messages again (sorry, I do not speak Frensh): Sys.setenv(LANG = "en") As it does work on your colleagues computer it seems to be a personal setting or similar. It might be a GDAL issue. How did you install GRASS GIS (stand alone or via OSGeo4W)?

sosotili commented 5 years ago

Well, it actually worked perfectly just by setting the language environment to english.

Not speaking french is the way to solve problems !

Thank you for your answer and your time !

MiKatt commented 5 years ago

I guess it might have been an issue with decimal points or special characters, but I am not sure. I'm happy that it works now.