r.mapcalc division error

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

r.mapcalc division error

Giuseppe Cinque
Hello,
if I launch this grass command in console editor of
jgrass1_1_x_build20081112015624:

grass r.mapcalc.exe outputLayout=inputLayout1/inputLayout2

in output there is:

Invalid map <inputLayout1\inputLayout2>
Parse error
r.mapcalc.exe : exit code: 1

My os is Windows.

Some idea?

Thank you,
Giuseppe
_______________________________________________
JGrass-devel mailing list
[hidden email]
https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-devel
Reply | Threaded
Open this post in threaded view
|

Re: r.mapcalc division error

Andrea Antonello
Hi Giuseppe,

> if I launch this grass command in console editor of
> jgrass1_1_x_build20081112015624:
>
> grass r.mapcalc.exe outputLayout=inputLayout1/inputLayout2
>
> in output there is:
>
> Invalid map <inputLayout1\inputLayout2>
> Parse error
> r.mapcalc.exe : exit code: 1
>
> My os is Windows.

this is indeed an odd problem we experienced at the lessons a the
university last Monday.
On windows the mapcalc has problems to interpret teh division simbol
/, intending it as path separator.

This is a GRASS problem and I would not know how to solve it, we will
have to report it to the GRASS community.


We should already have the java mapcalc version active, but the
equation parser we were using, jep, is no more open source. The
project closed the sources at some point and we will have to find
something new. we are currently searching for something.

Ideas and advices are very welcome.

Andrea




>
> Some idea?
>
> Thank you,
> Giuseppe
> _______________________________________________
> JGrass-devel mailing list
> [hidden email]
> https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-devel
>
_______________________________________________
JGrass-devel mailing list
[hidden email]
https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-devel
Reply | Threaded
Open this post in threaded view
|

Re: r.mapcalc division error

iomeneandrei
Ciao Andrea,
Andrea Antonello wrote
On windows the mapcalc has problems to interpret teh division simbol
/, intending it as path separator.

This is a GRASS problem and I would not know how to solve it, we will
have to report it to the GRASS community.
I have made some test, and it seems in some way a JGrass problem and not a GRASS problem.
I have used my winxp pc and GRASS 6.3.0 win native, downloaded from
http://grass.itc.it/grass63/binary/mswindows/native/WinGRASS-6.3.0-4-Setup.exe

If I use the command r.mapcalc.exe dem3=DEM1/DEM2 in GRASS I have no error. If I use the same command in JGrass console I have a parsing error:
Invalid map <DEMED50_UTM33\DEMED50_UTM33>
Parse error
r.mapcalc.exe : exit code: 1

What do you think about?

Thank you,

a

Andrea Borruso

----------------------------------------------------
email: aborruso@tin.it
website: http://blog.spaziogis.it
my 2.0 life: http://aborruso.spaziogis.it
feed: http://feeds2.feedburner.com/Tanto
38° 7' 48" N, 13° 21' 9" E
----------------------------------------------------
Reply | Threaded
Open this post in threaded view
|

Re: r.mapcalc division error

Andrea Antonello
[...]

> I have made some test, and it seems in some way a JGrass problem and not a
> GRASS problem.
> I have used my winxp pc and GRASS 6.3.0 win native, downloaded from
> http://grass.itc.it/grass63/binary/mswindows/native/WinGRASS-6.3.0-4-Setup.exe
>
> If I use the command r.mapcalc.exe dem3=DEM1/DEM2 in GRASS I have no error.
> If I use the same command in JGrass console I have a parsing error:
> Invalid map <DEMED50_UTM33\DEMED50_UTM33>
> Parse error
> r.mapcalc.exe : exit code: 1
>
> What do you think about?

Thanks for the test Andrea, as usual very appreciated and timesaving.

I am right now in my first week of vista for my freetime/home pc,
which we chose to be able to better support JGrass for windows user
(macosx users will have to help a bit more theirselves from now on :(
).

Now that you confirm me that this is a JGrass error, this will be my
first bugfix, since this is VERY annoing.
I'll come back on this soon, hopefully with good news.

Ciao
Andrea



>
> Thank you,
>
> a
>
>
>
> -----
> Andrea Borruso
>
> ----------------------------------------------------
> email: [hidden email]
> blog: http://blog.spaziogis.it
> ----------------------------------------------------
> --
> View this message in context: http://n2.nabble.com/r.mapcalc-division-error-tp1513933p2133021.html
> Sent from the JGrass-devel -- Developer list for jgrass mailing list archive at Nabble.com.
>
> _______________________________________________
> JGrass-devel mailing list
> [hidden email]
> https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-devel
>
_______________________________________________
JGrass-devel mailing list
[hidden email]
https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-devel
Reply | Threaded
Open this post in threaded view
|

Re: r.mapcalc division error

Andrea Antonello
Alright, I found the problem.
There is a buggy bug in the console engine.

The variables are "cleaned up" before being processed. That means that
backslashes are escaped with other backslashed in order to be sure
that the paths get usable under windows.

The problem is that when a slash comes, it is translated into a file
separatore, which in the case of windows is meant to be a backslash.

In the case of unix system the problem should not occurr, since it
stays the same.

In fact on windows machines this was a "help" from the author, which
assumed that the / could only be a piece of path. So assuming that
everyone knows that on windows the path separator is the other way
round \ , I removed the transform. for sure that should be no problem
on windows and I think that there should not be problems on unix
systems, too. Anyway I would prefer someone to test this before going
to commit the changes. I am on a windows machine right now, could
someone test a command that takes paths (ex gdal) in linux and also a
mapcalc.

I put a updated set of plugins here:
http://www.hydrologis.com/testfiles/plugins.tar.gz

If I get an answer soon, I could commit the change and make a build
over night, available for breakfast.

Ciao
Andrea






On Fri, Jan 9, 2009 at 3:02 PM, andrea antonello
<[hidden email]> wrote:

> [...]
>> I have made some test, and it seems in some way a JGrass problem and not a
>> GRASS problem.
>> I have used my winxp pc and GRASS 6.3.0 win native, downloaded from
>> http://grass.itc.it/grass63/binary/mswindows/native/WinGRASS-6.3.0-4-Setup.exe
>>
>> If I use the command r.mapcalc.exe dem3=DEM1/DEM2 in GRASS I have no error.
>> If I use the same command in JGrass console I have a parsing error:
>> Invalid map <DEMED50_UTM33\DEMED50_UTM33>
>> Parse error
>> r.mapcalc.exe : exit code: 1
>>
>> What do you think about?
>
> Thanks for the test Andrea, as usual very appreciated and timesaving.
>
> I am right now in my first week of vista for my freetime/home pc,
> which we chose to be able to better support JGrass for windows user
> (macosx users will have to help a bit more theirselves from now on :(
> ).
>
> Now that you confirm me that this is a JGrass error, this will be my
> first bugfix, since this is VERY annoing.
> I'll come back on this soon, hopefully with good news.
>
> Ciao
> Andrea
>
>
>
>>
>> Thank you,
>>
>> a
>>
>>
>>
>> -----
>> Andrea Borruso
>>
>> ----------------------------------------------------
>> email: [hidden email]
>> blog: http://blog.spaziogis.it
>> ----------------------------------------------------
>> --
>> View this message in context: http://n2.nabble.com/r.mapcalc-division-error-tp1513933p2133021.html
>> Sent from the JGrass-devel -- Developer list for jgrass mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> JGrass-devel mailing list
>> [hidden email]
>> https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-devel
>>
>
_______________________________________________
JGrass-devel mailing list
[hidden email]
https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-devel