Grass console

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

Grass console

iomeneandrei
Hi all,
I have jgrass3_prealpha_win32, and I'm trying to use the Jgrass console.
I have set the grass console preferences and I have this default grass installation folder value:
"jgrass/plugins/eu.hydrologis.jgrass.grass_1.0.0/windows/grass/grass/"
I have this runtime informations:
"jgrass/plugins/eu.hydrologis.jgrass.console_1.0.0/rt/"
I have not set any Mapset.

I wrote this simple code:
 grass {
  g.region.exe --help
 }

And I have:
-------------------------------- Compiling... ---------------------------------
untitled.jgrass
untitled.jgrass - 1 model/s compiled, total compilation time: 62 ms

-------------------------------------------------------------------------------
Beanshell, Version 2.0b4, Copyright (C) Pat Niemeyer
------------------------------ Running model... -------------------------------
g.region.exe : exit code: -1073741515

Total run time: 141 ms

I do not have the command result. What's wrong in my procedure?

Thank you,

Andrea
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: Grass console

Andrea Antonello
Hi Andrea,

> I have jgrass3_prealpha_win32, and I'm trying to use the Jgrass console.
> I have set the grass console preferences and I have this default grass
> installation folder value:
> "jgrass/plugins/eu.hydrologis.jgrass.grass_1.0.0/windows/grass/grass/"
> I have this runtime informations:
> "jgrass/plugins/eu.hydrologis.jgrass.console_1.0.0/rt/"
> I have not set any Mapset.
>
> I wrote this simple code:
>  grass {
>        g.region.exe --help
>  }
>
> And I have:
> -------------------------------- Compiling...
> ---------------------------------
> untitled.jgrass
> untitled.jgrass - 1 model/s compiled, total compilation time: 62 ms
>
> -------------------------------------------------------------------------------
> Beanshell, Version 2.0b4, Copyright (C) Pat Niemeyer
> ------------------------------ Running model...
> -------------------------------
> g.region.exe : exit code: -1073741515
>
> Total run time: 141 ms
>
> I do not have the command result. What's wrong in my procedure?

That should not happen. I will test that as soon as possible on a
windows machine and give you some feedback. In the meanwhile could you
just do a small test for me?
Go into the preferences, where you have the path to the rt folder and
make a change and then undo the change. This only so that the apply
button gets activated. At that point push the apply button and try to
execute the console again.
Let me know if that works.

Ciao
Andrea



>
> Thank you,
>
> Andrea
>
>
> -----
> Andrea Borruso
>
> ----------------------------------------------------
> email: [hidden email]
> blog: http://blog.spaziogis.it
> ----------------------------------------------------
> --
> View this message in context: http://www.nabble.com/Grass-console-tp17124344p17124344.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: Grass console

iomeneandrei
Hi Andrea

Andrea Antonello-3 wrote
Go into the preferences, where you have the path to the rt folder and
make a change and then undo the change. This only so that the apply
button gets activated. At that point push the apply button and try to
execute the console again.
Let me know if that works.
I have used your indications, but I have the some bad result.
I will wait for your test in a win machine.

Ciao e grazie,

Andrea
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: Grass console

iomeneandrei
Hi all,
I'm trying to use jgrass console in ubuntu.
I wrote once again this simple code:
 grass {
  g.region.exe --help
 }

Now I have this error:
untitled.jgrass(15) : error E3105: missing native model identifier before 'g.region.exe'.
untitled.jgrass - 1 model/s compiled, total compilation time: 369 ms

Here you have two screenshot of my jgrass settings:
http://www.flickr.com/photos/borruso/2479145744/
http://www.flickr.com/photos/borruso/2479145746/

What's wrong?

Thank you,

Andrea
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: Grass console

Andrea Antonello
Hi Andrea,

> I'm trying to use jgrass console in ubuntu.
> I wrote once again this simple code:
>  grass {
>  g.region.exe --help
>  }
>
> Now I have this error:
> untitled.jgrass(15) : error E3105: missing native model identifier before
> 'g.region.exe'.
> untitled.jgrass - 1 model/s compiled, total compilation time: 369 ms
>
> Here you have two screenshot of my jgrass settings:
> http://www.flickr.com/photos/borruso/2479145744/
> http://www.flickr.com/photos/borruso/2479145746/
>
> What's wrong?

2 things:

1) the path should be /usr/lib/grass without the bin (which represents
what in GRASS is called GISBASE)
2) in linux the commands are without the trailing .exe

After that it will work, I am sure (and can someone be sure about software?) :)

Andrea



>
> Thank you,
>
> Andrea
>
> -----
> Andrea Borruso
>
> ----------------------------------------------------
> email: [hidden email]
> blog: http://blog.spaziogis.it
> ----------------------------------------------------
> --
> View this message in context: http://www.nabble.com/Grass-console-tp17124344p17155732.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: Grass console

