JGRASS support processing by command line

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

JGRASS support processing by command line

kaytomuriel
Hello,
I need to run codes JGRASS through the console! by command line execute JGRASS codes.

one analogy, with GRASS and Shell Script..

this example set the ambient variables, PATH


#!/bin/bash
clear
GISBASE=/usr/lib/grass64
GISRC=$HOME/.grassrc6
GISDBASE=Gis-script
LOCATION_NAME=SRTM2
MAPSET=Apostila2
cat << EOF > $GISRC
GISDBASE: $GISDBASE
LOCATION_NAME: $LOCATION_NAME
MAPSET: $MAPSET
EOF
export GISBASE GISRC
export PATH=$GISBASE/bin:$GISBASE/scripts:$PATH
export LD_LIBRARY_PATH=$GISBASE/lib:$LD_LIBRARY_PATH
export GIS_LOCK=$$
export GRASS_TRUECOLOR=TRUE
export GRASS_PNG_COMPRESSION=9
export GRASS_HEIGHT=640
export GRASS_WIDTH=400
r.in.gdal input=/home/uft/Download/srtm_tutorial_bil/98809673.bil output=srtm


Thanks,

Kayto Muriel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JGRASS support processing by command line

Andrea Antonello
Hi Kayto,
we once made a presentation that contains quite the example you are
looking for. It is written in Italian, but the most important parts
are scripting, so you should have no problems with it:
http://www.slideshare.net/moovida/be-groovy-with-jgrass-presentation

The JGrass version used for this tutorial is the one you can find
here: http://code.google.com/p/jgrass/downloads/list

Best regards,
Andrea


On Thu, Mar 31, 2011 at 1:17 AM, kaytomuriel <[hidden email]> wrote:

> Hello,
> I need to run codes JGRASS through the console! by command line execute
> JGRASS codes.
>
> one analogy, with GRASS and Shell Script..
>
> this example set the ambient variables, PATH
>
>
> #!/bin/bash
> clear
> GISBASE=/usr/lib/grass64
> GISRC=$HOME/.grassrc6
> GISDBASE=Gis-script
> LOCATION_NAME=SRTM2
> MAPSET=Apostila2
> cat << EOF > $GISRC
> GISDBASE: $GISDBASE
> LOCATION_NAME: $LOCATION_NAME
> MAPSET: $MAPSET
> EOF
> export GISBASE GISRC
> export PATH=$GISBASE/bin:$GISBASE/scripts:$PATH
> export LD_LIBRARY_PATH=$GISBASE/lib:$LD_LIBRARY_PATH
> export GIS_LOCK=$$
> export GRASS_TRUECOLOR=TRUE
> export GRASS_PNG_COMPRESSION=9
> export GRASS_HEIGHT=640
> export GRASS_WIDTH=400
> r.in.gdal input=/home/uft/Download/srtm_tutorial_bil/98809673.bil
> output=srtm
>
>
> Thanks,
>
> Kayto Muriel
>
> --
> View this message in context: http://gis.638310.n2.nabble.com/JGRASS-support-processing-by-command-line-tp6225323p6225323.html
> Sent from the JGrass-users -- List for jgrass users mailing list archive at Nabble.com.
> _______________________________________________
> JGrass-users mailing list
> [hidden email]
> https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-users
>
_______________________________________________
JGrass-users mailing list
[hidden email]
https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JGRASS support processing by command line

kaytomuriel
Thanks Andrea,

but i want to run this codes outside the JGrass program, without interfaces graphics.

I will see the result after the run batch codes, exporting the archives for one location, and open with GRASS GIS.

Then i need to know how to execute one script with codes JGRASS and GRASS by one command in linux console (shell script) without open the JGrass program.

Kayto Muriel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JGRASS support processing by command line

Andrea Antonello
Hi Kayto,
sorry, I didn't realize that.

Are you interested in JGrass algorithms? JGrass doesn't have a
commandline scripting version. I am wondering why you are not using
the GRASS scripting?For that purpose it might be better.

If instead you want to use JGrass modules, then I might have the
solution for you. But first I need to understand what you want to do.

Ciao,
Andrea



On Thu, Mar 31, 2011 at 4:30 PM, kaytomuriel <[hidden email]> wrote:

> Thanks Andrea,
>
> but i want to run this codes outside the JGrass program, without interfaces
> graphics.
>
> I will see the result after the run batch codes, exporting the archives for
> one location, and open with GRASS GIS.
>
> Then i need to know how to execute one script with codes JGRASS and GRASS by
> one command in linux console (shell script) without open the JGrass program.
>
> Kayto Muriel
>
> --
> View this message in context: http://gis.638310.n2.nabble.com/JGRASS-support-processing-by-command-line-tp6225323p6227355.html
> Sent from the JGrass-users -- List for jgrass users mailing list archive at Nabble.com.
> _______________________________________________
> JGrass-users mailing list
> [hidden email]
> https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-users
>
_______________________________________________
JGrass-users mailing list
[hidden email]
https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JGRASS support processing by command line

