Comments (10)
Upon further investigation, it was noted that rgeos was not loaded,
Checking rgeos availability: FALSE
Note: when rgeos is not available, polygon geometry computations in maptools depend on gpclib,
which has a restricted licence. It is disabled by default;
to enable gpclib, type gpclibPermit()
and the reason that the raster module was failing was that the sp libary sp() was not being used.
When line 236 if the script was modified from :
libs = ['GWmodel', 'data.table', 'rgrass7', 'rgdal', 'raster']
to:
libs = ['GWmodel', 'data.table', 'sp', 'rgeos', 'rgrass7', 'rgdal', 'raster']
and the following line was added after line 248
r_file.write('use_sp()\n')
The script was then able to get past this error. However, in line 293
predict = g.read_command("g.tempfile", pid=os.getpid()).strip() + '.txt'
a temporary file is written to hold the results of the GWR analysis.
On windows, this leads to a filename like this:
D:\grass\lake\u18wgs84\bathy.tmp/unknown\13752.5.txt , which throws an escape character error in R on windows.
This was worked around by setting a static filename in the directory that the script is run from:
predict="tempgwr.txt"
While this works for a desktop user and makes things os-independent, it requires the user have write access to the directory the script is running in.
It might be better to set the filename with a suffix more dynamically from the os.getpid process for a result like tempgwr13725.txt in more dynamic settings.
from grass-addons.
Please consider to edit the Python script directly here and submit the changes as a pull request:
https://github.com/OSGeo/grass-addons/blob/master/grass7/imagery/i.image.bathymetry/i.image.bathymetry.py
from grass-addons.
from grass-addons.
The script was then able to get past this error. However, in line 293
predict = g.read_command("g.tempfile", pid=os.getpid()).strip() + '.txt'
a temporary file is written to hold the results of the GWR analysis.
On windows, this leads to a filename like this:
D:\grass\lake\u18wgs84\bathy.tmp/unknown\13752.5.txt , which throws an escape character error in R on windows.
This is bug in the G__temp_element() function (line 121).
from grass-addons.
On windows, this leads to a filename like this:
D:\grass\lake\u18wgs84\bathy.tmp/unknown\13752.5.txt , which throws an escape character error in R on windows.This is bug in the G__temp_element() function (line 121).
Probably G_convert_dirseps_to_host()
is missing? See
https://grass.osgeo.org/programming7/paths_8c.html#a0bd23f09c109997ed8ddc25c5d650698
from grass-addons.
On windows, this leads to a filename like this:
D:\grass\lake\u18wgs84\bathy.tmp/unknown\13752.5.txt , which throws an escape character error in R on windows.This is bug in the G__temp_element() function (line 121).
Probably
G_convert_dirseps_to_host()
is missing? See
https://grass.osgeo.org/programming7/paths_8c.html#a0bd23f09c109997ed8ddc25c5d650698
Yes you are right or use HOST_DIRSEP.
Yesterday I prepared patch (need test on MS Win), but I have trouble with Cross-Compilation (environment) GRASS GIS for Windows OS on GNU/Linux. Otherwise I would have opened a new PR.
from grass-addons.
Right, HOST_DIRSEP
is widely used in GRASS-core.
from grass-addons.
Yes you are right or use HOST_DIRSEP.
Yesterday I prepared patch (need test on MS Win), but I have trouble with Cross-Compilation (environment) GRASS GIS for Windows OS on GNU/Linux. Otherwise I would have opened a new PR.
While checking the entire core source code I found, besides lib/gis/tempfile.c
two more files in which HOST_DIRSEP
seems to be missing (unrelated but like worth to also fix in the same PR):
lib/display/r_raster.c
(2 times)display/d.mon/list.c
(4 times)
from grass-addons.
Isn't the issue more that the backslash is used rather than missing? If the error is about "an escape character" in R on Windows, that suggests that the backslashes in path are not escaped or that the string in generated R code (is there some in this case?) needs to be raw. It seems to me then that if you want to change it in grass core, you need to remove the backslashes from path rather than adding more of them and use forward slashes instead.
The question also is if g.tempfile is the right tool. Is the file huge or copied to mapset non-temporary directories? If not, standard Python temporary directory object used with a with
statement and a hardcoded file name might be a better option.
from grass-addons.
I just noticed a similar error for r.in.wms for 7.8.7 on Windows.
from grass-addons.
Related Issues (20)
- [Bug] i.fusion.hpf can longer be installed with g.extension HOT 5
- v.db.pyupdate warning during installation
- [Feat] i.sentinel.import: handle processing baselines HOT 3
- [Bug] Add concurrency groups/cancel in progress for skipping outdated CI runs
- Add tests to i.modis, i.landsat, i.sentinel download HOT 23
- Addons for plotting: Standardize parameters and flags HOT 3
- r.hydro.flatten: separate footprint of the impoundment from the downstream river
- Dependency Dashboard
- [Bug] Installing v.kriging fails HOT 2
- [Bug] r.fuzzy.set rounds shape/converts parameter decimal value to 0 HOT 6
- [Bug] v.surf.nnbathy: NameError: `StandardError` is not defined HOT 8
- Add per-test timeout for grass.gunittest tests
- Require the tests to pass in CI
- v.rast.move: empty keywords break addon overview script HOT 2
- [Bug] i.sentinel.download: give warning instead of errors if single files are corrupt
- v.surf.mass: Input should be vector "area" map? HOT 1
- [Bug] testsuite: do not run tests for deprecated module HOT 4
- [Bug] m.tnm.download and m.cdo.download fail to build on Windows server due to using external Python library requests
- r.stream.distance elevations with value of -1 [Bug]
- [Bug] Remove r.sim.water.mp from addons
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grass-addons.