iomeneandrei
Hi Andrea

Andrea Antonello-3 wrote
2 things:

2) in linux the commands are without the trailing .exe
I feel myself so stupid (exe in linux!!!).

Now I have corrected myself, and I have written in Jgrass for linux:
 grass {
  g.region --help
 }

Now I have this message:
untitled.jgrass(15) : error E3105: missing native model identifier before 'g.region'.

I do not know if this is an error, but however I do not have g.region command help. Probably I must set something in jgrass. Am I right?

Thank you,

Andrea

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: Grass console

Andrea Antonello
[...]

>  > 2) in linux the commands are without the trailing .exe
>  >
>  I feel myself so stupid (exe in linux!!!).
>
>  Now I have corrected myself, and I have written in Jgrass for linux:
>   grass {
>   g.region --help
>   }
>
>  Now I have this message:
>
> untitled.jgrass(15) : error E3105: missing native model identifier before
>  'g.region'.
>
>  I do not know if this is an error, but however I do not have g.region
>  command help. Probably I must set something in jgrass. Am I right?

Hi Andrea, did you also remove the bin from the grass path?

Ciao
Andrea



>
>
>  Thank you,
>
>  Andrea
>
>
>
>  -----
>  Andrea Borruso
>
>  ----------------------------------------------------
>  email: [hidden email]
>  blog: http://blog.spaziogis.it
>  ----------------------------------------------------
>  --
>  View this message in context: http://www.nabble.com/Grass-console-tp17124344p17183814.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: Grass console

Andrea Antonello
In reply to this post by iomeneandrei
>  I have jgrass3_prealpha_win32, and I'm trying to use the Jgrass console.
>  I have set the grass console preferences and I have this default grass
>  installation folder value:
>  "jgrass/plugins/eu.hydrologis.jgrass.grass_1.0.0/windows/grass/grass/"
>  I have this runtime informations:
>  "jgrass/plugins/eu.hydrologis.jgrass.console_1.0.0/rt/"
>  I have not set any Mapset.
>
>  I wrote this simple code:
>   grass {
>         g.region.exe --help
>   }
>
>  And I have:
>  -------------------------------- Compiling...
>  ---------------------------------
>  untitled.jgrass
>  untitled.jgrass - 1 model/s compiled, total compilation time: 62 ms
>
>  -------------------------------------------------------------------------------
>  Beanshell, Version 2.0b4, Copyright (C) Pat Niemeyer
>  ------------------------------ Running model...
>  -------------------------------
>  g.region.exe : exit code: -1073741515
>
>  Total run time: 141 ms
>
>  I do not have the command result. What's wrong in my procedure?

Nothing, thanks to Silvia we finally went after the problem.

It seems that the paths in the preferences on windows are written a
bit wrong by the system, i.e.
E:\something
is resolved to
/E:/something

Could you check if that applies also to you?
If you experience that problem just push the browse button at the
right and as the filesystem browser pops up, just push "ok". This will
write the path down properly.

After that on our windows machine it worked.

We will have to find out how to solve this.

Ciao
Andrea






>  Thank you,
>
>  Andrea
>
>
>  -----
>  Andrea Borruso
>
>  ----------------------------------------------------
>  email: [hidden email]
>  blog: http://blog.spaziogis.it
>  ----------------------------------------------------
>  --
>  View this message in context: http://www.nabble.com/Grass-console-tp17124344p17124344.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: Grass console

iomeneandrei
In reply to this post by Andrea Antonello
Hi Andrea,
now it's all ok. I have set Mapset parameter and it's all ok. Thank you

And now I must study GRASS!!

A stupid question, and sorry for my repetitiveness. Imagine I want to develop a simple plugin to set visually (using a graphic interface) a location's projection. I want to use "g.setproj" grass command. Can I use the console in background, and develop a graphic interface that will make this work?

Another stupid question ;-). Imagine I have a geotiff file. I want to apply r.contour command to it in jgrass. Do I must first convert it in grass format?

Thank you for all,

Andrea
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: Grass console

Andrea Antonello
>  now it's all ok. I have set Mapset parameter and it's all ok. Thank you

Great!

>  And now I must study GRASS!!

Yes, everyone should do that :)

>  A stupid question, and sorry for my repetitiveness. Imagine I want to
>  develop a simple plugin to set visually (using a graphic interface) a
>  location's projection. I want to use "g.setproj" grass command. Can I use
>  the console in background, and develop a graphic interface that will make
>  this work?

This is no stupid question :)
Read the last part about r.in.gdal in the following post:
http://jgrasstechtips.blogspot.com/2008/04/how-to-create-command-or-presenting.html

There are two steps, the first is the extention point for the action
and the second one is teh xml file that describes the command.