kaytomuriel
I need to execute commands of GRASS and JGRASS in same script, without interfaces graphics.
I was using GRASS script, but i need to run "jgrass h.pitfiller --igrass-elevation elevation --ograss-pit pit" too in batch file, and only Grass not support several commands that JGrass supports.


I want create an automated way of execute Grass and JGrass commands, can be with other languages as Java to access JGrass program and execute some commands. For in the future provide this in Internet using J2EE.

I want to compile and execute an JGrass script without click in compile and run in the JGrass program, only using one command to execute my script.

Is possible to use JGrass modules through of Java programs?
Case true, how proceed?

If i can access JGrass by Java programs, my problem would be resolved because i can run the java programs with the command  " java -jar name.jar"

Thanks,
Kayto Muriel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JGRASS support processing by command line

Andrea Antonello
Hi Katyo,
we have been working quite hard on a new project, which aims to
extract all the processing power of JGrass into a library.
In the next two weeks there will be a lot of cleanup and there will be
the first release of the project.

The project, called jgrasstools has its homepage in: www.jgrasstools.org

It represents a big step forward in code cleanup, testing and bugfixing.

It can be executed as a java -jar from commadnline and might be what
you are searching for.

I wrote down an example to give you an introduction to what it might
look like: http://code.google.com/p/jgrasstools/wiki/JGrasstoolsStandalone

The scripting syntax changed, because we joined the USDA and Colorado
State University in using the OMS3 project to handle modules and link
them together (in fact it is possible to do very complex things if
necessary).

A modules overview that is generated from the code, can be found here:
http://code.google.com/p/jgrasstools/wiki/ModulesOverview

If you are interested in working with that, I would like to ask you to
join us in the jgrasstools mailinglist:
http://groups.google.com/group/jgrasstools

As I said, in the next two weeks we will be working hard on the
release, so we will have time to help you to get along and enhance the
documentation.


Best regards,
Andrea



On Thu, Mar 31, 2011 at 6:22 PM, kaytomuriel <[hidden email]> wrote:

> I need to execute commands of GRASS and JGRASS in same script, without
> interfaces graphics.
> I was using GRASS script, but i need to run "jgrass h.pitfiller
> --igrass-elevation elevation --ograss-pit pit" too in batch file, and only
> Grass not support several commands that JGrass supports.
>
>
> I want create an automated way of execute Grass and JGrass commands, can be
> with other languages as Java to access JGrass program and execute some
> commands. For in the future provide this in Internet using J2EE.
>
> I want to compile and execute an JGrass script without click in compile and
> run in the JGrass program, only using one command to execute my script.
>
> Is possible to use JGrass modules through of Java programs?
> Case true, how proceed?
>
> If i can access JGrass by Java programs, my problem would be resolved
> because i can run the java programs with the command  " java -jar name.jar"
>
> Thanks,
> Kayto Muriel
>
>
> --
> View this message in context: http://gis.638310.n2.nabble.com/JGRASS-support-processing-by-command-line-tp6225323p6227792.html
> Sent from the JGrass-users -- List for jgrass users mailing list archive at Nabble.com.
> _______________________________________________
> JGrass-users mailing list
> [hidden email]
> https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-users
>
_______________________________________________
JGrass-users mailing list
[hidden email]
https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JGRASS support processing by command line

kaytomuriel
Hi Andrea,
What are the literature bibliography of the hidrologic and mathematic models you was based for developing the project?

I am trying to use jgrasstools, but still can't.

the line command : " java -Xmx500m -jar jgrasstools-0.1dev20110331.jar PitFiller.jgrass" returned an error:

http://img84.imageshack.us/f/erroscriptjgrass.jpg/

thanks for attention!

Best regards,
Kayto
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JGRASS support processing by command line

Andrea Antonello
Hi Katyo,

> What are the literature bibliography of the hidrologic and mathematic models
> you was based for developing the project?

You can find all bibliographic references and everything about the
theory used in the module on professor Rigon's homepage:
http://tinyurl.com/3mvtqsh
In particular under the pubblications/ebooks there is the horton manual:
http://www.ing.unitn.it/dica/tools/download/Quaderni/Horton%20manual.pdf

> I am trying to use jgrasstools, but still can't.
>
> the line command : " java -Xmx500m -jar jgrasstools-0.1dev20110331.jar
> PitFiller.jgrass" returned an error:
>
> http://img84.imageshack.us/f/erroscriptjgrass.jpg/

