[R-sig-Geo] execGRASS and v.mkgrid gives "Parameter <coor> does not have float value"
Lars Dalby
lars.dalby at gmail.com
Mon Oct 1 14:58:59 CEST 2012
Hi
I have tried to post this via Nabble, but apparently that did not work. So I try here again. I apologise in case this leads to double posting.
I have been trying to expand a vector grid using the v.mkgrid command in GRASS via the execGRASS function in spgrass6. I have passed several other commands via execGRASS and it has worked perfectly. However when using the v.mkgrid function I get an error.
I work in a location with a Behrman projection which is a cylindrical equal area projection with units in meters.
I call:
execGRASS('v.mkgrid', parameters = list(map = 'VectorGrid', position = 'coor', coor = '-6358820,-17367529', grid = '142,360', box = '96486.28169014, 96486.28055556'))
and get this error message:
Error in doGRASS(cmd, flags = flags, ..., parameters = parameters, echoCmd = echoCmd) :
Parameter <coor> does not have float value
With great help from Micha at the GRASS-user list we tried to figure this out and found an old bug report, that seems to be somewhat related: http://trac.osgeo.org/grass/ticket/739
However the workaround suggested here does not really do the trick.
The thread I started on the GRASS-user list is here: http://osgeo-org.1560.n6.nabble.com/Rasterize-polygons-multiple-polygons-per-grid-cell-td5005264.html
A reproducible example and my session info is below.
Any hints to a workaround to this problem would be highly appreciated.
Thanks
-Lars
require(spgrass6)
# Replace the path with the path to the GRASS binaries on your system
loc <- initGRASS('/Applications/GRASS/GRASS-7.0.app/Contents/MacOS', home=tempdir(), override = TRUE)
execGRASS('v.mkgrid', parameters = list(map = 'VectorGrid', position = 'coor', coor = '-6358820,-17367529', grid = '142,360', box = '96486.28169014, 96486.28055556'))
# Error in doGRASS(cmd, flags = flags, ..., parameters = parameters, echoCmd = echoCmd) :
# Parameter <coor> does not have float value
unlink_.gislock()
# sessionInfo():
# R version 2.15.1 (2012-06-22)
# Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)
#
# locale:
# [1] C/en_US.UTF-8/C/C/C/C
#
# attached base packages:
# [1] stats graphics grDevices utils datasets methods
# [7] base
#
# other attached packages:
# [1] raster_2.0-12 spgrass6_0.7-10 XML_3.9-4
# [4] sp_0.9-99
#
# loaded via a namespace (and not attached):
# [1] grid_2.15.1 lattice_0.20-10 tools_2.15.1
Lars Dalby, Msc., PhD student
E: lada at dmu.dk | T: +45 871 59013
Department of Bioscience, Aarhus University
Grenåvej 14, 8410 Rønde, Denmark
More information about the R-sig-Geo
mailing list