Here is the deal, which will apply to everyone. If someone wants to
make the xml files for the commands (GRASS or JGrass) that do not have
a gui right now (step 2 of the post), I promise to take care of
implementing the action in JGrass as they are sent to me (step 1 of
the post).

>  Another stupid question ;-). Imagine I have a geotiff file. I want to apply
>  r.contour command to it in jgrass. Do I must first convert it in grass
>  format?

Yes, that is right. GRASS commands work only inside the GRASS
workspace on the GRASS binary format.

Good luck,
Andrea




>  Thank you for all,
>
>
>  Andrea
>
>  -----
>  Andrea Borruso
>
>  ----------------------------------------------------
>  email: [hidden email]
>  blog: http://blog.spaziogis.it
>  ----------------------------------------------------
>  --
>  View this message in context: http://www.nabble.com/Grass-console-tp17124344p17185196.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: Grass console

iomeneandrei
In reply to this post by Andrea Antonello
Hi Andrea and thank you to you and Silvia.

Andrea Antonello-3 wrote
Nothing, thanks to Silvia we finally went after the problem.
I have made the corrections as you can see here:
http://www.flickr.com/photos/borruso/2485755969/sizes/o/
http://www.flickr.com/photos/borruso/2485756019/sizes/o/

Now I have:
"ERROR: default region is not set
g.region.exe : exit code: 1"

Is it normal?

ciao,

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: Grass console

Andrea Antonello
[...]
>  Now I have:
>  "ERROR: default region is not set
>  g.region.exe : exit code: 1"
>
>  Is it normal?

That tells us that your GRASS workspace is a bit strange. This could
happen when bringing workspaces from linux to windows, since the
casesensitivity is a bit a problem and on fat filesystems some things
get lost. :)

I don't know if that is your problem, but if you move workspaces it is
always better to make a zip out of it.

But back to your problem:

1) in the pic I see you have spearfish60. Are you sure that is mapset
and not location?
2) if the region is somehow corrupted, try to launch: grass g.region.exe -d
which should fix it.

Let me know,
Andrea



>
>  ciao,
>
>
>  a
>
>
>
>  -----
>  Andrea Borruso
>
>  ----------------------------------------------------
>  email: [hidden email]
>  blog: http://blog.spaziogis.it
>  ----------------------------------------------------
>  --
>  View this message in context: http://www.nabble.com/Grass-console-tp17124344p17187440.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: Grass console

iomeneandrei
Hi Andrea,
Andrea Antonello-3 wrote
That tells us that your GRASS workspace is a bit strange.
I have built a mapset from scratch, and now it's all ok.

Once again, thank you.

ciao,

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: Grass console

Andrea Antonello
[...]
> > That tells us that your GRASS workspace is a bit strange.
>  >
>  I have built a mapset from scratch, and now it's all ok.
>
>  Once again, thank you.

Good to hear! :)

Ciao
Andrea


>
>
>  ciao,
>
>  a
>
>  -----
>  Andrea Borruso
>
>  ----------------------------------------------------
>  email: [hidden email]
>  blog: http://blog.spaziogis.it
>  ----------------------------------------------------
>  --
>  View this message in context: http://www.nabble.com/Grass-console-tp17124344p17189815.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: Grass console

iomeneandrei
In reply to this post by Andrea Antonello
Hi Andrea,
I have read your below sentence:
Andrea Antonello-3 wrote
If someone wants to make the xml files for the commands (GRASS or JGrass) that do not have a gui right now (step 2 of the post), I promise to take care of implementing the action in JGrass as they are sent to me (step 1 of the post).
Then it seems that there exist several guis for grass operations. I'm not able to find them. I'm able to add a grass layer from a mapset, but where are the guis for "grass" operation?

Thank you,

Andrea
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: Grass console

Andrea Antonello
Hi Andrea,

> Hi Andrea,
> I have read your below sentence:
>
> Andrea Antonello-3 wrote:
>>
>> If someone wants to make the xml files for the commands (GRASS or JGrass)
>> that do not have a gui right now (step 2 of the post), I promise to take
>> care of implementing the action in JGrass as they are sent to me (step 1
>> of the post).
>>
> Then it seems that there exist several guis for grass operations. I'm not
> able to find them. I'm able to add a grass layer from a mapset, but where
> are the guis for "grass" operation?

the problem is that no one ever wrote one and we are too busy with
other development parts to di it now. So What I was saying is that if
someone starts to create the GRASS commands definitions, I will create
a GRASS menu entry with all those commands in it and deploy it in the
release.
Wanna try? :)

Ciao
Andrea



>
> Thank you,
>
> Andrea
>
> -----
> Andrea Borruso
>
> ----------------------------------------------------
> email: [hidden email]
> blog: http://blog.spaziogis.it
> ----------------------------------------------------
> --
> View this message in context: http://www.nabble.com/Grass-console-tp17124344p17289528.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