In your test you used the example found in the code (fair enough, my
error). Please try instead to use the one found here:
http://code.google.com/p/jgrasstools/wiki/JGrasstoolsStandalone
I created a pitfiller example with many comments.

As I said, in the next two weeks we will provide updated scripts for
most of the modules. Anyways, if you have problems, feel free to send
them in.

Best regards,
Andrea


> thanks for attention!
>
> Best regards,
> Kayto
>
> --
> View this message in context: http://gis.638310.n2.nabble.com/JGRASS-support-processing-by-command-line-tp6225323p6232955.html
> Sent from the JGrass-users -- List for jgrass users mailing list archive at Nabble.com.
> _______________________________________________
> JGrass-users mailing list
> [hidden email]
> https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-users
>
_______________________________________________
JGrass-users mailing list
[hidden email]
https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JGRASS support processing by command line

Riccardo Rigon-3
In reply to this post by kaytomuriel
Dear Kayto,

The Horton Machine manual contains the main bibliografy that regards the tools for terrain analysis. Other sources of information are:

Wilson and Gallant, Terrain analysis:principles and applications, Wiley, 2000
Peckham R.J,, and Jordan, Digital terrain modelling, Springer, 2007

For calculation about radiation geometry, you can see the work by

J. Corripio, vecrorial algebra for calculating terrain parameters, int journ. Geographical information science, 2003

Other tools, as written in the Horton machine manual came from my own research, which you can find on my website (just google riccardo rigon).

For discussions about channels initiation just give a look to the appropriate post in http:abouthydrology.blogspot.com

Hope this helps,

Riccardo

Sent from my iPad

On Apr 2, 2011, at 2:51 AM, kaytomuriel <[hidden email]> wrote:

> Hi Andrea,
> What are the literature bibliography of the hidrologic and mathematic models
> you was based for developing the project?
>
> I am trying to use jgrasstools, but still can't.
>
> the line command : " java -Xmx500m -jar jgrasstools-0.1dev20110331.jar
> PitFiller.jgrass" returned an error:
>
> http://img84.imageshack.us/f/erroscriptjgrass.jpg/
>
> thanks for attention!
>
> Best regards,
> Kayto
>
> --
> View this message in context: http://gis.638310.n2.nabble.com/JGRASS-support-processing-by-command-line-tp6225323p6232955.html
> Sent from the JGrass-users -- List for jgrass users mailing list archive at Nabble.com.
> _______________________________________________
> JGrass-users mailing list
> [hidden email]
> https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-users
_______________________________________________
JGrass-users mailing list
[hidden email]
https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JGRASS support processing by command line

kaytomuriel
In reply to this post by Andrea Antonello
I only can execute scripts with basics commands as println("");
I tried to run examples of website, with other variables values, but no sucess.
   ERROR: " No such property sb for class Script1 "

Please, send me one example of script with resources needed to run basic functionalities of GRASS and JGRASS, i need to understand how to use this script OMS3, and how to develop scripts OMS3 sintax.

Because my scripts are returning an error that i'm not understand.


Best regards,
Kayto
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JGRASS support processing by command line

Andrea Antonello
Hi Kayto,

> I only can execute scripts with basics commands as println("");
> I tried to run examples of website, with other variables values, but no
> sucess.
>   ERROR: " No such property sb for class Script1 "

are you sure you are running the script of the page I sent you the link to?
The error you have is the same of the first one you run, which
suggests that the line:
def sb = new SimBuilder(logging:'OFF');
is missing, which applies to the script in the source code.

> Please, send me one example of script with resources needed to run basic
> functionalities of GRASS and JGRASS, i need to understand how to use this
> script OMS3, and how to develop scripts OMS3 sintax.
>
> Because my scripts are returning an error that i'm not understand.

Feel free to paste the script here and I will help you to make it run.
Anyways I have to move this discussion away from the JGrass
mailinglist into the jgrasstools mailinglist, to which I see you are
already subscribed.

Best regards,
Andrea




> Best regards,
> Kayto
>
> --
> View this message in context: http://gis.638310.n2.nabble.com/JGRASS-support-processing-by-command-line-tp6225323p6234083.html
> Sent from the JGrass-users -- List for jgrass users mailing list archive at Nabble.com.
> _______________________________________________
> JGrass-users mailing list
> [hidden email]
> https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-users
>
_______________________________________________
JGrass-users mailing list
[hidden email]
https://dev.fsc.bz.it/cgi-bin/mailman/listinfo/jgrass-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JGRASS support processing by command line

wew111
This post has NOT been accepted by the mailing list yet.
poker i am very impressed
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JGRASS support processing by command line

wew111
This post has NOT been accepted by the mailing list yet.
poker indonesia bestly good here thanks
Loading...